content
stringlengths
1
1.04M
input_ids
sequencelengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
import datetime import typing from networkmonitor import OldConfig from networkmonitor.src.configuration import IConfig, ContextConfig from networkmonitor.src.protocols import IProtocols, ContextProtocols from networkmonitor.src import Configuration from networkmonitor.src import Nodes from networkmonitor.src import InvalidProtocol, InvalidNodeConfiguration from networkmonitor.src import RefreshTimer class Monitor(): """ Monitor is the working class that checks all the requested nodes. """
[ 198, 11748, 4818, 8079, 198, 11748, 19720, 198, 6738, 3127, 41143, 1330, 5706, 16934, 198, 6738, 3127, 41143, 13, 10677, 13, 11250, 3924, 1330, 314, 16934, 11, 30532, 16934, 198, 6738, 3127, 41143, 13, 10677, 13, 11235, 4668, 82, 1330, 314, 19703, 4668, 82, 11, 30532, 19703, 4668, 82, 198, 6738, 3127, 41143, 13, 10677, 1330, 28373, 198, 6738, 3127, 41143, 13, 10677, 1330, 399, 4147, 198, 6738, 3127, 41143, 13, 10677, 1330, 17665, 19703, 4668, 11, 17665, 19667, 38149, 198, 6738, 3127, 41143, 13, 10677, 1330, 22539, 48801, 198, 198, 4871, 18289, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 18289, 318, 262, 1762, 1398, 326, 8794, 477, 262, 9167, 13760, 13, 198, 220, 220, 220, 37227, 628, 198 ]
4.188525
122
from django.contrib import admin from welltory import models admin.site.register(models.Sleep, SleepAdmin) admin.site.register(models.Steps, StepsAdmin) admin.site.register(models.Geo, GeoAdmin)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 880, 83, 652, 1330, 4981, 628, 628, 198, 198, 28482, 13, 15654, 13, 30238, 7, 27530, 13, 40555, 11, 17376, 46787, 8, 198, 28482, 13, 15654, 13, 30238, 7, 27530, 13, 8600, 82, 11, 32144, 46787, 8, 198, 28482, 13, 15654, 13, 30238, 7, 27530, 13, 10082, 78, 11, 32960, 46787, 8, 198 ]
3.174603
63
from Pyro5 import api from ...core._signals import _CMMCoreSignaler
[ 6738, 44954, 20, 1330, 40391, 198, 198, 6738, 2644, 7295, 13557, 12683, 874, 1330, 4808, 24187, 9655, 382, 11712, 36213, 628 ]
3.333333
21
from django.contrib import admin from .models import Tag,Ingredient admin.site.register(Tag) admin.site.register(Ingredient)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 764, 27530, 1330, 17467, 11, 27682, 445, 1153, 198, 198, 28482, 13, 15654, 13, 30238, 7, 24835, 8, 198, 28482, 13, 15654, 13, 30238, 7, 27682, 445, 1153, 8 ]
3.205128
39
""" PROIECT Colorarea imaginilor folosind autoencoder si invatarea automata Badea Adrian Catalin, grupa 334, anul III, FMI """ import pdb from DataSet import * from AeModel import * data_set: DataSet = DataSet() data_set.scene_name = 'forest' ae_model: AeModel = AeModel(data_set) ae_model.define_the_model() ae_model.compile_the_model() ae_model.train_the_model() ae_model.evaluate_the_model() data_set: DataSet = DataSet() data_set.scene_name = 'coast' ae_model: AeModel = AeModel(data_set) ae_model.define_the_model() ae_model.compile_the_model() ae_model.train_the_model() ae_model.evaluate_the_model()
[ 37811, 201, 198, 220, 220, 220, 21965, 40, 9782, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 5315, 20337, 25007, 346, 273, 5955, 418, 521, 1960, 6571, 66, 12342, 33721, 800, 265, 20337, 3557, 1045, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 347, 671, 64, 21462, 5181, 14414, 11, 22848, 8957, 42819, 11, 281, 377, 6711, 11, 376, 8895, 201, 198, 37811, 201, 198, 201, 198, 11748, 279, 9945, 201, 198, 6738, 6060, 7248, 1330, 1635, 201, 198, 6738, 37532, 17633, 1330, 1635, 201, 198, 201, 198, 201, 198, 7890, 62, 2617, 25, 6060, 7248, 796, 6060, 7248, 3419, 201, 198, 7890, 62, 2617, 13, 29734, 62, 3672, 796, 705, 29623, 6, 201, 198, 3609, 62, 19849, 25, 37532, 17633, 796, 37532, 17633, 7, 7890, 62, 2617, 8, 201, 198, 201, 198, 3609, 62, 19849, 13, 13086, 62, 1169, 62, 19849, 3419, 201, 198, 3609, 62, 19849, 13, 5589, 576, 62, 1169, 62, 19849, 3419, 201, 198, 3609, 62, 19849, 13, 27432, 62, 1169, 62, 19849, 3419, 201, 198, 3609, 62, 19849, 13, 49786, 62, 1169, 62, 19849, 3419, 201, 198, 201, 198, 201, 198, 201, 198, 7890, 62, 2617, 25, 6060, 7248, 796, 6060, 7248, 3419, 201, 198, 7890, 62, 2617, 13, 29734, 62, 3672, 796, 705, 1073, 459, 6, 201, 198, 3609, 62, 19849, 25, 37532, 17633, 796, 37532, 17633, 7, 7890, 62, 2617, 8, 201, 198, 201, 198, 3609, 62, 19849, 13, 13086, 62, 1169, 62, 19849, 3419, 201, 198, 3609, 62, 19849, 13, 5589, 576, 62, 1169, 62, 19849, 3419, 201, 198, 3609, 62, 19849, 13, 27432, 62, 1169, 62, 19849, 3419, 201, 198, 3609, 62, 19849, 13, 49786, 62, 1169, 62, 19849, 3419, 201, 198, 201, 198 ]
2.321799
289
from nodes.core import * from nodes.connect import * from nodes.util import * import numpy as np import math
[ 6738, 13760, 13, 7295, 1330, 1635, 198, 6738, 13760, 13, 8443, 1330, 1635, 198, 6738, 13760, 13, 22602, 1330, 1635, 628, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 10688 ]
3.666667
30
import sys sys.path.append("..") from common.util import preprocess, create_co_matrix, cos_similarity text = "You say goobye and I say hello." corpus, word_to_id, id_to_word = preprocess(text) vocab_size = len(word_to_id) C = create_co_matrix(corpus, vocab_size) c0 = C[word_to_id["you"]] c1 = C[word_to_id["i"]] print(cos_similarity(c0, c1))
[ 11748, 25064, 201, 198, 17597, 13, 6978, 13, 33295, 7203, 492, 4943, 201, 198, 6738, 2219, 13, 22602, 1330, 662, 14681, 11, 2251, 62, 1073, 62, 6759, 8609, 11, 8615, 62, 38610, 414, 201, 198, 201, 198, 201, 198, 5239, 796, 366, 1639, 910, 467, 672, 5948, 290, 314, 910, 23748, 526, 201, 198, 10215, 79, 385, 11, 1573, 62, 1462, 62, 312, 11, 4686, 62, 1462, 62, 4775, 796, 662, 14681, 7, 5239, 8, 201, 198, 18893, 397, 62, 7857, 796, 18896, 7, 4775, 62, 1462, 62, 312, 8, 201, 198, 34, 796, 2251, 62, 1073, 62, 6759, 8609, 7, 10215, 79, 385, 11, 12776, 397, 62, 7857, 8, 201, 198, 201, 198, 66, 15, 796, 327, 58, 4775, 62, 1462, 62, 312, 14692, 5832, 8973, 60, 201, 198, 66, 16, 796, 327, 58, 4775, 62, 1462, 62, 312, 14692, 72, 8973, 60, 201, 198, 4798, 7, 6966, 62, 38610, 414, 7, 66, 15, 11, 269, 16, 4008, 201, 198 ]
2.229814
161
import math import json import random import uuid import SocketServer import threading import time import key_derivation from .bucketset import BucketSet from .hashing import hash_function, random_id from .peer import Peer from .shortlist import Shortlist k = 20 alpha = 3 id_bits = 128 iteration_sleep = 1 keysize = 2048 DEFAULT_TTL = 604800 # = 7 days, in seconds.
[ 11748, 10688, 198, 11748, 33918, 198, 11748, 4738, 198, 11748, 334, 27112, 198, 11748, 47068, 10697, 198, 11748, 4704, 278, 198, 11748, 640, 198, 11748, 1994, 62, 1082, 26939, 198, 198, 6738, 764, 27041, 1039, 316, 1330, 48353, 7248, 198, 6738, 764, 71, 2140, 1330, 12234, 62, 8818, 11, 4738, 62, 312, 198, 6738, 764, 33350, 1330, 41139, 198, 6738, 764, 19509, 4868, 1330, 10073, 4868, 198, 198, 74, 796, 1160, 198, 26591, 796, 513, 198, 312, 62, 9895, 796, 13108, 198, 2676, 341, 62, 42832, 796, 352, 198, 13083, 1096, 796, 36117, 198, 198, 7206, 38865, 62, 51, 14990, 796, 3126, 2780, 405, 220, 1303, 796, 767, 1528, 11, 287, 4201, 13, 198 ]
3.254386
114
""" Exercise 2 Using the same CelestialBody class, write a static method closer_to_sun that compares two CelectialBody objects and returns the name of the object that is closes to the sun. Expected Output If the objects mercury and venus are compared, then the method would return Mercury. """ class CelestialBody: """Represents a celestial body""" @staticmethod def closer_to_sun(body1, body2): """ Returns the name of the body that is closest to the sun """ if body1.distance < body2.distance: return body1.name else: return body2.name mercury = CelestialBody("Mercury", 4879.4, 57909000, 0) venus = CelestialBody("Venus", 12103.6, 108160000, 0)
[ 37811, 198, 3109, 23697, 362, 198, 12814, 262, 976, 37231, 25842, 1398, 11, 3551, 257, 9037, 2446, 5699, 62, 1462, 62, 19155, 326, 23008, 198, 11545, 327, 9509, 498, 25842, 5563, 290, 5860, 262, 1438, 286, 262, 2134, 326, 318, 20612, 284, 262, 4252, 13, 198, 3109, 7254, 25235, 198, 1532, 262, 5563, 27394, 290, 8710, 385, 389, 3688, 11, 788, 262, 2446, 561, 1441, 21673, 13, 198, 37811, 628, 198, 4871, 37231, 25842, 25, 198, 220, 220, 220, 37227, 6207, 6629, 257, 33258, 1767, 37811, 628, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 5699, 62, 1462, 62, 19155, 7, 2618, 16, 11, 1767, 17, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 16409, 262, 1438, 286, 262, 1767, 198, 220, 220, 220, 220, 220, 220, 220, 326, 318, 11706, 284, 262, 4252, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1767, 16, 13, 30246, 1279, 1767, 17, 13, 30246, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 1767, 16, 13, 3672, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 1767, 17, 13, 3672, 628, 198, 647, 66, 1601, 796, 37231, 25842, 7203, 42981, 1601, 1600, 4764, 3720, 13, 19, 11, 642, 3720, 2931, 830, 11, 657, 8, 198, 574, 385, 796, 37231, 25842, 7203, 37522, 385, 1600, 1105, 15197, 13, 21, 11, 15495, 1433, 2388, 11, 657, 8, 198 ]
2.781132
265
import numpy as np import os from azureml.core.run import Run from scipy.stats import entropy from ..utils.tfrecords import resize, parse_tfrecord from .kmeans import * from ..models import * run = Run.get_context() class ClusterFeatureMap(tf.keras.Model): """" This is a clustering class with methods to allow batch clustering of the latent representation generated by classifier """ class SaveCluster(tf.keras.callbacks.Callback): """ A callback class for saving clusters """ class UpdateCluster(tf.keras.callbacks.Callback): """ A callback class for updating centroid coordinates """ def get_data_from_tfrecords(args, num_replicas): """ Create a tf.data from tf records in args.train_dir/args.validation_dir :param args: :param num_replicas: :return: """ num_frames = args.num_frames num_mel = args.num_mel num_labels = args.num_labels batch_size = args.batch_size * num_replicas autotune = tf.data.AUTOTUNE train_filenames = tf.io.gfile.glob(f'{args.train_dir}/*.tfrec') train_dataset = tf.data.TFRecordDataset(train_filenames, num_parallel_reads=autotune) \ .map(lambda example: parse_tfrecord(example, num_mel=num_mel, num_frames=num_frames, snr=args.snr, labels=args.labels), num_parallel_calls=autotune) \ .map(lambda example: resize(example, num_frames=num_frames, num_mel=num_mel, num_labels=args.num_labels, labels=args.labels, snr=args.snr), num_parallel_calls=autotune) \ .shuffle(10 * batch_size) \ .batch(batch_size) \ .prefetch(autotune) \ .cache() return train_dataset def get_model(args, num_replicas): """ Construct tensorflow model from checkpoint in args.path_model_tf and data loader from args.data_dir """ model = globals()[args.model_name](nclass=args.num_labels) if args.path_model_tf is not None: model.load_weights(tf.train.latest_checkpoint(args.path_model_tf)).expect_partial() cluster_algorithm = globals()[args.clustering_name](args.num_clusters, args.embed_dim) clus = ClusterFeatureMap(cluster_algorithm, model, batch_size=args.batch_size * num_replicas) clus.compile() print('Compiling model done') return clus def train(args): """ Iterate over the batch in the dataset and learn the cluster centers using args.clustering_name and args.model_name feature map. :param args: :return: """ if run._run_id.startswith("OfflineRun"): run.number = 0 strategy = tf.distribute.MirroredStrategy() save_dir = args.save_dir save_dir = f'{save_dir}/{args.experiment_name}_{run.number}' os.makedirs(save_dir, exist_ok=True) with strategy.scope(): model = get_model(args, strategy.num_replicas_in_sync) train_loader = get_data_from_tfrecords(args, strategy.num_replicas_in_sync) model.fit(train_loader, epochs=args.num_epochs, callbacks=[SaveCluster(save_dir), UpdateCluster()])
[ 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 198, 6738, 35560, 495, 4029, 13, 7295, 13, 5143, 1330, 5660, 198, 6738, 629, 541, 88, 13, 34242, 1330, 40709, 198, 198, 6738, 11485, 26791, 13, 27110, 8344, 3669, 1330, 47558, 11, 21136, 62, 27110, 22105, 198, 6738, 764, 74, 1326, 504, 1330, 1635, 198, 6738, 11485, 27530, 1330, 1635, 198, 198, 5143, 796, 5660, 13, 1136, 62, 22866, 3419, 198, 198, 4871, 38279, 38816, 13912, 7, 27110, 13, 6122, 292, 13, 17633, 2599, 198, 220, 220, 220, 13538, 15931, 198, 220, 220, 220, 770, 318, 257, 32966, 1586, 1398, 351, 5050, 284, 1249, 15458, 32966, 1586, 198, 220, 220, 220, 286, 262, 41270, 10552, 7560, 416, 1398, 7483, 198, 220, 220, 220, 37227, 628, 198, 4871, 12793, 2601, 5819, 7, 27110, 13, 6122, 292, 13, 13345, 10146, 13, 47258, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 317, 23838, 1398, 329, 8914, 23163, 198, 220, 220, 220, 37227, 628, 198, 4871, 10133, 2601, 5819, 7, 27110, 13, 6122, 292, 13, 13345, 10146, 13, 47258, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 317, 23838, 1398, 329, 19698, 1247, 3882, 22715, 198, 220, 220, 220, 37227, 628, 198, 4299, 651, 62, 7890, 62, 6738, 62, 27110, 8344, 3669, 7, 22046, 11, 997, 62, 35666, 44645, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 13610, 257, 48700, 13, 7890, 422, 48700, 4406, 287, 26498, 13, 27432, 62, 15908, 14, 22046, 13, 12102, 341, 62, 15908, 198, 220, 220, 220, 1058, 17143, 26498, 25, 198, 220, 220, 220, 1058, 17143, 997, 62, 35666, 44645, 25, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 997, 62, 37805, 796, 26498, 13, 22510, 62, 37805, 198, 220, 220, 220, 997, 62, 17694, 796, 26498, 13, 22510, 62, 17694, 198, 220, 220, 220, 997, 62, 23912, 1424, 796, 26498, 13, 22510, 62, 23912, 1424, 628, 220, 220, 220, 15458, 62, 7857, 796, 26498, 13, 43501, 62, 7857, 1635, 997, 62, 35666, 44645, 628, 220, 220, 220, 1960, 313, 1726, 796, 48700, 13, 7890, 13, 39371, 2394, 41884, 628, 220, 220, 220, 4512, 62, 10379, 268, 1047, 796, 48700, 13, 952, 13, 70, 7753, 13, 4743, 672, 7, 69, 6, 90, 22046, 13, 27432, 62, 15908, 92, 15211, 13, 27110, 8344, 11537, 198, 220, 220, 220, 4512, 62, 19608, 292, 316, 796, 48700, 13, 7890, 13, 10234, 23739, 27354, 292, 316, 7, 27432, 62, 10379, 268, 1047, 11, 997, 62, 1845, 29363, 62, 40779, 28, 2306, 313, 1726, 8, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 764, 8899, 7, 50033, 1672, 25, 21136, 62, 27110, 22105, 7, 20688, 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, 997, 62, 17694, 28, 22510, 62, 17694, 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, 997, 62, 37805, 28, 22510, 62, 37805, 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, 3013, 81, 28, 22046, 13, 16184, 81, 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, 14722, 28, 22046, 13, 23912, 1424, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 997, 62, 1845, 29363, 62, 66, 5691, 28, 2306, 313, 1726, 8, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 764, 8899, 7, 50033, 1672, 25, 47558, 7, 20688, 11, 997, 62, 37805, 28, 22510, 62, 37805, 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, 997, 62, 17694, 28, 22510, 62, 17694, 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, 997, 62, 23912, 1424, 28, 22046, 13, 22510, 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, 14722, 28, 22046, 13, 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, 3013, 81, 28, 22046, 13, 16184, 81, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 997, 62, 1845, 29363, 62, 66, 5691, 28, 2306, 313, 1726, 8, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 764, 1477, 18137, 7, 940, 1635, 15458, 62, 7857, 8, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 764, 43501, 7, 43501, 62, 7857, 8, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 764, 3866, 69, 7569, 7, 2306, 313, 1726, 8, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 764, 23870, 3419, 628, 220, 220, 220, 1441, 4512, 62, 19608, 292, 316, 628, 198, 4299, 651, 62, 19849, 7, 22046, 11, 997, 62, 35666, 44645, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 11192, 273, 11125, 2746, 422, 26954, 287, 26498, 13, 6978, 62, 19849, 62, 27110, 198, 220, 220, 220, 290, 1366, 40213, 422, 26498, 13, 7890, 62, 15908, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2746, 796, 15095, 874, 3419, 58, 22046, 13, 19849, 62, 3672, 16151, 77, 4871, 28, 22046, 13, 22510, 62, 23912, 1424, 8, 628, 198, 220, 220, 220, 611, 26498, 13, 6978, 62, 19849, 62, 27110, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2746, 13, 2220, 62, 43775, 7, 27110, 13, 27432, 13, 42861, 62, 9122, 4122, 7, 22046, 13, 6978, 62, 19849, 62, 27110, 29720, 1069, 806, 62, 47172, 3419, 628, 220, 220, 220, 13946, 62, 282, 42289, 796, 15095, 874, 3419, 58, 22046, 13, 565, 436, 1586, 62, 3672, 16151, 22046, 13, 22510, 62, 565, 13654, 11, 26498, 13, 20521, 62, 27740, 8, 628, 220, 220, 220, 537, 385, 796, 38279, 38816, 13912, 7, 565, 5819, 62, 282, 42289, 11, 2746, 11, 15458, 62, 7857, 28, 22046, 13, 43501, 62, 7857, 1635, 997, 62, 35666, 44645, 8, 198, 220, 220, 220, 537, 385, 13, 5589, 576, 3419, 198, 220, 220, 220, 3601, 10786, 7293, 4386, 2746, 1760, 11537, 628, 220, 220, 220, 1441, 537, 385, 628, 198, 4299, 4512, 7, 22046, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 40806, 378, 625, 262, 15458, 287, 262, 27039, 290, 2193, 262, 13946, 10399, 198, 220, 220, 220, 1262, 26498, 13, 565, 436, 1586, 62, 3672, 290, 26498, 13, 19849, 62, 3672, 3895, 3975, 13, 198, 220, 220, 220, 1058, 17143, 26498, 25, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 1057, 13557, 5143, 62, 312, 13, 9688, 2032, 342, 7203, 28657, 10987, 1, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1057, 13, 17618, 796, 657, 628, 220, 220, 220, 4811, 796, 48700, 13, 17080, 4163, 13, 27453, 34640, 13290, 4338, 3419, 198, 220, 220, 220, 3613, 62, 15908, 796, 26498, 13, 21928, 62, 15908, 198, 220, 220, 220, 3613, 62, 15908, 796, 277, 6, 90, 21928, 62, 15908, 92, 14, 90, 22046, 13, 23100, 3681, 62, 3672, 92, 23330, 5143, 13, 17618, 92, 6, 628, 220, 220, 220, 28686, 13, 76, 4335, 17062, 7, 21928, 62, 15908, 11, 2152, 62, 482, 28, 17821, 8, 628, 220, 220, 220, 351, 4811, 13, 29982, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 2746, 796, 651, 62, 19849, 7, 22046, 11, 4811, 13, 22510, 62, 35666, 44645, 62, 259, 62, 27261, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 29356, 796, 651, 62, 7890, 62, 6738, 62, 27110, 8344, 3669, 7, 22046, 11, 4811, 13, 22510, 62, 35666, 44645, 62, 259, 62, 27261, 8, 628, 220, 220, 220, 2746, 13, 11147, 7, 27432, 62, 29356, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 36835, 82, 28, 22046, 13, 22510, 62, 538, 5374, 82, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 869, 10146, 41888, 16928, 2601, 5819, 7, 21928, 62, 15908, 828, 10133, 2601, 5819, 3419, 12962, 198 ]
2.195313
1,536
# pylint: disable=missing-docstring,invalid-name,line-too-long from django.test import TestCase import markdown class TestDetails(TestCase): """ Test details extension. """
[ 2, 279, 2645, 600, 25, 15560, 28, 45688, 12, 15390, 8841, 11, 259, 12102, 12, 3672, 11, 1370, 12, 18820, 12, 6511, 198, 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 198, 198, 11748, 1317, 2902, 198, 198, 4871, 6208, 24259, 7, 14402, 20448, 2599, 198, 220, 220, 220, 37227, 6208, 3307, 7552, 13, 37227, 198 ]
3.196429
56
"""Module containing the attributes for gtunrealdevice.""" import yaml from os import path from textwrap import dedent from gtunrealdevice.utils import File __version__ = '0.2.8' version = __version__ __edition__ = 'Community' edition = __edition__ __all__ = [ 'Data', 'version', 'edition' ]
[ 37811, 26796, 7268, 262, 12608, 329, 308, 28286, 260, 1940, 1990, 501, 526, 15931, 198, 198, 11748, 331, 43695, 198, 198, 6738, 28686, 1330, 3108, 198, 6738, 2420, 37150, 1330, 4648, 298, 198, 198, 6738, 308, 28286, 260, 1940, 1990, 501, 13, 26791, 1330, 9220, 198, 198, 834, 9641, 834, 796, 705, 15, 13, 17, 13, 23, 6, 198, 9641, 796, 11593, 9641, 834, 198, 834, 28736, 834, 796, 705, 20012, 6, 198, 28736, 796, 11593, 28736, 834, 198, 198, 834, 439, 834, 796, 685, 198, 220, 220, 220, 705, 6601, 3256, 198, 220, 220, 220, 705, 9641, 3256, 198, 220, 220, 220, 705, 28736, 6, 198, 60, 628 ]
2.844037
109
import numpy as np a = np.array([ (1, 3, 5, 7), (3, 5, 7, 1), (5, 7, 1, 3), (7, 1, 1, 5) ], dtype=np.float64) b = np.array([12, 0, 4, 16], dtype=np.float64) MAX_STEPS = 100 print("Gauss (with selection of main element):", solve_gauss_m(a, b)) print("numpy.linalg.solve:", np.linalg.solve(a, b)) a = np.array([ [3, -1, 1], [-1, 2, 0.5], [1, 0.5, 3] ], dtype=np.float64) b = np.array([1, 1.75, 2.5], dtype=np.float64) print("Seidel:", solve_seidel(a, b, epsilon=0.0001)) print("numpy.linalg.solve:", np.linalg.solve(a, b))
[ 11748, 299, 32152, 355, 45941, 628, 198, 64, 796, 45941, 13, 18747, 26933, 198, 220, 220, 220, 357, 16, 11, 513, 11, 642, 11, 767, 828, 198, 220, 220, 220, 357, 18, 11, 642, 11, 767, 11, 352, 828, 198, 220, 220, 220, 357, 20, 11, 767, 11, 352, 11, 513, 828, 198, 220, 220, 220, 357, 22, 11, 352, 11, 352, 11, 642, 8, 198, 4357, 288, 4906, 28, 37659, 13, 22468, 2414, 8, 198, 198, 65, 796, 45941, 13, 18747, 26933, 1065, 11, 657, 11, 604, 11, 1467, 4357, 288, 4906, 28, 37659, 13, 22468, 2414, 8, 628, 198, 198, 22921, 62, 30516, 3705, 796, 1802, 628, 198, 198, 4798, 7203, 35389, 1046, 357, 4480, 6356, 286, 1388, 5002, 2599, 1600, 8494, 62, 4908, 1046, 62, 76, 7, 64, 11, 275, 4008, 198, 4798, 7203, 77, 32152, 13, 75, 1292, 70, 13, 82, 6442, 25, 1600, 45941, 13, 75, 1292, 70, 13, 82, 6442, 7, 64, 11, 275, 4008, 198, 198, 64, 796, 45941, 13, 18747, 26933, 198, 220, 220, 220, 685, 18, 11, 532, 16, 11, 352, 4357, 198, 220, 220, 220, 25915, 16, 11, 362, 11, 657, 13, 20, 4357, 198, 220, 220, 220, 685, 16, 11, 657, 13, 20, 11, 513, 60, 198, 4357, 288, 4906, 28, 37659, 13, 22468, 2414, 8, 198, 65, 796, 45941, 13, 18747, 26933, 16, 11, 352, 13, 2425, 11, 362, 13, 20, 4357, 288, 4906, 28, 37659, 13, 22468, 2414, 8, 198, 198, 4798, 7203, 4653, 5943, 25, 1600, 8494, 62, 325, 5943, 7, 64, 11, 275, 11, 304, 862, 33576, 28, 15, 13, 18005, 4008, 198, 4798, 7203, 77, 32152, 13, 75, 1292, 70, 13, 82, 6442, 25, 1600, 45941, 13, 75, 1292, 70, 13, 82, 6442, 7, 64, 11, 275, 4008, 198 ]
1.898305
295
from haystack.modeling.training.base import Trainer
[ 6738, 27678, 25558, 13, 4666, 10809, 13, 34409, 13, 8692, 1330, 31924 ]
4.25
12
""" """ import os from sacred.observers import FileStorageObserver from sacred import Experiment from ctseg.ctutil.utils import read_json def initialize_experiment(): """Initialize the Sacred Experiment This method reads a JSON config from mcdn-3d-seg/sacred_config.json with the following entries: experiment_name: the name of the sacred experiment file_observer_base_dir: the directory where run logs are saved to. If relative, it is assumed relative to mcdn-3d-seg/ """ # parse the sacred config repo_dir = os.path.dirname(os.path.dirname(__file__)) sacred_config = read_json(os.path.join(repo_dir, "sacred_config.json")) # initialize the experiment ex = Experiment(sacred_config["experiment_name"]) # create a file-based observer to log runs file_observer_base_dir = os.path.expanduser(sacred_config["file_observer_base_dir"]) if not file_observer_base_dir.startswith("/"): file_observer_base_dir = os.path.join(repo_dir, file_observer_base_dir) ex.observers.append(FileStorageObserver.create(file_observer_base_dir)) return ex ex = initialize_experiment() DEFAULT_CONFIG = { "num_gpus": 1, # the number of output segmentation classes "num_classes": 4, # the method used to normalize the data # options include: ZeroMeanUnitVar, NormLog, MagicNormLog "normalization": "", # continuously checks for new inference files and deletes completed files "production_mode": False, "check_alignment": -1, # model architecture "model_config": { # specifies the architecture of a new model "architecture_config": { # the size of model's input window when sampling volumes (x, y, z) "input_shape": [240, 240, 240], "kernel_initializer": "lecun_normal", "activation": "relu", "dropout_rate": 0.1, }, # specifies loading a pre-trained model "load_config": { # whether or not to drop the last layer when loading a model "drop_last_layer": False, # "best", "latest" or "/PATH/TO/MODEL/CHECKPOINT" to resume training from. # Leave empty to not resume "resume_from": "", # path to a weights file to load the model from. takes precedent over # `resume_from` if set "load_weights_from": "", }, }, # data preprocessing "data_config": { # mirrors input chunks in the corresponding dimension "flip_x": False, "flip_y": False, "flip_z": False, # Flip Validation Axis: None or int or tuple of ints, optional # Axis or axes along which to flip over. The default, # axis=None, will flip over all of the axes of the input array. # If axis is negative it counts from the last to the first axis. # If axis is a tuple of ints, flipping is performed on all of the axes # specified in the tuple. "flip_validation_axis": None, "sampler_config": { # the chunk sampling class for during training. one of "OverlapSampler", # "RandomSampler", "BattleShipSampler" "sampler_class": "RandomSampler", # Number of random samples taken from the training data dir when performing # training. Not used in "overlap" mode. "n_samples_per_epoch": 3, # Number of chunks taken from each sample when performing training. Not # used in "overlap" mode. "n_chunks_per_sample": 100, # the amount the input window is translated in the x, y, and z dimensions. # Used during inference but also during training if sampler_class is # "OverlapSampler" "overlap_stride": 240, } }, # configuration specific to training "train_config": { "inputs": { # dir containing training the `.npy` data files "data_dir": "/PATH/TO/TRAIN/DATA", # dir containing the `.npy` training labels. files are matched by name to # data, so this dir can have targets for both training and testing "targets_dir": "/PATH/TO/TRAIN/TARGETS" }, "outputs": { # where cached normalized data is saved to "normalized_data_dir": "/PATH/TO/NORMALIZED/DATA", "csv_log_dir": "/PATH/TO/CSV/LOGS", "tensorboard_log_dir": "/PATH/TO/TENSORBOARD/LOGS", "models_dir": "/PATH/TO/SAVED/MODELS", # where normalizer metadata is saved to "preprocessor_dir": "/PATH/TO/SAVED/PREPROCESSORS", }, "compilation": { # name of the optimizer to use "optimizer": "Adadelta", # the name of the loss function. Valid names include all Keras defaults # as well as fully-qualified function names "loss": "ctseg.ctutil.losses.weighted_categorical_crossentropy", # kwargs passed to the loss function. replace this kwargs dict with `false` # to not use "loss_kwargs": { "beta": 0.9, }, # the names of the metrics to track. Valid names include all Keras defaults # as well as fully-qualified function names "metrics": [ "accuracy", "ctseg.ctutil.metrics.per_class_accuracy", "ctseg.ctutil.metrics.jaccard_index", ], # indicates whether or not to recompile with the above specified optimizer, # loss and metrics if a compiled model is loaded. # Warning: doing this may slow training as it will discard the current state # of the optimizer "recompile": False }, # the max number of epochs to train for "epochs": 1000, # Epoch at which to start training # (useful for resuming a previous training run). "initial_epoch": 0, # the training batch size "batch_size": 1, }, # configuration specific to testing "test_config": { "inputs": { # dir containing the `.npy` test data files "data_dir": "/PATH/TO/TEST/DATA", # dir containing the `.npy` test labels. files are matched by name to data, # so this dir can have targets for both training and testing "targets_dir": "/PATH/TO/TEST/TARGETS" }, "outputs": { # where cached normalized data is saved to "normalized_data_dir": "/PATH/TO/NORMALIZED/DATA" } }, # configuration specific to inference "inference_config": { "inputs": { # where the `.npy` files to be processed live "unprocessed_queue_dir": "/PATH/TO/UNPROCESSED/DATA", }, "outputs": { # where files from `unprocessed_queue_dir` are moved to once processed "processed_data_dir": "/PATH/TO/PROCESSED/DATA", # where cached normalized data is saved to "normalized_data_dir": "/PATH/TO/NORMALIZED/DATA", # where predictions are written to "predictions_dir": "/PATH/TO/INFERENCE/PREDICTIONS" }, # the number of iterations of inference performed per chunk, the results of which # are averaged and standard deviations are calculated "inference_iters": 5, }, # configuration specific to plotting "plot_config": { "inputs": { # dir containing the `.npy` data files "data_dir": "/PATH/TO/DATA", # dir containing the `.npy` labels, if available. Leave empty if not. Files # are matched by name to data "targets_dir": "/PATH/TO/TARGETS", # dir containing the `.npy` predictions "predictions_dir": "/PATH/TO/PREDICTIONS" }, "outputs": { "plots_dir": "/PATH/TO/OUTPUT/PLOTS" } }, } ex.add_config(DEFAULT_CONFIG) @ex.named_config @ex.named_config @ex.named_config @ex.named_config
[ 37811, 198, 198, 37811, 198, 11748, 28686, 198, 198, 6738, 13626, 13, 672, 2655, 690, 1330, 9220, 31425, 31310, 18497, 198, 6738, 13626, 1330, 29544, 198, 198, 6738, 269, 83, 325, 70, 13, 310, 22602, 13, 26791, 1330, 1100, 62, 17752, 628, 198, 4299, 41216, 62, 23100, 3681, 33529, 198, 220, 220, 220, 37227, 24243, 1096, 262, 17380, 29544, 628, 220, 220, 220, 770, 2446, 9743, 257, 19449, 4566, 422, 285, 32341, 12, 18, 67, 12, 325, 70, 14, 30584, 445, 62, 11250, 13, 17752, 351, 262, 198, 220, 220, 220, 1708, 12784, 25, 628, 220, 220, 220, 220, 220, 220, 220, 6306, 62, 3672, 25, 262, 1438, 286, 262, 13626, 6306, 198, 220, 220, 220, 220, 220, 220, 220, 2393, 62, 672, 15388, 62, 8692, 62, 15908, 25, 262, 8619, 810, 1057, 17259, 389, 7448, 284, 13, 1002, 3585, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 340, 318, 9672, 3585, 284, 285, 32341, 12, 18, 67, 12, 325, 70, 14, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 21136, 262, 13626, 4566, 198, 220, 220, 220, 29924, 62, 15908, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 4008, 198, 220, 220, 220, 13626, 62, 11250, 796, 1100, 62, 17752, 7, 418, 13, 6978, 13, 22179, 7, 260, 7501, 62, 15908, 11, 366, 30584, 445, 62, 11250, 13, 17752, 48774, 628, 220, 220, 220, 1303, 41216, 262, 6306, 198, 220, 220, 220, 409, 796, 29544, 7, 30584, 445, 62, 11250, 14692, 23100, 3681, 62, 3672, 8973, 8, 628, 220, 220, 220, 1303, 2251, 257, 2393, 12, 3106, 22890, 284, 2604, 4539, 198, 220, 220, 220, 2393, 62, 672, 15388, 62, 8692, 62, 15908, 796, 28686, 13, 6978, 13, 11201, 392, 7220, 7, 30584, 445, 62, 11250, 14692, 7753, 62, 672, 15388, 62, 8692, 62, 15908, 8973, 8, 198, 220, 220, 220, 611, 407, 2393, 62, 672, 15388, 62, 8692, 62, 15908, 13, 9688, 2032, 342, 7203, 30487, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2393, 62, 672, 15388, 62, 8692, 62, 15908, 796, 28686, 13, 6978, 13, 22179, 7, 260, 7501, 62, 15908, 11, 2393, 62, 672, 15388, 62, 8692, 62, 15908, 8, 198, 220, 220, 220, 409, 13, 672, 2655, 690, 13, 33295, 7, 8979, 31425, 31310, 18497, 13, 17953, 7, 7753, 62, 672, 15388, 62, 8692, 62, 15908, 4008, 628, 220, 220, 220, 1441, 409, 628, 198, 1069, 796, 41216, 62, 23100, 3681, 3419, 628, 198, 7206, 38865, 62, 10943, 16254, 796, 1391, 198, 220, 220, 220, 366, 22510, 62, 31197, 385, 1298, 352, 11, 198, 220, 220, 220, 1303, 262, 1271, 286, 5072, 10618, 341, 6097, 198, 220, 220, 220, 366, 22510, 62, 37724, 1298, 604, 11, 198, 220, 220, 220, 1303, 262, 2446, 973, 284, 3487, 1096, 262, 1366, 198, 220, 220, 220, 1303, 3689, 2291, 25, 12169, 5308, 272, 26453, 19852, 11, 11220, 11187, 11, 6139, 35393, 11187, 198, 220, 220, 220, 366, 11265, 1634, 1298, 366, 1600, 198, 220, 220, 220, 1303, 17282, 8794, 329, 649, 32278, 3696, 290, 28128, 274, 5668, 3696, 198, 220, 220, 220, 366, 25493, 62, 14171, 1298, 10352, 11, 198, 220, 220, 220, 366, 9122, 62, 282, 16747, 1298, 532, 16, 11, 198, 220, 220, 220, 1303, 2746, 10959, 198, 220, 220, 220, 366, 19849, 62, 11250, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 26052, 262, 10959, 286, 257, 649, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 366, 998, 5712, 495, 62, 11250, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 262, 2546, 286, 2746, 338, 5128, 4324, 618, 19232, 15343, 357, 87, 11, 331, 11, 1976, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 15414, 62, 43358, 1298, 685, 16102, 11, 14956, 11, 14956, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 33885, 62, 36733, 7509, 1298, 366, 293, 66, 403, 62, 11265, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 48545, 1298, 366, 260, 2290, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 14781, 448, 62, 4873, 1298, 657, 13, 16, 11, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 26052, 11046, 257, 662, 12, 35311, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 366, 2220, 62, 11250, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1771, 393, 407, 284, 4268, 262, 938, 7679, 618, 11046, 257, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 14781, 62, 12957, 62, 29289, 1298, 10352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 366, 13466, 1600, 366, 42861, 1, 393, 12813, 34219, 14, 10468, 14, 33365, 3698, 14, 50084, 16402, 12394, 1, 284, 15294, 3047, 422, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 17446, 6565, 284, 407, 15294, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 411, 2454, 62, 6738, 1298, 366, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 3108, 284, 257, 19590, 2393, 284, 3440, 262, 2746, 422, 13, 2753, 19719, 625, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4600, 411, 2454, 62, 6738, 63, 611, 900, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 2220, 62, 43775, 62, 6738, 1298, 366, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 1303, 1366, 662, 36948, 198, 220, 220, 220, 366, 7890, 62, 11250, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 22353, 5128, 22716, 287, 262, 11188, 15793, 198, 220, 220, 220, 220, 220, 220, 220, 366, 2704, 541, 62, 87, 1298, 10352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 366, 2704, 541, 62, 88, 1298, 10352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 366, 2704, 541, 62, 89, 1298, 10352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 29583, 3254, 24765, 38349, 25, 6045, 393, 493, 393, 46545, 286, 493, 82, 11, 11902, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 38349, 393, 34197, 1863, 543, 284, 14283, 625, 13, 383, 4277, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 16488, 28, 14202, 11, 481, 14283, 625, 477, 286, 262, 34197, 286, 262, 5128, 7177, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 1002, 16488, 318, 4633, 340, 9853, 422, 262, 938, 284, 262, 717, 16488, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 1002, 16488, 318, 257, 46545, 286, 493, 82, 11, 33097, 318, 6157, 319, 477, 286, 262, 34197, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 7368, 287, 262, 46545, 13, 198, 220, 220, 220, 220, 220, 220, 220, 366, 2704, 541, 62, 12102, 341, 62, 22704, 1298, 6045, 11, 198, 220, 220, 220, 220, 220, 220, 220, 366, 37687, 20053, 62, 11250, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 262, 16058, 19232, 1398, 329, 1141, 3047, 13, 530, 286, 366, 5886, 37796, 16305, 20053, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 366, 29531, 16305, 20053, 1600, 366, 24064, 25586, 16305, 20053, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 37687, 20053, 62, 4871, 1298, 366, 29531, 16305, 20053, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 7913, 286, 4738, 8405, 2077, 422, 262, 3047, 1366, 26672, 618, 9489, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 3047, 13, 1892, 973, 287, 366, 2502, 37796, 1, 4235, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 77, 62, 82, 12629, 62, 525, 62, 538, 5374, 1298, 513, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 7913, 286, 22716, 2077, 422, 1123, 6291, 618, 9489, 3047, 13, 1892, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 973, 287, 366, 2502, 37796, 1, 4235, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 77, 62, 354, 14125, 62, 525, 62, 39873, 1298, 1802, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 262, 2033, 262, 5128, 4324, 318, 14251, 287, 262, 2124, 11, 331, 11, 290, 1976, 15225, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 16718, 1141, 32278, 475, 635, 1141, 3047, 611, 6072, 20053, 62, 4871, 318, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 366, 5886, 37796, 16305, 20053, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 2502, 37796, 62, 2536, 485, 1298, 14956, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 1303, 8398, 2176, 284, 3047, 198, 220, 220, 220, 366, 27432, 62, 11250, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15414, 82, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 26672, 7268, 3047, 262, 4600, 13, 77, 9078, 63, 1366, 3696, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 7890, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 51, 3861, 1268, 14, 26947, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 26672, 7268, 262, 4600, 13, 77, 9078, 63, 3047, 14722, 13, 3696, 389, 14451, 416, 1438, 284, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1366, 11, 523, 428, 26672, 460, 423, 6670, 329, 1111, 3047, 290, 4856, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 83, 853, 1039, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 51, 3861, 1268, 14, 51, 46095, 50, 1, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 366, 22915, 82, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 810, 39986, 39279, 1366, 318, 7448, 284, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 11265, 1143, 62, 7890, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 35510, 42126, 14887, 1961, 14, 26947, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 40664, 62, 6404, 62, 15908, 1298, 220, 12813, 34219, 14, 10468, 14, 7902, 53, 14, 25294, 50, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 83, 22854, 3526, 62, 6404, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 51, 16938, 1581, 8202, 9795, 14, 25294, 50, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 27530, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 4090, 53, 1961, 14, 33365, 37142, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 810, 3487, 7509, 20150, 318, 7448, 284, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 3866, 41341, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 4090, 53, 1961, 14, 46437, 4805, 4503, 7597, 20673, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 366, 5589, 10520, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1438, 286, 262, 6436, 7509, 284, 779, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 40085, 7509, 1298, 366, 2782, 324, 12514, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 262, 1438, 286, 262, 2994, 2163, 13, 48951, 3891, 2291, 477, 17337, 292, 26235, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 355, 880, 355, 3938, 12, 22557, 2163, 3891, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 22462, 1298, 366, 310, 325, 70, 13, 310, 22602, 13, 22462, 274, 13, 6551, 276, 62, 66, 2397, 12409, 62, 19692, 298, 28338, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 479, 86, 22046, 3804, 284, 262, 2994, 2163, 13, 6330, 428, 479, 86, 22046, 8633, 351, 4600, 9562, 63, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 284, 407, 779, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 22462, 62, 46265, 22046, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 31361, 1298, 657, 13, 24, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 262, 3891, 286, 262, 20731, 284, 2610, 13, 48951, 3891, 2291, 477, 17337, 292, 26235, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 355, 880, 355, 3938, 12, 22557, 2163, 3891, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 4164, 10466, 1298, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 4134, 23843, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 310, 325, 70, 13, 310, 22602, 13, 4164, 10466, 13, 525, 62, 4871, 62, 4134, 23843, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 310, 325, 70, 13, 310, 22602, 13, 4164, 10466, 13, 73, 4134, 446, 62, 9630, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 9217, 1771, 393, 407, 284, 48765, 576, 351, 262, 2029, 7368, 6436, 7509, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2994, 290, 20731, 611, 257, 14102, 2746, 318, 9639, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 15932, 25, 1804, 428, 743, 3105, 3047, 355, 340, 481, 27537, 262, 1459, 1181, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 286, 262, 6436, 7509, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 260, 5589, 576, 1298, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 262, 3509, 1271, 286, 36835, 82, 284, 4512, 329, 198, 220, 220, 220, 220, 220, 220, 220, 366, 538, 5374, 82, 1298, 8576, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4551, 5374, 379, 543, 284, 923, 3047, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 357, 1904, 913, 329, 581, 12595, 257, 2180, 3047, 1057, 737, 198, 220, 220, 220, 220, 220, 220, 220, 366, 36733, 62, 538, 5374, 1298, 657, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 262, 3047, 15458, 2546, 198, 220, 220, 220, 220, 220, 220, 220, 366, 43501, 62, 7857, 1298, 352, 11, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 1303, 8398, 2176, 284, 4856, 198, 220, 220, 220, 366, 9288, 62, 11250, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15414, 82, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 26672, 7268, 262, 4600, 13, 77, 9078, 63, 1332, 1366, 3696, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 7890, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 51, 6465, 14, 26947, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 26672, 7268, 262, 4600, 13, 77, 9078, 63, 1332, 14722, 13, 3696, 389, 14451, 416, 1438, 284, 1366, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 523, 428, 26672, 460, 423, 6670, 329, 1111, 3047, 290, 4856, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 83, 853, 1039, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 51, 6465, 14, 51, 46095, 50, 1, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 366, 22915, 82, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 810, 39986, 39279, 1366, 318, 7448, 284, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 11265, 1143, 62, 7890, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 35510, 42126, 14887, 1961, 14, 26947, 1, 198, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 1303, 8398, 2176, 284, 32278, 198, 220, 220, 220, 366, 259, 4288, 62, 11250, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15414, 82, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 810, 262, 4600, 13, 77, 9078, 63, 3696, 284, 307, 13686, 2107, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 403, 14681, 276, 62, 36560, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 4944, 4805, 4503, 7597, 1961, 14, 26947, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 366, 22915, 82, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 810, 3696, 422, 4600, 403, 14681, 276, 62, 36560, 62, 15908, 63, 389, 3888, 284, 1752, 13686, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 14681, 276, 62, 7890, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 4805, 4503, 7597, 1961, 14, 26947, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 810, 39986, 39279, 1366, 318, 7448, 284, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 11265, 1143, 62, 7890, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 35510, 42126, 14887, 1961, 14, 26947, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 810, 16277, 389, 3194, 284, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 28764, 9278, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 1268, 24302, 18310, 14, 4805, 1961, 18379, 11053, 1, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 262, 1271, 286, 34820, 286, 32278, 6157, 583, 16058, 11, 262, 2482, 286, 543, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 389, 16449, 290, 3210, 47060, 389, 10488, 198, 220, 220, 220, 220, 220, 220, 220, 366, 259, 4288, 62, 270, 364, 1298, 642, 11, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 1303, 8398, 2176, 284, 29353, 198, 220, 220, 220, 366, 29487, 62, 11250, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15414, 82, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 26672, 7268, 262, 4600, 13, 77, 9078, 63, 1366, 3696, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 7890, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 26947, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 26672, 7268, 262, 4600, 13, 77, 9078, 63, 14722, 11, 611, 1695, 13, 17446, 6565, 611, 407, 13, 13283, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 389, 14451, 416, 1438, 284, 1366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 83, 853, 1039, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 51, 46095, 50, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 26672, 7268, 262, 4600, 13, 77, 9078, 63, 16277, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 28764, 9278, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 4805, 1961, 18379, 11053, 1, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 366, 22915, 82, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 489, 1747, 62, 15908, 1298, 12813, 34219, 14, 10468, 14, 2606, 7250, 3843, 14, 6489, 33472, 1, 198, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 8964, 198, 92, 198, 198, 1069, 13, 2860, 62, 11250, 7, 7206, 38865, 62, 10943, 16254, 8, 628, 198, 31, 1069, 13, 13190, 62, 11250, 628, 198, 31, 1069, 13, 13190, 62, 11250, 628, 198, 31, 1069, 13, 13190, 62, 11250, 628, 198, 31, 1069, 13, 13190, 62, 11250, 198 ]
2.318647
3,518
# -*- coding: utf-8 -*- r""" Check for pdf2svg """ # **************************************************************************** # Copyright (C) 2021 Sebastien Labbe <slabqc@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # https://www.gnu.org/licenses/ # **************************************************************************** from . import Executable class pdf2svg(Executable): r""" A :class:`sage.features.Feature` describing the presence of ``pdf2svg`` EXAMPLES:: sage: from sage.features.pdf2svg import pdf2svg sage: pdf2svg().is_present() # optional: pdf2svg FeatureTestResult('pdf2svg', True) """ def __init__(self): r""" TESTS:: sage: from sage.features.pdf2svg import pdf2svg sage: isinstance(pdf2svg(), pdf2svg) True """ Executable.__init__(self, "pdf2svg", executable="pdf2svg", spkg='pdf2svg', url="http://www.cityinthesky.co.uk/opensource/pdf2svg/")
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 81, 37811, 198, 9787, 329, 37124, 17, 21370, 70, 198, 37811, 198, 2, 41906, 17174, 46068, 198, 2, 220, 220, 220, 220, 220, 220, 15069, 357, 34, 8, 33448, 22787, 2013, 3498, 1350, 1279, 6649, 397, 80, 66, 31, 14816, 13, 785, 29, 198, 2, 198, 2, 770, 1430, 318, 1479, 3788, 25, 345, 460, 17678, 4163, 340, 290, 14, 273, 13096, 198, 2, 340, 739, 262, 2846, 286, 262, 22961, 3611, 5094, 13789, 355, 3199, 416, 198, 2, 262, 3232, 10442, 5693, 11, 2035, 2196, 362, 286, 262, 13789, 11, 393, 198, 2, 357, 265, 534, 3038, 8, 597, 1568, 2196, 13, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3740, 1378, 2503, 13, 41791, 13, 2398, 14, 677, 4541, 14, 198, 2, 41906, 17174, 46068, 198, 198, 6738, 764, 1330, 8393, 18187, 198, 198, 4871, 37124, 17, 21370, 70, 7, 23002, 18187, 2599, 198, 220, 220, 220, 374, 37811, 198, 220, 220, 220, 317, 1058, 4871, 25, 63, 82, 496, 13, 40890, 13, 38816, 63, 12059, 262, 4931, 286, 7559, 12315, 17, 21370, 70, 15506, 628, 220, 220, 220, 7788, 2390, 6489, 1546, 3712, 628, 220, 220, 220, 220, 220, 220, 220, 35021, 25, 422, 35021, 13, 40890, 13, 12315, 17, 21370, 70, 1330, 37124, 17, 21370, 70, 198, 220, 220, 220, 220, 220, 220, 220, 35021, 25, 37124, 17, 21370, 70, 22446, 271, 62, 25579, 3419, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 11902, 25, 37124, 17, 21370, 70, 198, 220, 220, 220, 220, 220, 220, 220, 27018, 14402, 23004, 10786, 12315, 17, 21370, 70, 3256, 6407, 8, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 374, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 309, 1546, 4694, 3712, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35021, 25, 422, 35021, 13, 40890, 13, 12315, 17, 21370, 70, 1330, 37124, 17, 21370, 70, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35021, 25, 318, 39098, 7, 12315, 17, 21370, 70, 22784, 37124, 17, 21370, 70, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8393, 18187, 13, 834, 15003, 834, 7, 944, 11, 366, 12315, 17, 21370, 70, 1600, 28883, 2625, 12315, 17, 21370, 70, 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, 220, 220, 220, 220, 599, 10025, 11639, 12315, 17, 21370, 70, 3256, 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, 19016, 2625, 4023, 1378, 2503, 13, 19205, 600, 956, 2584, 13, 1073, 13, 2724, 14, 44813, 1668, 14, 12315, 17, 21370, 70, 14, 4943, 198 ]
2.452471
526
import os import cv2 import numpy as np import pandas as pd import tensorflow as tf def read_image(path, size): """ Load image from local storage :param path: image path :param size: image size :return: loaded image """ image = cv2.imread(path, cv2.IMREAD_COLOR) image = cv2.resize(image, (size, size)) image = image / 255.0 image = image.astype(np.float32) return image def recognize_image(img_path): """ Recognize image Taking image and predicting breed basing on trained model :param img_path: Image Path :return: top 4 matching breeds, most similar breed """ path = "input/" train_path = os.path.join(path, "train/*") test_path = os.path.join(path, "test/*") labels_path = os.path.join(path, "labels.csv") labels_df = pd.read_csv(labels_path) breed = labels_df["breed"].unique() id2breed = {i: name for i, name in enumerate(breed)} ## Model model = tf.keras.models.load_model("model.h5") image = read_image(img_path, 224) image = np.expand_dims(image, axis=0) pred = model.predict(image)[0] label_idx = np.argmax(pred) top3 = np.argsort(pred)[-4:][::-1] possible_breed = list() print(str(id2breed[top3[0]]).replace("_", " ")) possible_breed.append(str(id2breed[top3[0]]).replace("_", " ")) possible_breed.append(str(id2breed[top3[1]]).replace("_", " ")) possible_breed.append(str(id2breed[top3[2]]).replace("_", " ")) possible_breed.append(str(id2breed[top3[3]]).replace("_", " ")) return str(id2breed[label_idx]).replace("_", " "), possible_breed if __name__ == "__main__": print(recognize_image())
[ 11748, 28686, 198, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 11192, 273, 11125, 355, 48700, 628, 198, 4299, 1100, 62, 9060, 7, 6978, 11, 2546, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 8778, 2939, 422, 1957, 6143, 198, 220, 220, 220, 1058, 17143, 3108, 25, 2939, 3108, 198, 220, 220, 220, 1058, 17143, 2546, 25, 2939, 2546, 198, 220, 220, 220, 1058, 7783, 25, 9639, 2939, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2939, 796, 269, 85, 17, 13, 320, 961, 7, 6978, 11, 269, 85, 17, 13, 3955, 15675, 62, 46786, 8, 198, 220, 220, 220, 2939, 796, 269, 85, 17, 13, 411, 1096, 7, 9060, 11, 357, 7857, 11, 2546, 4008, 198, 220, 220, 220, 2939, 796, 2939, 1220, 14280, 13, 15, 198, 220, 220, 220, 2939, 796, 2939, 13, 459, 2981, 7, 37659, 13, 22468, 2624, 8, 198, 220, 220, 220, 1441, 2939, 628, 198, 4299, 7564, 62, 9060, 7, 9600, 62, 6978, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 31517, 1096, 2939, 198, 220, 220, 220, 20879, 2939, 290, 25539, 15939, 1615, 278, 319, 8776, 2746, 198, 220, 220, 220, 1058, 17143, 33705, 62, 6978, 25, 7412, 10644, 198, 220, 220, 220, 1058, 7783, 25, 1353, 604, 12336, 29580, 11, 749, 2092, 15939, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3108, 796, 366, 15414, 30487, 198, 220, 220, 220, 4512, 62, 6978, 796, 28686, 13, 6978, 13, 22179, 7, 6978, 11, 366, 27432, 15211, 4943, 198, 220, 220, 220, 1332, 62, 6978, 796, 28686, 13, 6978, 13, 22179, 7, 6978, 11, 366, 9288, 15211, 4943, 198, 220, 220, 220, 14722, 62, 6978, 796, 28686, 13, 6978, 13, 22179, 7, 6978, 11, 366, 23912, 1424, 13, 40664, 4943, 628, 220, 220, 220, 14722, 62, 7568, 796, 279, 67, 13, 961, 62, 40664, 7, 23912, 1424, 62, 6978, 8, 198, 220, 220, 220, 15939, 796, 14722, 62, 7568, 14692, 4679, 276, 1, 4083, 34642, 3419, 198, 220, 220, 220, 4686, 17, 4679, 276, 796, 1391, 72, 25, 1438, 329, 1312, 11, 1438, 287, 27056, 378, 7, 4679, 276, 38165, 628, 220, 220, 220, 22492, 9104, 198, 220, 220, 220, 2746, 796, 48700, 13, 6122, 292, 13, 27530, 13, 2220, 62, 19849, 7203, 19849, 13, 71, 20, 4943, 628, 220, 220, 220, 2939, 796, 1100, 62, 9060, 7, 9600, 62, 6978, 11, 26063, 8, 198, 220, 220, 220, 2939, 796, 45941, 13, 11201, 392, 62, 67, 12078, 7, 9060, 11, 16488, 28, 15, 8, 198, 220, 220, 220, 2747, 796, 2746, 13, 79, 17407, 7, 9060, 38381, 15, 60, 198, 220, 220, 220, 6167, 62, 312, 87, 796, 45941, 13, 853, 9806, 7, 28764, 8, 198, 220, 220, 220, 1353, 18, 796, 45941, 13, 22046, 419, 7, 28764, 38381, 12, 19, 25, 7131, 3712, 12, 16, 60, 198, 220, 220, 220, 1744, 62, 4679, 276, 796, 1351, 3419, 198, 220, 220, 220, 3601, 7, 2536, 7, 312, 17, 4679, 276, 58, 4852, 18, 58, 15, 11907, 737, 33491, 7203, 62, 1600, 366, 366, 4008, 198, 220, 220, 220, 1744, 62, 4679, 276, 13, 33295, 7, 2536, 7, 312, 17, 4679, 276, 58, 4852, 18, 58, 15, 11907, 737, 33491, 7203, 62, 1600, 366, 366, 4008, 198, 220, 220, 220, 1744, 62, 4679, 276, 13, 33295, 7, 2536, 7, 312, 17, 4679, 276, 58, 4852, 18, 58, 16, 11907, 737, 33491, 7203, 62, 1600, 366, 366, 4008, 198, 220, 220, 220, 1744, 62, 4679, 276, 13, 33295, 7, 2536, 7, 312, 17, 4679, 276, 58, 4852, 18, 58, 17, 11907, 737, 33491, 7203, 62, 1600, 366, 366, 4008, 198, 220, 220, 220, 1744, 62, 4679, 276, 13, 33295, 7, 2536, 7, 312, 17, 4679, 276, 58, 4852, 18, 58, 18, 11907, 737, 33491, 7203, 62, 1600, 366, 366, 4008, 198, 220, 220, 220, 1441, 965, 7, 312, 17, 4679, 276, 58, 18242, 62, 312, 87, 35944, 33491, 7203, 62, 1600, 366, 366, 828, 1744, 62, 4679, 276, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 3601, 7, 26243, 1096, 62, 9060, 28955, 198 ]
2.40634
694
from coldtype import * @animation((1080, 1080), timeline=Timeline(3500, 24))
[ 6738, 4692, 4906, 1330, 1635, 198, 198, 31, 11227, 341, 19510, 24045, 11, 17729, 828, 15264, 28, 14967, 4470, 7, 2327, 405, 11, 1987, 4008, 198 ]
3
26
#!/usr/bin/env python3 import rospy rospy.logerr("###\n###\n###\n###\n###\nYou didn't specifiy which robot you want to start!\nPlease add minibot:=true or wolfgang:=true or davros:=true behind you roslaunch.\n###\n###\n###\n###\n###")
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 686, 2777, 88, 198, 198, 305, 2777, 88, 13, 6404, 8056, 7203, 21017, 59, 77, 21017, 59, 77, 21017, 59, 77, 21017, 59, 77, 21017, 59, 77, 1639, 1422, 470, 1020, 361, 7745, 543, 9379, 345, 765, 284, 923, 0, 59, 77, 5492, 751, 949, 571, 313, 25, 28, 7942, 393, 17481, 28284, 25, 28, 7942, 393, 288, 615, 4951, 25, 28, 7942, 2157, 345, 686, 6649, 11429, 13, 59, 77, 21017, 59, 77, 21017, 59, 77, 21017, 59, 77, 21017, 59, 77, 21017, 4943, 198 ]
2.43299
97
from django.contrib import admin from cms_redirects.models import CMSRedirect admin.site.register(CMSRedirect, CMSRedirectAdmin)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 269, 907, 62, 445, 1060, 82, 13, 27530, 1330, 40773, 7738, 1060, 198, 198, 28482, 13, 15654, 13, 30238, 7, 34, 5653, 7738, 1060, 11, 40773, 7738, 1060, 46787, 8, 198 ]
3.170732
41
import plotly.graph_objects as go @register
[ 11748, 7110, 306, 13, 34960, 62, 48205, 355, 467, 628, 198, 31, 30238, 628 ]
3.357143
14
# Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import unittest from cybox.objects.win_network_route_entry_object import WinNetworkRouteEntry from cybox.test import EntityTestCase, round_trip from cybox.test.objects import ObjectTestCase if __name__ == "__main__": unittest.main()
[ 2, 15069, 357, 66, 8, 1946, 11, 383, 17168, 2200, 10501, 13, 1439, 2489, 10395, 13, 198, 2, 4091, 38559, 24290, 13, 14116, 329, 1844, 2846, 13, 198, 198, 11748, 555, 715, 395, 198, 198, 6738, 3075, 3524, 13, 48205, 13, 5404, 62, 27349, 62, 38629, 62, 13000, 62, 15252, 1330, 7178, 26245, 43401, 30150, 198, 198, 6738, 3075, 3524, 13, 9288, 1330, 20885, 14402, 20448, 11, 2835, 62, 39813, 198, 6738, 3075, 3524, 13, 9288, 13, 48205, 1330, 9515, 14402, 20448, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
3.295238
105
#!/usr/bin/env python # Copyright (C) 2008-2011 by # George Asimenos, Robert C. Edgar, Serafim Batzoglou and Arend Sidow. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # ############################## import sys import evolverSimControl.lib.evolver_gff as gff FileName1 = sys.argv[1] FileName2 = sys.argv[2] Name1 = FileName1 Name2 = FileName2 GenomeLength1 = -1 GenomeLength2 = -1 if len(sys.argv) > 3: Name1 = sys.argv[3] if len(sys.argv) > 4: Name2 = sys.argv[4] if len(sys.argv) > 6: GenomeLength1 = int(sys.argv[5]) GenomeLength2 = int(sys.argv[6]) ConstrainedFeatures = [ "CDS", "UTR", "NXE", "NGE" ] Counts1, Bases1 = GetCounts(FileName1) Counts2, Bases2 = GetCounts(FileName2) Features = [ "CDS", "UTR", "NXE", "NGE", "island", "tandem", "Constrained" ] Keys = Counts1.keys() Keys.extend(Counts2.keys()) for Feature in Keys: if Feature not in Features: Features.append(Feature) if GenomeLength1 != -1: Features.append("Neutral") Features.append("Total") Counts1["Neutral"] = 0 Counts2["Neutral"] = 0 Counts1["Total"] = 0 Counts2["Total"] = 0 Bases1["Neutral"] = GenomeLength1 - Bases1["Constrained"] Bases2["Neutral"] = GenomeLength2 - Bases2["Constrained"] Bases1["Total"] = GenomeLength1 Bases2["Total"] = GenomeLength2 print " Feature 1=%8.8s 2=%8.8s Nr2-1 2-1 Pct Bases1 Bases2 Bases2-1 2-1 Pct" % (Name1, Name2) print "================ ========== ========== ========== ======== ========== ========== ========== ========" for Feature in Features: n1 = Get(Counts1, Feature) n2 = Get(Counts2, Feature) dn = n2 - n1 b1 = Get(Bases1, Feature) b2 = Get(Bases2, Feature) db = b2 - b1 pn = PctChg(n1, n2) pb = PctChg(b1, b2) s = "" s += "%16.16s" % Feature s += " %10u" % n1 s += " %10u" % n2 s += " %+10d" % (n2 - n1) s += " %7.7s%%" % pn s += " %10u" % b1 s += " %10u" % b2 s += " %+10d" % (b2-b1) s += " %7.7s%%" % pb print s
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 15069, 357, 34, 8, 3648, 12, 9804, 416, 198, 2, 4502, 1081, 19027, 418, 11, 5199, 327, 13, 29166, 11, 2930, 1878, 320, 6577, 89, 28678, 280, 290, 4231, 358, 15686, 322, 13, 198, 2, 220, 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, 220, 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, 220, 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, 198, 2, 3336, 47466, 13, 198, 2, 220, 198, 14468, 7804, 4242, 2235, 198, 11748, 25064, 198, 11748, 819, 14375, 8890, 15988, 13, 8019, 13, 1990, 14375, 62, 70, 487, 355, 308, 487, 198, 197, 198, 8979, 5376, 16, 796, 25064, 13, 853, 85, 58, 16, 60, 198, 8979, 5376, 17, 796, 25064, 13, 853, 85, 58, 17, 60, 198, 5376, 16, 796, 9220, 5376, 16, 198, 5376, 17, 796, 9220, 5376, 17, 198, 13746, 462, 24539, 16, 796, 532, 16, 198, 13746, 462, 24539, 17, 796, 532, 16, 198, 361, 18896, 7, 17597, 13, 853, 85, 8, 1875, 513, 25, 198, 197, 5376, 16, 796, 25064, 13, 853, 85, 58, 18, 60, 198, 361, 18896, 7, 17597, 13, 853, 85, 8, 1875, 604, 25, 198, 197, 5376, 17, 796, 25064, 13, 853, 85, 58, 19, 60, 198, 361, 18896, 7, 17597, 13, 853, 85, 8, 1875, 718, 25, 198, 197, 13746, 462, 24539, 16, 796, 493, 7, 17597, 13, 853, 85, 58, 20, 12962, 198, 197, 13746, 462, 24539, 17, 796, 493, 7, 17597, 13, 853, 85, 58, 21, 12962, 198, 197, 198, 198, 3103, 2536, 1328, 23595, 796, 685, 366, 34, 5258, 1600, 366, 3843, 49, 1600, 366, 45, 55, 36, 1600, 366, 45, 8264, 1, 2361, 198, 198, 12332, 82, 16, 11, 347, 1386, 16, 796, 3497, 12332, 82, 7, 8979, 5376, 16, 8, 198, 12332, 82, 17, 11, 347, 1386, 17, 796, 3497, 12332, 82, 7, 8979, 5376, 17, 8, 198, 198, 23595, 796, 685, 366, 34, 5258, 1600, 366, 3843, 49, 1600, 366, 45, 55, 36, 1600, 366, 45, 8264, 1600, 366, 271, 1044, 1600, 366, 83, 30025, 1600, 366, 3103, 2536, 1328, 1, 2361, 198, 40729, 796, 2764, 82, 16, 13, 13083, 3419, 198, 40729, 13, 2302, 437, 7, 12332, 82, 17, 13, 13083, 28955, 198, 1640, 27018, 287, 26363, 25, 198, 197, 361, 27018, 407, 287, 17571, 25, 198, 197, 197, 23595, 13, 33295, 7, 38816, 8, 198, 198, 361, 5215, 462, 24539, 16, 14512, 532, 16, 25, 198, 197, 23595, 13, 33295, 7203, 8199, 6815, 4943, 198, 197, 23595, 13, 33295, 7203, 14957, 4943, 198, 197, 12332, 82, 16, 14692, 8199, 6815, 8973, 796, 657, 198, 197, 12332, 82, 17, 14692, 8199, 6815, 8973, 796, 657, 198, 197, 12332, 82, 16, 14692, 14957, 8973, 796, 657, 198, 197, 12332, 82, 17, 14692, 14957, 8973, 796, 657, 198, 197, 33, 1386, 16, 14692, 8199, 6815, 8973, 796, 5215, 462, 24539, 16, 532, 220, 347, 1386, 16, 14692, 3103, 2536, 1328, 8973, 198, 197, 33, 1386, 17, 14692, 8199, 6815, 8973, 796, 5215, 462, 24539, 17, 532, 220, 347, 1386, 17, 14692, 3103, 2536, 1328, 8973, 198, 197, 33, 1386, 16, 14692, 14957, 8973, 796, 5215, 462, 24539, 16, 198, 197, 33, 1386, 17, 14692, 14957, 8973, 796, 5215, 462, 24539, 17, 198, 198, 4798, 366, 220, 220, 220, 220, 220, 220, 220, 220, 27018, 220, 352, 28, 4, 23, 13, 23, 82, 220, 362, 28, 4, 23, 13, 23, 82, 220, 220, 220, 220, 220, 220, 399, 81, 17, 12, 16, 220, 220, 362, 12, 16, 350, 310, 220, 220, 220, 220, 220, 347, 1386, 16, 220, 220, 220, 220, 220, 347, 1386, 17, 220, 220, 220, 347, 1386, 17, 12, 16, 220, 220, 362, 12, 16, 350, 310, 1, 4064, 357, 5376, 16, 11, 6530, 17, 8, 198, 4798, 366, 4770, 220, 796, 2559, 28, 220, 796, 2559, 28, 220, 796, 2559, 28, 220, 29335, 18604, 220, 796, 2559, 28, 220, 796, 2559, 28, 220, 796, 2559, 28, 220, 29335, 855, 2625, 198, 1640, 27018, 287, 17571, 25, 198, 197, 77, 16, 796, 3497, 7, 12332, 82, 16, 11, 27018, 8, 198, 197, 77, 17, 796, 3497, 7, 12332, 82, 17, 11, 27018, 8, 198, 197, 32656, 796, 299, 17, 532, 299, 16, 198, 197, 65, 16, 796, 3497, 7, 33, 1386, 16, 11, 27018, 8, 198, 197, 65, 17, 796, 3497, 7, 33, 1386, 17, 11, 27018, 8, 198, 197, 9945, 796, 275, 17, 532, 275, 16, 198, 197, 21999, 796, 350, 310, 1925, 70, 7, 77, 16, 11, 299, 17, 8, 198, 197, 40842, 796, 350, 310, 1925, 70, 7, 65, 16, 11, 275, 17, 8, 198, 197, 82, 796, 13538, 198, 197, 82, 15853, 36521, 1433, 13, 1433, 82, 1, 4064, 27018, 198, 197, 82, 15853, 366, 220, 4064, 940, 84, 1, 4064, 299, 16, 198, 197, 82, 15853, 366, 220, 4064, 940, 84, 1, 4064, 299, 17, 198, 197, 82, 15853, 366, 220, 4064, 10, 940, 67, 1, 4064, 357, 77, 17, 532, 299, 16, 8, 198, 197, 82, 15853, 366, 220, 4064, 22, 13, 22, 82, 16626, 1, 4064, 279, 77, 198, 197, 82, 15853, 366, 220, 4064, 940, 84, 1, 4064, 275, 16, 198, 197, 82, 15853, 366, 220, 4064, 940, 84, 1, 4064, 275, 17, 198, 197, 82, 15853, 366, 220, 4064, 10, 940, 67, 1, 4064, 357, 65, 17, 12, 65, 16, 8, 198, 197, 82, 15853, 366, 220, 4064, 22, 13, 22, 82, 16626, 1, 4064, 279, 65, 198, 197, 4798, 264, 198 ]
2.555074
1,153
## Copyright 2020 Alexander Liniger ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## http://www.apache.org/licenses/LICENSE-2.0 ## Unless required by applicable law or agreed to in writing, software ## distributed under the License is distributed on an "AS IS" BASIS, ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## See the License for the specific language governing permissions and ## limitations under the License. ########################################################################### ########################################################################### import torch import torch.nn as nn import torch.nn.functional as F
[ 2235, 15069, 12131, 10009, 5164, 8254, 198, 198, 2235, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2235, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2235, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 198, 2235, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 198, 2235, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2235, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 2235, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 2235, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2235, 11247, 739, 262, 13789, 13, 198, 29113, 29113, 7804, 21017, 198, 29113, 29113, 7804, 21017, 198, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 198 ]
4.564972
177
from os import link from googleapiclient.discovery import build import json from csv import reader from google.oauth2 import service_account import pandas as pd from os.path import exists import numpy as np from functools import reduce import time SERVICE_ACCOUNT_FILE = None SCOPES = ['https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive'] INPUTS_EVAL_MAPPING_ID =None OUTPUTS_MASTER_ID = None INPUTS_SPREADSHEET_ID = None sheetService = None ######################################################### ########################################################################### inputs = None if exists('./inputs.json'): with open('inputs.json', 'r') as file: inputs = json.load(file) else: print('You must create an inputs.json file') sys.exit() INPUTS_EVAL_MAPPING_ID = inputs["INPUTS_EVAL_MAPPING_ID"] OUTPUTS_MASTER_ID = inputs["OUTPUTS_MASTER_ID"] INPUTS_SPREADSHEET_ID = inputs['INPUTS_SPREADSHEET_ID'] SERVICE_ACCOUNT_FILE = inputs['SERVICE_ACCOUNT_FILE'] print('Set up services') setUpServices() sheet = sheetService.spreadsheets() print('Load weights') links_df, weight_df = grab_weights_and_links(INPUTS_SPREADSHEET_ID) # Calls list building function print('Build project summary list') all_project_scores = build_project_summary_list(links_df, weight_df, INPUTS_EVAL_MAPPING_ID) print('Summarize all the projects') list_to_append, maxMinList = summarize_all_project(all_project_scores, links_df) updateSheet(list_to_append, OUTPUTS_MASTER_ID, "Summary!A2:AA1000") updateSheet(maxMinList, OUTPUTS_MASTER_ID, "Potential Issues!A3:AA1000") print('Finished, Party time')
[ 6738, 28686, 1330, 2792, 198, 6738, 23645, 499, 291, 75, 1153, 13, 67, 40821, 1330, 1382, 198, 11748, 33918, 198, 6738, 269, 21370, 1330, 9173, 198, 6738, 23645, 13, 12162, 1071, 17, 1330, 2139, 62, 23317, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 28686, 13, 6978, 1330, 7160, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 1257, 310, 10141, 1330, 4646, 198, 11748, 640, 198, 198, 35009, 27389, 62, 26861, 28270, 62, 25664, 796, 6045, 198, 6173, 3185, 1546, 796, 37250, 5450, 1378, 2503, 13, 13297, 499, 271, 13, 785, 14, 18439, 14, 43639, 42011, 3256, 705, 5450, 1378, 2503, 13, 13297, 499, 271, 13, 785, 14, 18439, 14, 19472, 20520, 628, 198, 1268, 30076, 50, 62, 20114, 1847, 62, 44, 24805, 2751, 62, 2389, 796, 14202, 198, 2606, 7250, 3843, 50, 62, 31180, 5781, 62, 2389, 796, 6045, 198, 1268, 30076, 50, 62, 4303, 15675, 9693, 36, 2767, 62, 2389, 796, 6045, 198, 198, 21760, 16177, 796, 6045, 198, 198, 29113, 14468, 7804, 2, 628, 628, 628, 628, 198, 29113, 29113, 7804, 21017, 628, 198, 15414, 82, 796, 6045, 198, 361, 7160, 7, 4458, 14, 15414, 82, 13, 17752, 6, 2599, 198, 220, 220, 220, 351, 1280, 10786, 15414, 82, 13, 17752, 3256, 705, 81, 11537, 355, 2393, 25, 198, 220, 220, 220, 220, 220, 220, 220, 17311, 796, 33918, 13, 2220, 7, 7753, 8, 198, 17772, 25, 198, 220, 220, 220, 3601, 10786, 1639, 1276, 2251, 281, 17311, 13, 17752, 2393, 11537, 198, 220, 220, 220, 25064, 13, 37023, 3419, 628, 198, 1268, 30076, 50, 62, 20114, 1847, 62, 44, 24805, 2751, 62, 2389, 796, 17311, 14692, 1268, 30076, 50, 62, 20114, 1847, 62, 44, 24805, 2751, 62, 2389, 8973, 198, 2606, 7250, 3843, 50, 62, 31180, 5781, 62, 2389, 796, 17311, 14692, 2606, 7250, 3843, 50, 62, 31180, 5781, 62, 2389, 8973, 198, 1268, 30076, 50, 62, 4303, 15675, 9693, 36, 2767, 62, 2389, 796, 17311, 17816, 1268, 30076, 50, 62, 4303, 15675, 9693, 36, 2767, 62, 2389, 20520, 198, 35009, 27389, 62, 26861, 28270, 62, 25664, 796, 17311, 17816, 35009, 27389, 62, 26861, 28270, 62, 25664, 20520, 198, 198, 4798, 10786, 7248, 510, 2594, 11537, 198, 2617, 4933, 31007, 3419, 198, 21760, 796, 9629, 16177, 13, 43639, 42011, 3419, 198, 198, 4798, 10786, 8912, 19590, 11537, 198, 28751, 62, 7568, 11, 3463, 62, 7568, 796, 5552, 62, 43775, 62, 392, 62, 28751, 7, 1268, 30076, 50, 62, 4303, 15675, 9693, 36, 2767, 62, 2389, 8, 628, 198, 2, 27592, 1351, 2615, 2163, 198, 4798, 10786, 15580, 1628, 10638, 1351, 11537, 198, 439, 62, 16302, 62, 1416, 2850, 796, 1382, 62, 16302, 62, 49736, 62, 4868, 7, 28751, 62, 7568, 11, 3463, 62, 7568, 11, 3268, 30076, 50, 62, 20114, 1847, 62, 44, 24805, 2751, 62, 2389, 8, 198, 4798, 10786, 13065, 3876, 1096, 477, 262, 4493, 11537, 198, 4868, 62, 1462, 62, 33295, 11, 3509, 9452, 8053, 796, 35743, 62, 439, 62, 16302, 7, 439, 62, 16302, 62, 1416, 2850, 11, 6117, 62, 7568, 8, 628, 198, 19119, 3347, 316, 7, 4868, 62, 1462, 62, 33295, 11, 16289, 30076, 50, 62, 31180, 5781, 62, 2389, 11, 366, 22093, 0, 32, 17, 25, 3838, 12825, 4943, 198, 19119, 3347, 316, 7, 9806, 9452, 8053, 11, 16289, 30076, 50, 62, 31180, 5781, 62, 2389, 11, 366, 25396, 1843, 22852, 0, 32, 18, 25, 3838, 12825, 4943, 198, 198, 4798, 10786, 18467, 1348, 11, 3615, 640, 11537, 628 ]
2.900175
571
# This code is part of Qiskit. # # (C) Copyright IBM 2022. # # 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. """Test InitialPoint""" import unittest from unittest.mock import patch from test import QiskitNatureTestCase from qiskit_nature.algorithms.initial_points import InitialPoint class TestInitialPoint(QiskitNatureTestCase): """Test Initial Point""" @patch.multiple(InitialPoint, __abstractmethods__=set()) def test_to_numpy_array(self): """Test to_numpy_array.""" with self.assertRaises(NotImplementedError): self.initial_point.to_numpy_array() def test_get_ansatz(self): """Test get ansatz.""" with self.assertRaises(NotImplementedError): _ = self.initial_point.ansatz def test_set_ansatz(self): """Test set ansatz.""" with self.assertRaises(NotImplementedError): self.initial_point.ansatz = None def test_get_grouped_property(self): """Test get grouped_property.""" with self.assertRaises(NotImplementedError): _ = self.initial_point.grouped_property def test_set_grouped_property(self): """Test set grouped_property.""" with self.assertRaises(NotImplementedError): self.initial_point.grouped_property = None def test_compute(self): """Test compute.""" with self.assertRaises(NotImplementedError): self.initial_point.compute(None, None) if __name__ == "__main__": unittest.main()
[ 2, 770, 2438, 318, 636, 286, 1195, 1984, 270, 13, 198, 2, 198, 2, 357, 34, 8, 15069, 19764, 33160, 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, 14402, 20768, 12727, 37811, 198, 198, 11748, 555, 715, 395, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 8529, 198, 6738, 1332, 1330, 1195, 1984, 270, 46934, 14402, 20448, 198, 198, 6738, 10662, 1984, 270, 62, 21353, 13, 282, 7727, 907, 13, 36733, 62, 13033, 1330, 20768, 12727, 628, 198, 4871, 6208, 24243, 12727, 7, 48, 1984, 270, 46934, 14402, 20448, 2599, 198, 220, 220, 220, 37227, 14402, 20768, 6252, 37811, 628, 220, 220, 220, 2488, 17147, 13, 48101, 7, 24243, 12727, 11, 11593, 397, 8709, 24396, 82, 834, 28, 2617, 28955, 628, 220, 220, 220, 825, 1332, 62, 1462, 62, 77, 32152, 62, 18747, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 14402, 284, 62, 77, 32152, 62, 18747, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 351, 2116, 13, 30493, 21762, 2696, 7, 3673, 3546, 1154, 12061, 12331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 36733, 62, 4122, 13, 1462, 62, 77, 32152, 62, 18747, 3419, 628, 220, 220, 220, 825, 1332, 62, 1136, 62, 504, 27906, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 14402, 651, 9093, 27906, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 351, 2116, 13, 30493, 21762, 2696, 7, 3673, 3546, 1154, 12061, 12331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 796, 2116, 13, 36733, 62, 4122, 13, 504, 27906, 628, 220, 220, 220, 825, 1332, 62, 2617, 62, 504, 27906, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 14402, 900, 9093, 27906, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 351, 2116, 13, 30493, 21762, 2696, 7, 3673, 3546, 1154, 12061, 12331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 36733, 62, 4122, 13, 504, 27906, 796, 6045, 628, 220, 220, 220, 825, 1332, 62, 1136, 62, 8094, 276, 62, 26745, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 14402, 651, 32824, 62, 26745, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 351, 2116, 13, 30493, 21762, 2696, 7, 3673, 3546, 1154, 12061, 12331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 796, 2116, 13, 36733, 62, 4122, 13, 8094, 276, 62, 26745, 628, 220, 220, 220, 825, 1332, 62, 2617, 62, 8094, 276, 62, 26745, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 14402, 900, 32824, 62, 26745, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 351, 2116, 13, 30493, 21762, 2696, 7, 3673, 3546, 1154, 12061, 12331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 36733, 62, 4122, 13, 8094, 276, 62, 26745, 796, 6045, 628, 220, 220, 220, 825, 1332, 62, 5589, 1133, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 14402, 24061, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 351, 2116, 13, 30493, 21762, 2696, 7, 3673, 3546, 1154, 12061, 12331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 36733, 62, 4122, 13, 5589, 1133, 7, 14202, 11, 6045, 8, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
2.696403
695
#!/usr/bin/env python # coding: utf-8 # ## Compressive sampling Overview # our previous discussion, we saw that imposing bandlimited-ness on our class of signals permits point-wise sampling of our signal and then later perfect reconstruction. It turns out that by imposing *sparsity* we can also obtain perfect reconstruction irrespective of whether or not we have satsified the sampling rate limits imposed by Shannon's sampling theorem. This has extremely important in practice because many signals are naturally sparse so that collecting samples at high rates only to dump most of them as the signal is compressed is expensive and wasteful. # ## What Are Sparse Signals? # Let's carefully discuss what we np.mean by *sparse* in this context. A signal $f$ is sparse if it can be expressed in very few nonzero components ($\mathbf{s}$) with respect to a given basis ($ \mathbf{\Psi} $ ). In other words, in np.matrix-vector language: # # $ \mathbf{f} = \mathbf{\Psi} \mathbf{s} $ # # where $ || \mathbf{s} ||_0 \leq N $ where $N$ is the length of the vector and $|| \cdot||_0$ counts the number of nonzero elements in $\mathbf{s}$. Furthermore, we don't actually collect $N$ samples point-wise as we did in the Shannon sampling case. Rather, we measure $\mathbf{f}$ indirectly as $\mathbf{y}$ with another np.matrix as in: # # $\mathbf{y} = \mathbf{\Phi f} = \mathbf{\Phi} \mathbf{\Psi} \mathbf{s} = \mathbf{\Theta s} $ # # where $\mathbf{\Theta}$ is an $M \times N$ np.matrix and $ M < N $ is the number of measurements. This setup np.means we have two problems to solve. First, how to design a *stable* measurement np.matrix $\mathbf{\Phi}$ and then, second, how to reconstruct $ \mathbf{f} $ from $ \mathbf{y} $. # # This may look like a standard linear algebra problem but since $ \mathbf{\Theta} $ has fewer rows than columns, the solution is necessarily ill-posed. This is where we inject the sparsity concept! Suppose that $f$ is $K$-sparse ( $||f||_0=K$ ), then if we somehow knew *which* $K$ columns of $ \mathbf{\Theta} $ matched the $K$ non-zero entries in $\mathbf{s}$, then $\mathbf{\Theta}$ would be $ M \times K $ where we could make $M > K$ and then have a stable inverse. # # This bit of reasoning is encapsulated in the following statement for any vector $\mathbf{v}$ sharing the same $K$ non-zero entries as $\mathbf{s}$, we have # # $$1-\epsilon \leq \frac{|| \mathbf{\Theta v} ||_2}{|| \mathbf{v} ||_2} \leq 1+\epsilon $$ # # which is another way of saying that $\mathbf{\Theta}$ preserves the lengths of $K$-sparse vectors. Of course we don't know ahead of time which $K$ components to use, but it turns out that this condition is sufficient for a stable inverse of $\mathbf{\Theta}$ if it holds for any $3K$-sparse vector $\mathbf{v}$. This is the *Restricted Isometry Property* (RIP). Unfortunately, in order to use this sufficient condition, we would have to propose a $\mathbf{\Theta}$ and then check all possible combinations of nonzero entries in the $N$-length vector $\mathbf{v}$. As you may guess, this is prohibitive. # # Alternatively, we can approach stability by defining *incoherence* between the measurement np.matrix $\mathbf{\Phi}$ and the sparse basis $\mathbf{\Psi}$ as when any of the columns of one cannot be expressed as a small subset of the columns of the other. For example, if we have delta-spikes for $\mathbf{\Phi}$ as the row-truncated identity np.matrix # # $$\mathbf{\Phi} = \mathbf{I}_{M \times N} $$ # # and the discrete Fourier transform np.matrix for $\mathbf{\Psi}$ as # # $\mathbf{\Psi} = \begin{bnp.matrix}\\\\ # e^{-j 2\pi k n/N}\\\\ # \end{bnp.matrix}_{N \times N}$ # # Then we could not write any of the columns of $\mathbf{\Phi}$ using just a few of the columns of $\mathbf{\Psi}$. # # It turns out that picking the measuring $M \times N$ np.matrix np.random.randomly according to a Gaussian zero-np.mean, $1/N$ variance distribution and using the identity np.matrix as $\mathbf{\Phi}$, that the resulting $\mathbf{\Theta}$ np.matrix can be shown to satisfy RIP with a high probability. This np.means that we can recover $N$-length $K$-sparse signals with a high probability from just $M \ge c K \log (N/K)$ samples where $c$ is a small constant. Furthermore, it also turns out that we can use any orthonormal basis for $\mathbf{\Phi}$, not just the identity np.matrix, and these relations will all still hold. # ## Reconstructing Sparse Signals # Now that we have a way, by using np.random.random matrices, to satisfy the RIP, we are ready to consider the reconstruction problem. The first impulse is to compute the least-squares solution to this problem as # # $$ \mathbf{s}^* = \mathbf{\Theta}^T (\mathbf{\Theta}\mathbf{\Theta}^T)^{-1}\mathbf{y} $$ # # But a moment's thought may convince you that since $\mathbf{\Theta}$ is a np.random.random np.matrix, most likely with lots of non-zero entries, it is highly unlikely that $\mathbf{s}^* $ will turn out to be sparse. There is actually a deeper geometric intuition as to why this happens, but let's first consider another way of solving this so that the $\mathbf{s}^*$ is $K$-sparse. Suppose instead we shuffle through combinations of $K$ nonzero entries in $\mathbf{s}$ until we satisfy the measurements $\mathbf{y}$. Stated mathematically, this np.means # # $$ \mathbf{s}^* = argmin || \mathbf{s}^* ||_0 $$ # # where # # $$ \mathbf{\Theta} \mathbf{s}^* = \mathbf{y} $$ # # It can be shown that with $M=K+1$ iid Gaussian measurements, this optimization will recover a $K$-sparse signal exactly with high probability. Unfortunately, this is numerically unstable in addition to being an NP-complete problem. # # Thus, we need another tractable way to approach this problem. It turns out that when a signal is sparse, it usually np.means that the nonzero terms are highly asymmetric np.meaning that if there are $K$ terms, then most likely there is one term that is dominant (i.e. of much larger magnitude) and that dwarfs the other nonzero terms. Geometrically, this np.means that in $N$-dimensional space, the sparse signal is very close to one (or, maybe just a few) of the axes. # # It turns out that one can bypass this combinatorial problem using $L_1$ minimization. To examine this, let's digress and look at the main difference between $L_2$ and $L_1$ minimization problems. # reference: # `http://users.ece.gatech.edu/justin/ssp2007` # ## $L_2$ vs. $L_1$ Optimization # The classic constrained least squares problem is the following: # # min $||\mathbf{x}||_2^2$ # # where $x_1 + 2 x_2 = 1$ # # with corresponding solution illustrated below. # # [1] import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Circle x1 = np.linspace(-1, 1, 10) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x1, (1 - x1) / 2) ax.add_patch(Circle((0, 0), 1 / np.sqrt(5), alpha=0.3)) ax.plot(1 / 5, 2 / 5, 'rs') ax.axis('equal') ax.set_xlabel('$x_1$', fontsize=24) ax.set_ylabel('$x_2$', fontsize=24) ax.grid() # Note that the line is the constraint so that any solution to this problem must be on this line (i.e. satisfy the constraint). The $L_2$ solution is the one that just touches the perimeter of the circle. This is because, in $L_2$, the unit-ball has the shape of a circle and represents all solutions of a fixed $L_2$ length. Thus, the one of smallest length that intersects the line is the one that satisfies the stated minimization problem. Intuitively, this np.means that we *inflate* a ball at the origin and stop when it touches the contraint. The point of contact is our $L_2$ minimization solution. # # Now, let's do same problem in $L_1$ norm # # min $||\mathbf{x}||_1=|x_1|+|x_2|$ # # where $x_1 + 2 x_2 = 1$ # # this case the constant-norm unit-ball contour in the $L_1$ norm is a diamond-shape instead of a circle. Comparing the graph below to the last shows that the solutions found are different. Geometrically, this is because the line tilts over in such a way that the inflating circular $L_2$ ball hits a point of tangency that is different from the $L_1$ ball because the $L_1$ ball creeps out mainly along the principal axes and is less influenced by the tilt of the line. This effect is much more pronounced in higher $N$-dimensional spaces where $L_1$-balls get more *spikey*. # # The fact that the $L_1$ problem is less sensitive to the tilt of the line is crucial since that tilt (i.e. orientation) is np.random.random due the choice of np.random.random measurement matrices. So, for this problem to be well-posed, we need to *not* be influenced by the orientation of any particular choice of np.random.random np.matrix and this is what casting this as a $L_1$ minimization provides. # [2] from matplotlib.patches import Rectangle import matplotlib.patches import matplotlib.transforms r = matplotlib.patches.RegularPolygon((0, 0), 4, 1 / 2, np.pi / 2, alpha=0.5) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x1, (1 - x1) / 2) ax.plot(0, 1 / 2, 'rs') ax.add_patch(r) ax.grid() ax.set_xlabel('$x_1$', fontsize=24) ax.set_ylabel('$x_2$', fontsize=24) ax.axis('equal') # To explore this a bit, let's consider using the `cvxopt` package (Python ver 2.6 used here). This can be cast as a linear programming problem as follows: # # min $||\mathbf{t}||_1 = |t_1| + |t_2|$ # # subject to: # # $-t_1 < x_1 < t_1$ # # $-t_2 < x_2 < t_2$ # # $x_1 + 2 x_2 = 1$ # # $t_1 > 0$ # # $t_2 > 0$ # # where the last two constraints are already implied by the first two and are written out just for clarity. This can be implemented and solved in `cvxopt` as the following: # [3] from cvxopt import matrix as matrx # don't overrite numpy matrix class from cvxopt import solvers # t1,x1,t2,x2 c = matrx([1, 0, 1, 0], (4, 1), 'd') G = matrx([[-1, -1, 0, 0], # column-0 [1, -1, 0, 0], # column-1 [0, 0, -1, -1], # column-2 [0, 0, 1, -1], # column-3 ], (4, 4), 'd') # (4,1) is 4-rows,1-column, 'd' is float type spec h = matrx([0, 0, 0, 0], (4, 1), 'd') A = matrx([0, 1, 0, 2], (1, 4), 'd') b = matrx([1], (1, 1), 'd') sol = solvers.lp(c, G, h, A, b) x1 = sol['x'][1] x2 = sol['x'][3] print('x=%3.2f' % x1) print('y=%3.2f' % x2) # ## Example Gaussian np.random.random matrices # Let's try out our earlier result about np.random.random Gaussian matrices and see if we can reconstruct an unknown $\mathbf{s}$ vector using $L_1$ minimization. # [56] import numpy as np import scipy.linalg def rearrange_G(x): 'setup to put inequalities np.matrix with last 1/2 of elements as main variables' n = x.shape[0] return np.hstack([x[:, np.arange(0, n, 2) + 1], x[:, np.arange(0, n, 2)]]) K = 2 # components Nf = 128 # number of samples M = 12 # > K log2(Nf/K); num of measurements s = np.zeros((Nf, 1)) # sparse vector we want to find s[0] = 1 # set the K nonzero entries s[1] = 0.5 # np.np.random.random.seed(5489) # set np.random.random seed for reproducibility Phi = np.matrix(np.random.randn(M, Nf) * np.sqrt(1 / Nf)) # np.random.random Gaussian np.matrix y = Phi * s # measurements # -- setup L1 minimization problem -- # equalities np.matrix with G = matrx(rearrange_G(scipy.linalg.block_diag( *[np.matrix([[-1, -1], [1, -1.0]]), ] * Nf))) # objective function row-np.matrix c = matrx(np.hstack([np.ones(Nf), np.zeros(Nf)])) # RHS for inequalities h = matrx([0.0, ] * (Nf * 2), (Nf * 2, 1), 'd') # equality constraint np.matrix A = matrx(np.hstack([Phi * 0, Phi])) # RHS for equality constraints b = matrx(y) sol = solvers.lp(c, G, h, A, b) # nonzero entries nze = np.array(sol['x']).flatten()[:Nf].round(2).nonzero() print(np.array(sol['x'])[nze]) # That worked out! However, if you play around with this example enough with different np.random.random matrices (unset the ``seed`` statement above), you will find that it does not *always* find the correct answer. This is because the guarantees about reconstruction are all stated probabalistically (i.e. "high-probability"). This is another major difference between this and Shannon sampling. # # Let's encapulate the above $L_1$ minimization code so we can use it later. # [5] #from cStringIO import StringIO import sys # ## Example: Sparse Fourier Transform # As an additional example, let us consider the Fourier transform and see if we can recover the sparse Fourier transform from a small set of measurements. For simplicity, we will assume that the time domain signal is real which automatically np.means that the Fourier transform is symmetric. # [141] def dftmatrix(N=8): 'compute inverse DFT matrices' n = np.arange(N) U = matrx(np.exp(1j * 2 * np.pi / N * n * n[:, None])) / np.sqrt(N) return np.matrix(U) Nf = 128 K = 3 # components M = 8 # > K log2(Nf/K); num of measurements s = np.zeros((Nf, 1)) # sparse vector we want to find s[0] = 1 # set the K nonzero entries s[1] = 0.5 s[-1] = 0.5 # symmetric to keep inverse Fourier transform real Phi = dftmatrix(Nf)[:M, :] # take M-rows y = Phi * s # measurements # have to assert the type here on my hardware sol = L1_min(Phi.real, y.real.astype(np.float64), K) print(np.allclose(s.flatten(), sol)) # [140] plt.plot(sol) plt.plot(y.real) # ## Uniform Uncertainty Principle # $\Phi$ obeys a UUP for sets of size $K$ if # # <center> # $$ 0.8 \frac{M}{N} ||f||_2^2 \leq || \Phi f||_2^2 \leq 1.2 \frac{M}{N} ||f||_2^2 $$ # </center> # # Measurements that satisfy this are defined as *incoherent*. Given that $f$ is $K$-sparse and we measure # $y=\Phi f$, then we search for the sparsest vector that explains the $y$ measurements and thus find $f$ as follows: # # <center> # $min_f \\#\lbrace t: f(t) \ne 0 \rbrace $ where $\Phi f = y$ # </center> # Note that the hash mark is the size (i.e. cardinality) of the set. This np.means that we are looking for the fewest individual points for $f$ that satisfy the constraints. Unfortunately, this is not practically possible, so we must use the $\mathbb{L}_1$ norm as a proxy for sparsity. # # Suppose $f$ is $K$-sparse and that $\Phi$ obeys UUP for sets of size $4K$. Then we measure $y=\Phi f$ and then solve # # <center> # $min_f ||f||_1 $ where $\Phi f = y$ # </center> # to recover $f$ exactly and we can use $M > K \log N$ measurements, where the number of measurements is approximately equal to the number of active components. Let's consider a concrete example of how this works. # ### Example: Sampling Sinusoids # Here, we sample in the time-domain, given that we know the signal is sparse in the frequency domain. # # <center> # $$ \hat{f}(\omega) = \sum_{i=1}^K \alpha_i \delta(\omega_i-\omega) $$ # </center> # # which np.means that it consists of $K$-sparse nonzero elements. Therefore, the time domain signal is # # <center> # $$ f(t) = \sum_{i=1}^K \alpha_i e^{i \omega_i t} $$ # </center> # # where the $\alpha_i$ and $\omega_i$ are unknown. We want solve for these unknowns by taking $M \gt K \log N$ samples of $f$. # The problem we want to solve is # # $ min_g || \hat{g} ||_{L_1}$ # # subject to # # $ g(t_m)=f(t_m) $ # # The trick here is that are minimizing in the frequency-domain while the constraints are in the time-domain. To make things easier, we will restrict our attention to real time-domain signals $f$ and we will only reconstruct the even-indexed time-samples from the signal. This np.means we need a way of expressing the inverse Fourier Transform as a np.matrix of equality constraints. The assumption of real-valued time-domain signals implies the following symmetry in the frequency-domain: # # $ F(k) = F(N-k)^* $ # # where $F$ is the Fourier transform of $f$ and the asterisk denotes complex conjugation and $k\in \lbrace 0,1,..N-1\rbrace$ and $N$ is the Fourier Transform length. To make things even more tractable we will assume the time-domain signal is even, which np.means real-valued Fourier transform values. # # Suppose that $\mathbf{U}_N$ is the $N$-point DFT-np.matrix. Note that we always assume $N$ is even. Since we are dealing with only real-valued signals, the transform is symmetric, so we only need half of the spectrum computed. It turns out that the even-indexed time-domain samples can be constructed as follows: # # $ \mathbf{f_{even}} = \mathbf{U}_{N/2} \begin{bnp.matrix}\\\\ # F(0)+F(N/2)^* \\\\ # F(1)+F(N/2-1)^* \\\\ # F(2)+F(N/2-2)^* \\\\ # \dots \\\\ # F(N/2-1)+F(1)^* # \end{bnp.matrix}$ # # We can further simplify this by breaking this into real (superscript $R$) and imaginary (superscript $I$) parts and keeping only the real part # # $$\mathbf{f_{even}} = \mathbf{U}_{N/2}^R # \begin{bnp.matrix}\\\\ # F(0)^R+F(N/2)^R \\\\ # F(1)^R+F(N/2-1)^R \\\\ # F(2)^R+F(N/2-2)^R \\\\ # \dots \\\\ # F(N/2-1)^R+F(1)^R # \end{bnp.matrix} # + # \mathbf{U}^I_N # \begin{bnp.matrix} \\\\ # -F(0)^I+F(N/2)^I \\\\ # -F(1)^I+F(N/2-1)^I \\\\ # -F(2)^I+F(N/2-2)^I \\\\ # \dots \\\\ # -F(N/2-1)^I+F(1)^I # \end{bnp.matrix}$$ # # But we are going to force all the $F(k)^I$ to be zero in our example. Note that the second term should have a $\mathbf{U}_{N/2}$ in it instead $\mathbf{U}_N$ but there is something wrong with the javascript parser for that bit of TeX. # # Now, let's see if we can walk through to step-by-step to make sure our optimization can actually work. Note that we don't need the second term on the right with the $F^I$ terms because by our construction, $F$ is real. # [358] def dftmatrix(N=8): 'compute inverse DFT matrices' n = np.arange(N) U = np.matrix(np.exp(1j * 2 * np.pi / N * n * n[:, None])) / np.sqrt(N) return np.matrix(U) def Q_rmatrix(Nf=8): 'implements the reordering, adding, and stacking of the matrices above' Q_r = np.matrix(np.hstack([np.eye(int(Nf / 2)), np.eye(int(Nf / 2)) * 0]) + np.hstack([np.zeros((int(Nf / 2), 1)), np.fliplr(np.eye(int(Nf / 2))), np.zeros((int(Nf / 2), int(Nf / 2) - 1))])) return Q_r Nf = 8 F = np.zeros((Nf, 1)) # 8-point DFT F[0] = 1 # DC-term, constant signal n = np.arange(Nf / 2) ft = dftmatrix(Nf).H * F # this gives the constant signal Q_r = Q_rmatrix(Nf) U = dftmatrix(Nf / 2) # half inverse DFT np.matrix feven = U.real * Q_r * F # half the size print(np.allclose(feven, ft[::2])) # retrieved even-numbered samples # [359] # let's try this with another sparse frequency-domain signal F = np.zeros((Nf, 1)) F[1] = 1 F[Nf - 1] = 1 # symmetric part ft = dftmatrix(Nf).H * F # this gives the constant signal feven = U.real * Q_r * F # half the size print(np.allclose(feven, ft[::2])) # retrieved even-numbered samples plt.plot(np.arange(Nf), ft.real, np.arange(Nf)[::2], feven, 'o') plt.xlabel('$t$', fontsize=22) plt.ylabel('$f(t)$', fontsize=22) plt.title('even-numbered samples') # We can use the above cell to create more complicated real signals. You can experiment with the cell below. Just remember to impose the symmetry condition! # [360] Nf = 32 # must be even F = np.zeros((Nf, 1)) # set values and corresponding symmetry conditions F[7] = 1 F[12] = 0.5 F[9] = -0.25 F[Nf - 9] = -0.25 F[Nf - 12] = 0.5 F[Nf - 7] = 1 # symmetric part Q_r = Q_rmatrix(Nf) U = dftmatrix(Nf / 2) # half inverse DFT np.matrix ft = dftmatrix(Nf).H * F # this gives the constant signal feven = U.real * Q_r * F # half the size print(np.allclose(feven, ft[::2])) # retrieved even-numbered samples plt.plot(np.arange(Nf), ft.real, np.arange(Nf)[::2], feven, 'o') plt.xlabel('$t$', fontsize=22) plt.ylabel('$f(t)$', fontsize=22) plt.title('even-numbered samples') # Now that we have gone through all that trouble to create the even-samples np.matrix, we can finally put it into the framework of the $L_1$ minimization problem: # # $ min_F || \mathbf{F} ||_{L_1}$ # # subject to # # $ \mathbf{U}_{N/2}^R \mathbf{Q}_r \mathbf{F}= \mathbf{f} $ # [361] def rearrange_G(x): 'setup to put inequalities np.matrix with first 1/2 of elements as main variables' n = x.shape[0] return np.hstack([x[:, np.arange(0, n, 2) + 1], x[:, np.arange(0, n, 2)]]) K = 2 # components Nf = 128 # number of samples M = 18 # > K log(N); num of measurements # setup signal DFT as F F = np.zeros((Nf, 1)) F[1] = 1 F[2] = 0.5 F[Nf - 1] = 1 # symmetric parts F[Nf - 2] = 0.5 ftime = dftmatrix(Nf).H * F # this gives the time-domain signal ftime = ftime.real # it's real anyway time_samples = [0, 2, 4, 12, 14, 16, 18, 24, 34, 36, 38, 40, 44, 46, 52, 56, 54, 62] half_indexed_time_samples = (np.array(time_samples) / 2).astype(int) Phi = dftmatrix(Nf / 2).real * Q_rmatrix(Nf) Phi_i = Phi[half_indexed_time_samples, :] # equalities np.matrix with G = matrx(rearrange_G(scipy.linalg.block_diag( *[np.matrix([[-1, -1], [1, -1.0]]), ] * Nf))) # objective function row-np.matrix c = matrx(np.hstack([np.zeros(Nf), np.ones(Nf)])) # RHS for inequalities h = matrx([0.0, ] * (Nf * 2), (Nf * 2, 1), 'd') # equality constraint np.matrix A = matrx(np.hstack([Phi_i, Phi_i * 0])) # RHS for equality constraints b = matrx(ftime[time_samples]) sol = solvers.lp(c, G, h, A, b) # [12] import itertools as it def dftmatrix(N=8): 'compute inverse DFT matrices' n = np.arange(N) U = np.matrix(np.exp(1j * 2 * np.pi / N * n * n[:, None])) / np.sqrt(N) return np.matrix(U) M = 3 # np.np.random.random.seed(5489) # set np.random.random seed for reproducibility Psi = dftmatrix(128) Phi = np.random.randn(M, 128) s = np.zeros((128, 1)) s[0] = 1 s[10] = 1 Theta = Phi * Psi y = Theta * s for i in it.combinations(range(128), 2): sstar = np.zeros((128, 1)) sstar[np.array(i)] = 1 if np.allclose(Theta * sstar, y): break else: print('no solution') # [9] # [ ]
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 2, 22492, 3082, 3314, 19232, 28578, 198, 198, 2, 220, 674, 2180, 5114, 11, 356, 2497, 326, 20814, 4097, 10698, 12, 1108, 319, 674, 1398, 286, 10425, 13892, 966, 12, 3083, 19232, 286, 674, 6737, 290, 788, 1568, 2818, 25056, 13, 632, 4962, 503, 326, 416, 20814, 1635, 2777, 45826, 9, 356, 460, 635, 7330, 2818, 25056, 40611, 286, 1771, 393, 407, 356, 423, 264, 1381, 1431, 262, 19232, 2494, 7095, 10893, 416, 28108, 338, 19232, 44728, 13, 770, 468, 4457, 1593, 287, 3357, 780, 867, 10425, 389, 8752, 29877, 523, 326, 13157, 8405, 379, 1029, 3965, 691, 284, 10285, 749, 286, 606, 355, 262, 6737, 318, 25388, 318, 5789, 290, 45393, 13, 198, 198, 2, 22492, 1867, 4231, 1338, 17208, 5865, 874, 30, 198, 198, 2, 3914, 338, 7773, 2112, 644, 356, 45941, 13, 32604, 416, 1635, 82, 29572, 9, 287, 428, 4732, 13, 317, 6737, 720, 69, 3, 318, 29877, 611, 340, 460, 307, 6241, 287, 845, 1178, 1729, 22570, 6805, 7198, 59, 11018, 19881, 90, 82, 92, 3, 8, 351, 2461, 284, 257, 1813, 4308, 7198, 3467, 11018, 19881, 31478, 12016, 72, 92, 720, 6739, 554, 584, 2456, 11, 287, 45941, 13, 6759, 8609, 12, 31364, 3303, 25, 198, 2, 198, 2, 720, 3467, 11018, 19881, 90, 69, 92, 796, 3467, 11018, 19881, 31478, 12016, 72, 92, 3467, 11018, 19881, 90, 82, 92, 720, 198, 2, 198, 2, 810, 220, 720, 8614, 3467, 11018, 19881, 90, 82, 92, 8614, 62, 15, 3467, 293, 80, 399, 720, 810, 720, 45, 3, 318, 262, 4129, 286, 262, 15879, 290, 220, 720, 15886, 3467, 10210, 313, 15886, 62, 15, 3, 9853, 262, 1271, 286, 1729, 22570, 4847, 287, 39280, 11018, 19881, 90, 82, 92, 35307, 11399, 11, 356, 836, 470, 1682, 2824, 720, 45, 3, 8405, 966, 12, 3083, 355, 356, 750, 287, 262, 28108, 19232, 1339, 13, 11317, 11, 356, 3953, 39280, 11018, 19881, 90, 69, 92, 3, 20762, 355, 39280, 11018, 19881, 90, 88, 92, 3, 351, 1194, 45941, 13, 6759, 8609, 355, 287, 25, 198, 2, 198, 2, 39280, 11018, 19881, 90, 88, 92, 220, 796, 3467, 11018, 19881, 31478, 2725, 72, 277, 92, 796, 3467, 11018, 19881, 31478, 2725, 72, 92, 3467, 11018, 19881, 31478, 12016, 72, 92, 3467, 11018, 19881, 90, 82, 92, 796, 3467, 11018, 19881, 31478, 464, 8326, 264, 92, 220, 220, 720, 198, 2, 198, 2, 810, 220, 39280, 11018, 19881, 31478, 464, 8326, 92, 3, 220, 318, 281, 720, 44, 3467, 22355, 399, 3, 45941, 13, 6759, 8609, 290, 720, 337, 1279, 399, 720, 318, 262, 1271, 286, 13871, 13, 770, 9058, 45941, 13, 1326, 504, 356, 423, 734, 2761, 284, 8494, 13, 3274, 11, 703, 284, 1486, 257, 1635, 31284, 9, 15558, 45941, 13, 6759, 8609, 39280, 11018, 19881, 31478, 2725, 72, 92, 3, 290, 788, 11, 1218, 11, 703, 284, 31081, 720, 3467, 11018, 19881, 90, 69, 92, 720, 422, 720, 3467, 11018, 19881, 90, 88, 92, 720, 13, 198, 2, 198, 2, 770, 743, 804, 588, 257, 3210, 14174, 37139, 1917, 475, 1201, 720, 3467, 11018, 19881, 31478, 464, 8326, 92, 720, 468, 7380, 15274, 621, 15180, 11, 262, 4610, 318, 6646, 2801, 12, 29813, 13, 770, 318, 810, 356, 8677, 262, 599, 45826, 3721, 0, 39200, 326, 720, 69, 3, 318, 720, 42, 3, 12, 82, 29572, 357, 720, 15886, 69, 15886, 62, 15, 28, 42, 3, 10612, 788, 611, 356, 7599, 2993, 1635, 4758, 9, 720, 42, 3, 15180, 286, 720, 3467, 11018, 19881, 31478, 464, 8326, 92, 720, 14451, 262, 720, 42, 3, 1729, 12, 22570, 12784, 287, 39280, 11018, 19881, 90, 82, 92, 47113, 788, 39280, 11018, 19881, 31478, 464, 8326, 92, 3, 561, 307, 720, 337, 3467, 22355, 509, 720, 810, 356, 714, 787, 720, 44, 1875, 509, 3, 290, 788, 423, 257, 8245, 34062, 13, 198, 2, 198, 2, 770, 1643, 286, 14607, 318, 32652, 4817, 287, 262, 1708, 2643, 329, 597, 15879, 39280, 11018, 19881, 90, 85, 92, 3, 7373, 262, 976, 720, 42, 3, 1729, 12, 22570, 12784, 355, 39280, 11018, 19881, 90, 82, 92, 47113, 356, 423, 198, 2, 198, 2, 32382, 16, 12, 59, 538, 18217, 261, 3467, 293, 80, 3467, 31944, 90, 15886, 220, 3467, 11018, 19881, 31478, 464, 8326, 410, 92, 8614, 62, 17, 18477, 15886, 3467, 11018, 19881, 90, 85, 92, 220, 8614, 62, 17, 92, 3467, 293, 80, 352, 10, 59, 538, 18217, 261, 32382, 198, 2, 198, 2, 543, 318, 1194, 835, 286, 2282, 326, 39280, 11018, 19881, 31478, 464, 8326, 92, 3, 43759, 262, 20428, 286, 720, 42, 3, 12, 82, 29572, 30104, 13, 3226, 1781, 356, 836, 470, 760, 4058, 286, 640, 543, 720, 42, 3, 6805, 284, 779, 11, 475, 340, 4962, 503, 326, 428, 4006, 318, 6751, 329, 257, 8245, 34062, 286, 39280, 11018, 19881, 31478, 464, 8326, 92, 3, 611, 340, 6622, 329, 597, 220, 720, 18, 42, 3, 12, 82, 29572, 15879, 39280, 11018, 19881, 90, 85, 92, 35307, 770, 318, 262, 1635, 19452, 20941, 1148, 15748, 14161, 9, 357, 32618, 737, 8989, 11, 287, 1502, 284, 779, 428, 6751, 4006, 11, 356, 561, 423, 284, 18077, 257, 39280, 11018, 19881, 31478, 464, 8326, 92, 3, 290, 788, 2198, 477, 1744, 17790, 286, 1729, 22570, 12784, 287, 262, 720, 45, 3, 12, 13664, 15879, 39280, 11018, 19881, 90, 85, 92, 35307, 1081, 345, 743, 4724, 11, 428, 318, 6221, 1800, 13, 198, 2, 198, 2, 25929, 11, 356, 460, 3164, 10159, 416, 16215, 1635, 259, 1073, 23545, 9, 1022, 262, 15558, 45941, 13, 6759, 8609, 39280, 11018, 19881, 31478, 2725, 72, 92, 3, 290, 262, 29877, 4308, 39280, 11018, 19881, 31478, 12016, 72, 92, 3, 355, 618, 597, 286, 262, 15180, 286, 530, 2314, 307, 6241, 355, 257, 1402, 24637, 286, 262, 15180, 286, 262, 584, 13, 1114, 1672, 11, 611, 356, 423, 25979, 12, 2777, 7938, 329, 39280, 11018, 19881, 31478, 2725, 72, 92, 3, 355, 262, 5752, 12, 2213, 19524, 515, 5369, 45941, 13, 6759, 8609, 198, 2, 198, 2, 32382, 59, 11018, 19881, 31478, 2725, 72, 92, 796, 3467, 11018, 19881, 90, 40, 92, 23330, 44, 3467, 22355, 399, 92, 32382, 198, 2, 198, 2, 290, 262, 28810, 34296, 5277, 6121, 45941, 13, 6759, 8609, 329, 39280, 11018, 19881, 31478, 12016, 72, 92, 3, 355, 198, 2, 198, 2, 39280, 11018, 19881, 31478, 12016, 72, 92, 796, 3467, 27471, 90, 9374, 79, 13, 6759, 8609, 92, 13426, 198, 2, 304, 36796, 12, 73, 362, 59, 14415, 479, 299, 14, 45, 92, 13426, 198, 2, 3467, 437, 90, 9374, 79, 13, 6759, 8609, 92, 23330, 45, 3467, 22355, 399, 92, 3, 198, 2, 198, 2, 3244, 356, 714, 407, 3551, 597, 286, 262, 15180, 286, 39280, 11018, 19881, 31478, 2725, 72, 92, 3, 1262, 655, 257, 1178, 286, 262, 15180, 286, 39280, 11018, 19881, 31478, 12016, 72, 92, 35307, 198, 2, 198, 2, 632, 4962, 503, 326, 10868, 262, 15964, 720, 44, 3467, 22355, 399, 3, 45941, 13, 6759, 8609, 45941, 13, 25120, 13, 25120, 306, 1864, 284, 257, 12822, 31562, 6632, 12, 37659, 13, 32604, 11, 720, 16, 14, 45, 3, 24198, 6082, 290, 1262, 262, 5369, 45941, 13, 6759, 8609, 355, 39280, 11018, 19881, 31478, 2725, 72, 92, 47113, 326, 262, 7186, 39280, 11018, 19881, 31478, 464, 8326, 92, 3, 45941, 13, 6759, 8609, 460, 307, 3402, 284, 15959, 44967, 351, 257, 1029, 12867, 13, 770, 45941, 13, 1326, 504, 326, 356, 460, 8551, 720, 45, 3, 12, 13664, 720, 42, 3, 12, 82, 29572, 10425, 351, 257, 1029, 12867, 422, 655, 720, 44, 3467, 469, 269, 509, 3467, 6404, 357, 45, 14, 42, 8, 3, 8405, 810, 720, 66, 3, 318, 257, 1402, 6937, 13, 11399, 11, 340, 635, 4962, 503, 326, 356, 460, 779, 597, 29617, 261, 6636, 4308, 329, 39280, 11018, 19881, 31478, 2725, 72, 92, 47113, 407, 655, 262, 5369, 45941, 13, 6759, 8609, 11, 290, 777, 2316, 481, 477, 991, 1745, 13, 198, 198, 2, 22492, 23419, 7249, 278, 1338, 17208, 5865, 874, 198, 198, 2, 2735, 326, 356, 423, 257, 835, 11, 416, 1262, 45941, 13, 25120, 13, 25120, 2603, 45977, 11, 284, 15959, 262, 44967, 11, 356, 389, 3492, 284, 2074, 262, 25056, 1917, 13, 383, 717, 25278, 318, 284, 24061, 262, 1551, 12, 16485, 3565, 4610, 284, 428, 1917, 355, 198, 2, 198, 2, 32382, 3467, 11018, 19881, 90, 82, 92, 61, 9, 796, 3467, 11018, 19881, 31478, 464, 8326, 92, 61, 51, 357, 59, 11018, 19881, 31478, 464, 8326, 32239, 11018, 19881, 31478, 464, 8326, 92, 61, 51, 8, 36796, 12, 16, 32239, 11018, 19881, 90, 88, 92, 32382, 198, 2, 198, 2, 887, 257, 2589, 338, 1807, 743, 11508, 345, 326, 1201, 39280, 11018, 19881, 31478, 464, 8326, 92, 3, 318, 257, 45941, 13, 25120, 13, 25120, 45941, 13, 6759, 8609, 11, 749, 1884, 351, 6041, 286, 1729, 12, 22570, 12784, 11, 340, 318, 4047, 7485, 326, 39280, 11018, 19881, 90, 82, 92, 61, 9, 720, 481, 1210, 503, 284, 307, 29877, 13, 1318, 318, 1682, 257, 9211, 38445, 31563, 355, 284, 1521, 428, 4325, 11, 475, 1309, 338, 717, 2074, 1194, 835, 286, 18120, 428, 523, 326, 262, 39280, 11018, 19881, 90, 82, 92, 61, 9, 3, 318, 720, 42, 3, 12, 82, 29572, 13, 220, 39200, 2427, 356, 36273, 832, 17790, 286, 720, 42, 3, 1729, 22570, 12784, 287, 39280, 11018, 19881, 90, 82, 92, 3, 1566, 356, 15959, 262, 13871, 39280, 11018, 19881, 90, 88, 92, 35307, 520, 515, 2603, 46558, 11, 428, 45941, 13, 1326, 504, 198, 2, 198, 2, 32382, 3467, 11018, 19881, 90, 82, 92, 61, 9, 796, 1822, 1084, 8614, 3467, 11018, 19881, 90, 82, 92, 61, 9, 8614, 62, 15, 220, 32382, 198, 2, 198, 2, 810, 198, 2, 198, 2, 32382, 3467, 11018, 19881, 31478, 464, 8326, 92, 3467, 11018, 19881, 90, 82, 92, 61, 9, 796, 3467, 11018, 19881, 90, 88, 92, 32382, 198, 2, 198, 2, 632, 460, 307, 3402, 326, 351, 720, 44, 28, 42, 10, 16, 3, 1312, 312, 12822, 31562, 13871, 11, 428, 23989, 481, 8551, 257, 720, 42, 3, 12, 82, 29572, 6737, 3446, 351, 1029, 12867, 13, 8989, 11, 428, 318, 5470, 1146, 21354, 287, 3090, 284, 852, 281, 28498, 12, 20751, 1917, 13, 198, 2, 198, 2, 6660, 11, 356, 761, 1194, 14998, 540, 835, 284, 3164, 428, 1917, 13, 632, 4962, 503, 326, 618, 257, 6737, 318, 29877, 11, 340, 3221, 45941, 13, 1326, 504, 326, 262, 1729, 22570, 2846, 389, 4047, 30372, 19482, 45941, 13, 24815, 326, 611, 612, 389, 720, 42, 3, 2846, 11, 788, 749, 1884, 612, 318, 530, 3381, 326, 318, 11410, 357, 72, 13, 68, 13, 286, 881, 4025, 14735, 8, 290, 326, 15594, 9501, 262, 584, 1729, 22570, 2846, 13, 2269, 908, 81, 1146, 11, 428, 45941, 13, 1326, 504, 326, 287, 720, 45, 3, 12, 19577, 2272, 11, 262, 29877, 6737, 318, 845, 1969, 284, 530, 357, 273, 11, 3863, 655, 257, 1178, 8, 220, 286, 262, 34197, 13, 198, 2, 198, 2, 632, 4962, 503, 326, 530, 460, 17286, 428, 1974, 20900, 498, 1917, 1262, 720, 43, 62, 16, 3, 10356, 1634, 13, 1675, 10716, 428, 11, 1309, 338, 3100, 601, 290, 804, 379, 262, 1388, 3580, 1022, 720, 43, 62, 17, 3, 290, 720, 43, 62, 16, 3, 10356, 1634, 2761, 13, 198, 198, 2, 4941, 25, 198, 2, 4600, 4023, 1378, 18417, 13, 68, 344, 13, 10494, 354, 13, 15532, 14, 212, 3137, 259, 14, 824, 79, 12726, 63, 198, 198, 2, 22492, 720, 43, 62, 17, 3, 3691, 13, 720, 43, 62, 16, 3, 30011, 1634, 198, 198, 2, 383, 6833, 31070, 1551, 24438, 1917, 318, 262, 1708, 25, 198, 2, 198, 2, 949, 720, 15886, 59, 11018, 19881, 90, 87, 92, 15886, 62, 17, 61, 17, 3, 198, 2, 198, 2, 810, 720, 87, 62, 16, 1343, 362, 2124, 62, 17, 796, 352, 3, 198, 2, 198, 2, 351, 11188, 4610, 18542, 2174, 13, 198, 2, 198, 198, 2, 685, 16, 60, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 2603, 29487, 8019, 13, 8071, 2052, 1330, 16291, 198, 87, 16, 796, 45941, 13, 21602, 10223, 32590, 16, 11, 352, 11, 838, 8, 198, 5647, 796, 458, 83, 13, 26875, 3419, 198, 897, 796, 2336, 13, 2860, 62, 7266, 29487, 7, 16243, 8, 198, 897, 13, 29487, 7, 87, 16, 11, 357, 16, 532, 2124, 16, 8, 1220, 362, 8, 198, 897, 13, 2860, 62, 17147, 7, 31560, 293, 19510, 15, 11, 657, 828, 352, 1220, 45941, 13, 31166, 17034, 7, 20, 828, 17130, 28, 15, 13, 18, 4008, 198, 897, 13, 29487, 7, 16, 1220, 642, 11, 362, 1220, 642, 11, 705, 3808, 11537, 198, 897, 13, 22704, 10786, 40496, 11537, 198, 897, 13, 2617, 62, 87, 18242, 10786, 3, 87, 62, 16, 3, 3256, 10369, 7857, 28, 1731, 8, 198, 897, 13, 2617, 62, 2645, 9608, 10786, 3, 87, 62, 17, 3, 3256, 10369, 7857, 28, 1731, 8, 198, 897, 13, 25928, 3419, 628, 198, 2, 5740, 326, 262, 1627, 318, 262, 32315, 523, 326, 597, 4610, 284, 428, 1917, 1276, 307, 319, 428, 1627, 357, 72, 13, 68, 13, 15959, 262, 32315, 737, 383, 720, 43, 62, 17, 3, 4610, 318, 262, 530, 326, 655, 18105, 262, 25317, 286, 262, 9197, 13, 770, 318, 780, 11, 287, 720, 43, 62, 17, 47113, 262, 4326, 12, 1894, 468, 262, 5485, 286, 257, 9197, 290, 6870, 477, 8136, 286, 257, 5969, 720, 43, 62, 17, 3, 4129, 13, 6660, 11, 262, 530, 286, 18197, 4129, 326, 36177, 82, 262, 1627, 318, 262, 530, 326, 45104, 262, 5081, 10356, 1634, 1917, 13, 2558, 33740, 306, 11, 428, 45941, 13, 1326, 504, 326, 356, 1635, 259, 2704, 378, 9, 257, 2613, 379, 262, 8159, 290, 2245, 618, 340, 18105, 262, 3445, 2913, 13, 383, 966, 286, 2800, 318, 674, 720, 43, 62, 17, 3, 10356, 1634, 4610, 13, 198, 2, 198, 2, 2735, 11, 1309, 338, 466, 976, 1917, 287, 720, 43, 62, 16, 3, 2593, 198, 2, 198, 2, 949, 720, 15886, 59, 11018, 19881, 90, 87, 92, 15886, 62, 16, 28, 91, 87, 62, 16, 91, 10, 91, 87, 62, 17, 91, 3, 198, 2, 198, 2, 810, 720, 87, 62, 16, 1343, 362, 2124, 62, 17, 796, 352, 3, 198, 2, 198, 2, 220, 428, 1339, 262, 6937, 12, 27237, 4326, 12, 1894, 542, 454, 287, 262, 720, 43, 62, 16, 3, 2593, 318, 257, 15291, 12, 43358, 2427, 286, 257, 9197, 13, 3082, 1723, 262, 220, 4823, 2174, 284, 262, 938, 2523, 326, 262, 8136, 1043, 389, 1180, 13, 2269, 908, 81, 1146, 11, 428, 318, 780, 262, 1627, 21502, 912, 625, 287, 884, 257, 835, 326, 262, 28472, 803, 18620, 720, 43, 62, 17, 3, 2613, 7127, 257, 966, 286, 13875, 1387, 326, 318, 1180, 422, 262, 720, 43, 62, 16, 3, 2613, 780, 262, 720, 43, 62, 16, 3, 2613, 49100, 503, 8384, 1863, 262, 10033, 34197, 290, 318, 1342, 12824, 416, 262, 26500, 286, 262, 1627, 13, 770, 1245, 318, 881, 517, 16293, 287, 2440, 720, 45, 3, 12, 19577, 9029, 810, 720, 43, 62, 16, 3, 12, 21591, 651, 517, 1635, 2777, 522, 88, 24620, 198, 2, 198, 2, 383, 1109, 326, 262, 720, 43, 62, 16, 3, 1917, 318, 1342, 8564, 284, 262, 26500, 286, 262, 1627, 318, 8780, 1201, 326, 26500, 357, 72, 13, 68, 13, 12852, 8, 318, 45941, 13, 25120, 13, 25120, 2233, 262, 3572, 286, 45941, 13, 25120, 13, 25120, 15558, 2603, 45977, 13, 1406, 11, 329, 428, 1917, 284, 307, 880, 12, 29813, 11, 356, 761, 284, 1635, 1662, 9, 307, 12824, 416, 262, 12852, 286, 597, 1948, 3572, 286, 45941, 13, 25120, 13, 25120, 45941, 13, 6759, 8609, 290, 428, 318, 644, 13092, 428, 355, 257, 720, 43, 62, 16, 3, 10356, 1634, 3769, 13, 198, 198, 2, 685, 17, 60, 628, 198, 6738, 2603, 29487, 8019, 13, 8071, 2052, 1330, 48599, 9248, 198, 11748, 2603, 29487, 8019, 13, 8071, 2052, 198, 11748, 2603, 29487, 8019, 13, 7645, 23914, 198, 198, 81, 796, 2603, 29487, 8019, 13, 8071, 2052, 13, 40164, 34220, 14520, 19510, 15, 11, 657, 828, 604, 11, 352, 1220, 362, 11, 45941, 13, 14415, 1220, 362, 11, 17130, 28, 15, 13, 20, 8, 198, 198, 5647, 796, 458, 83, 13, 26875, 3419, 198, 897, 796, 2336, 13, 2860, 62, 7266, 29487, 7, 16243, 8, 198, 897, 13, 29487, 7, 87, 16, 11, 357, 16, 532, 2124, 16, 8, 1220, 362, 8, 198, 897, 13, 29487, 7, 15, 11, 352, 1220, 362, 11, 705, 3808, 11537, 198, 897, 13, 2860, 62, 17147, 7, 81, 8, 198, 897, 13, 25928, 3419, 198, 897, 13, 2617, 62, 87, 18242, 10786, 3, 87, 62, 16, 3, 3256, 10369, 7857, 28, 1731, 8, 198, 897, 13, 2617, 62, 2645, 9608, 10786, 3, 87, 62, 17, 3, 3256, 10369, 7857, 28, 1731, 8, 198, 897, 13, 22704, 10786, 40496, 11537, 628, 198, 2, 1675, 7301, 428, 257, 1643, 11, 1309, 338, 2074, 1262, 262, 4600, 33967, 87, 8738, 63, 5301, 357, 37906, 3326, 362, 13, 21, 973, 994, 737, 770, 460, 307, 3350, 355, 257, 14174, 8300, 1917, 355, 5679, 25, 198, 2, 198, 2, 949, 720, 15886, 59, 11018, 19881, 90, 83, 92, 15886, 62, 16, 796, 930, 83, 62, 16, 91, 1343, 930, 83, 62, 17, 91, 3, 198, 2, 198, 2, 2426, 284, 25, 198, 2, 198, 2, 720, 12, 83, 62, 16, 1279, 2124, 62, 16, 1279, 256, 62, 16, 3, 198, 2, 198, 2, 720, 12, 83, 62, 17, 1279, 2124, 62, 17, 1279, 256, 62, 17, 3, 198, 2, 198, 2, 720, 87, 62, 16, 1343, 362, 2124, 62, 17, 796, 352, 3, 198, 2, 198, 2, 720, 83, 62, 16, 1875, 657, 3, 198, 2, 198, 2, 720, 83, 62, 17, 1875, 657, 3, 198, 2, 198, 2, 810, 262, 938, 734, 17778, 389, 1541, 17142, 416, 262, 717, 734, 290, 389, 3194, 503, 655, 329, 16287, 13, 770, 460, 307, 9177, 290, 16019, 287, 4600, 33967, 87, 8738, 63, 355, 262, 1708, 25, 198, 198, 2, 685, 18, 60, 628, 198, 6738, 269, 85, 87, 8738, 1330, 17593, 355, 2603, 40914, 220, 1303, 836, 470, 625, 6525, 299, 32152, 17593, 1398, 198, 6738, 269, 85, 87, 8738, 1330, 1540, 690, 198, 198, 2, 256, 16, 11, 87, 16, 11, 83, 17, 11, 87, 17, 198, 66, 796, 2603, 40914, 26933, 16, 11, 657, 11, 352, 11, 657, 4357, 357, 19, 11, 352, 828, 705, 67, 11537, 198, 38, 796, 2603, 40914, 26933, 58, 12, 16, 11, 532, 16, 11, 657, 11, 657, 4357, 220, 1303, 5721, 12, 15, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 16, 11, 532, 16, 11, 657, 11, 657, 4357, 220, 1303, 5721, 12, 16, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 15, 11, 657, 11, 532, 16, 11, 532, 16, 4357, 220, 1303, 5721, 12, 17, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 15, 11, 657, 11, 352, 11, 532, 16, 4357, 220, 1303, 5721, 12, 18, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16589, 357, 19, 11, 604, 828, 705, 67, 11537, 198, 198, 2, 357, 19, 11, 16, 8, 318, 604, 12, 8516, 11, 16, 12, 28665, 11, 705, 67, 6, 318, 12178, 2099, 1020, 198, 71, 796, 2603, 40914, 26933, 15, 11, 657, 11, 657, 11, 657, 4357, 357, 19, 11, 352, 828, 705, 67, 11537, 198, 32, 796, 2603, 40914, 26933, 15, 11, 352, 11, 657, 11, 362, 4357, 357, 16, 11, 604, 828, 705, 67, 11537, 198, 65, 796, 2603, 40914, 26933, 16, 4357, 357, 16, 11, 352, 828, 705, 67, 11537, 198, 34453, 796, 1540, 690, 13, 34431, 7, 66, 11, 402, 11, 289, 11, 317, 11, 275, 8, 198, 87, 16, 796, 1540, 17816, 87, 6, 7131, 16, 60, 198, 87, 17, 796, 1540, 17816, 87, 6, 7131, 18, 60, 198, 4798, 10786, 87, 28, 4, 18, 13, 17, 69, 6, 4064, 2124, 16, 8, 198, 4798, 10786, 88, 28, 4, 18, 13, 17, 69, 6, 4064, 2124, 17, 8, 628, 198, 2, 22492, 17934, 12822, 31562, 45941, 13, 25120, 13, 25120, 2603, 45977, 198, 198, 2, 3914, 338, 1949, 503, 674, 2961, 1255, 546, 45941, 13, 25120, 13, 25120, 12822, 31562, 2603, 45977, 290, 766, 611, 356, 460, 31081, 281, 6439, 39280, 11018, 19881, 90, 82, 92, 3, 15879, 1262, 720, 43, 62, 16, 3, 10356, 1634, 13, 198, 198, 2, 685, 3980, 60, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 629, 541, 88, 13, 75, 1292, 70, 628, 198, 4299, 37825, 858, 62, 38, 7, 87, 2599, 198, 220, 220, 220, 705, 40406, 284, 1234, 45460, 45941, 13, 6759, 8609, 351, 938, 352, 14, 17, 286, 4847, 355, 1388, 9633, 6, 198, 220, 220, 220, 299, 796, 2124, 13, 43358, 58, 15, 60, 198, 220, 220, 220, 1441, 45941, 13, 71, 25558, 26933, 87, 58, 45299, 45941, 13, 283, 858, 7, 15, 11, 299, 11, 362, 8, 1343, 352, 4357, 2124, 58, 45299, 45941, 13, 283, 858, 7, 15, 11, 299, 11, 362, 8, 11907, 8, 628, 198, 42, 796, 362, 220, 1303, 6805, 198, 45, 69, 796, 13108, 220, 1303, 1271, 286, 8405, 198, 44, 796, 1105, 220, 1303, 1875, 509, 2604, 17, 7, 45, 69, 14, 42, 1776, 997, 286, 13871, 198, 82, 796, 45941, 13, 9107, 418, 19510, 45, 69, 11, 352, 4008, 220, 1303, 29877, 15879, 356, 765, 284, 1064, 198, 82, 58, 15, 60, 796, 352, 220, 1303, 900, 262, 509, 1729, 22570, 12784, 198, 82, 58, 16, 60, 796, 657, 13, 20, 198, 2, 45941, 13, 37659, 13, 25120, 13, 25120, 13, 28826, 7, 20, 35890, 8, 220, 1303, 900, 45941, 13, 25120, 13, 25120, 9403, 329, 8186, 66, 2247, 198, 2725, 72, 796, 45941, 13, 6759, 8609, 7, 37659, 13, 25120, 13, 25192, 77, 7, 44, 11, 399, 69, 8, 1635, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 45941, 13, 31166, 17034, 7, 16, 1220, 399, 69, 4008, 220, 1303, 45941, 13, 25120, 13, 25120, 12822, 31562, 45941, 13, 6759, 8609, 198, 88, 796, 47256, 1635, 264, 220, 1303, 13871, 198, 198, 2, 1377, 9058, 406, 16, 10356, 1634, 1917, 1377, 198, 198, 2, 4961, 871, 45941, 13, 6759, 8609, 351, 198, 38, 796, 2603, 40914, 7, 260, 3258, 858, 62, 38, 7, 1416, 541, 88, 13, 75, 1292, 70, 13, 9967, 62, 10989, 363, 7, 198, 220, 220, 220, 1635, 58, 37659, 13, 6759, 8609, 26933, 58, 12, 16, 11, 532, 16, 4357, 685, 16, 11, 532, 16, 13, 15, 11907, 828, 2361, 1635, 399, 69, 22305, 198, 2, 9432, 2163, 5752, 12, 37659, 13, 6759, 8609, 198, 66, 796, 2603, 40914, 7, 37659, 13, 71, 25558, 26933, 37659, 13, 1952, 7, 45, 69, 828, 45941, 13, 9107, 418, 7, 45, 69, 15437, 4008, 198, 2, 371, 7998, 329, 45460, 198, 71, 796, 2603, 40914, 26933, 15, 13, 15, 11, 2361, 1635, 357, 45, 69, 1635, 362, 828, 357, 45, 69, 1635, 362, 11, 352, 828, 705, 67, 11537, 198, 2, 10537, 32315, 45941, 13, 6759, 8609, 198, 32, 796, 2603, 40914, 7, 37659, 13, 71, 25558, 26933, 2725, 72, 1635, 657, 11, 47256, 60, 4008, 198, 2, 371, 7998, 329, 10537, 17778, 198, 65, 796, 2603, 40914, 7, 88, 8, 198, 198, 34453, 796, 1540, 690, 13, 34431, 7, 66, 11, 402, 11, 289, 11, 317, 11, 275, 8, 198, 198, 2, 1729, 22570, 12784, 198, 77, 2736, 796, 45941, 13, 18747, 7, 34453, 17816, 87, 20520, 737, 2704, 41769, 3419, 58, 25, 45, 69, 4083, 744, 7, 17, 737, 13159, 22570, 3419, 198, 4798, 7, 37659, 13, 18747, 7, 34453, 17816, 87, 6, 12962, 58, 77, 2736, 12962, 628, 198, 2, 1320, 3111, 503, 0, 2102, 11, 611, 345, 711, 1088, 351, 428, 1672, 1576, 351, 1180, 45941, 13, 25120, 13, 25120, 2603, 45977, 357, 403, 2617, 262, 7559, 28826, 15506, 2643, 2029, 828, 345, 481, 1064, 326, 340, 857, 407, 1635, 33770, 9, 1064, 262, 3376, 3280, 13, 770, 318, 780, 262, 19026, 546, 25056, 389, 477, 5081, 1861, 44349, 16772, 357, 72, 13, 68, 13, 366, 8929, 12, 1676, 65, 1799, 11074, 770, 318, 1194, 1688, 3580, 1022, 428, 290, 28108, 19232, 13, 198, 2, 198, 2, 3914, 338, 2207, 499, 5039, 262, 2029, 720, 43, 62, 16, 3, 10356, 1634, 2438, 523, 356, 460, 779, 340, 1568, 13, 198, 198, 2, 685, 20, 60, 628, 198, 2, 6738, 269, 10100, 9399, 1330, 10903, 9399, 198, 11748, 25064, 628, 198, 198, 2, 22492, 17934, 25, 1338, 17208, 34296, 5277, 26981, 198, 198, 2, 1081, 281, 3224, 1672, 11, 1309, 514, 2074, 220, 262, 34296, 5277, 6121, 290, 766, 611, 356, 460, 8551, 262, 29877, 34296, 5277, 6121, 422, 257, 1402, 900, 286, 13871, 13, 1114, 21654, 11, 356, 481, 7048, 326, 262, 640, 7386, 6737, 318, 1103, 543, 6338, 45941, 13, 1326, 504, 326, 262, 34296, 5277, 6121, 318, 23606, 19482, 13, 198, 198, 2, 685, 23756, 60, 628, 198, 4299, 288, 701, 6759, 8609, 7, 45, 28, 23, 2599, 198, 220, 220, 220, 705, 5589, 1133, 34062, 360, 9792, 2603, 45977, 6, 198, 220, 220, 220, 299, 796, 45941, 13, 283, 858, 7, 45, 8, 198, 220, 220, 220, 471, 796, 2603, 40914, 7, 37659, 13, 11201, 7, 16, 73, 1635, 362, 1635, 45941, 13, 14415, 1220, 399, 1635, 299, 1635, 299, 58, 45299, 6045, 60, 4008, 1220, 45941, 13, 31166, 17034, 7, 45, 8, 198, 220, 220, 220, 1441, 45941, 13, 6759, 8609, 7, 52, 8, 628, 198, 45, 69, 796, 13108, 198, 42, 796, 513, 220, 1303, 6805, 198, 44, 796, 807, 220, 1303, 1875, 509, 2604, 17, 7, 45, 69, 14, 42, 1776, 997, 286, 13871, 198, 82, 796, 45941, 13, 9107, 418, 19510, 45, 69, 11, 352, 4008, 220, 1303, 29877, 15879, 356, 765, 284, 1064, 198, 82, 58, 15, 60, 796, 352, 220, 1303, 900, 262, 509, 1729, 22570, 12784, 198, 82, 58, 16, 60, 796, 657, 13, 20, 198, 82, 58, 12, 16, 60, 796, 657, 13, 20, 220, 1303, 23606, 19482, 284, 1394, 34062, 34296, 5277, 6121, 1103, 198, 2725, 72, 796, 288, 701, 6759, 8609, 7, 45, 69, 38381, 25, 44, 11, 1058, 60, 220, 1303, 1011, 337, 12, 8516, 198, 88, 796, 47256, 1635, 264, 220, 1303, 13871, 198, 2, 423, 284, 6818, 262, 2099, 994, 319, 616, 6890, 198, 198, 34453, 796, 406, 16, 62, 1084, 7, 2725, 72, 13, 5305, 11, 331, 13, 5305, 13, 459, 2981, 7, 37659, 13, 22468, 2414, 828, 509, 8, 198, 198, 4798, 7, 37659, 13, 439, 19836, 7, 82, 13, 2704, 41769, 22784, 1540, 4008, 628, 198, 2, 685, 15187, 60, 628, 198, 489, 83, 13, 29487, 7, 34453, 8, 198, 489, 83, 13, 29487, 7, 88, 13, 5305, 8, 628, 198, 2, 22492, 35712, 28304, 1425, 774, 40921, 198, 198, 2, 39280, 2725, 72, 3, 45653, 893, 257, 471, 8577, 329, 5621, 286, 2546, 720, 42, 3, 611, 198, 2, 198, 2, 1279, 16159, 29, 198, 2, 32382, 220, 220, 220, 657, 13, 23, 3467, 31944, 90, 44, 18477, 45, 92, 8614, 69, 15886, 62, 17, 61, 17, 3467, 293, 80, 8614, 3467, 2725, 72, 277, 15886, 62, 17, 61, 17, 3467, 293, 80, 352, 13, 17, 3467, 31944, 90, 44, 18477, 45, 92, 8614, 69, 15886, 62, 17, 61, 17, 32382, 198, 2, 7359, 16159, 29, 198, 2, 198, 2, 24291, 902, 326, 15959, 428, 389, 5447, 355, 1635, 259, 1073, 8334, 24620, 11259, 326, 720, 69, 3, 318, 720, 42, 3, 12, 82, 29572, 290, 356, 3953, 198, 2, 720, 88, 28, 59, 2725, 72, 277, 47113, 788, 356, 2989, 329, 262, 599, 945, 395, 15879, 326, 6688, 262, 720, 88, 3, 13871, 290, 4145, 1064, 720, 69, 3, 355, 5679, 25, 198, 2, 198, 2, 1279, 16159, 29, 198, 2, 220, 220, 220, 220, 720, 1084, 62, 69, 220, 26867, 2, 59, 75, 46565, 256, 25, 277, 7, 83, 8, 3467, 710, 657, 3467, 81, 46565, 720, 810, 39280, 2725, 72, 277, 796, 331, 3, 198, 2, 7359, 16159, 29, 198, 2, 220, 220, 220, 220, 5740, 326, 262, 12234, 1317, 318, 262, 2546, 357, 72, 13, 68, 13, 38691, 414, 8, 286, 262, 900, 13, 770, 45941, 13, 1326, 504, 326, 356, 389, 2045, 329, 262, 1178, 395, 1981, 2173, 329, 720, 69, 3, 326, 15959, 262, 17778, 13, 220, 220, 220, 8989, 11, 428, 318, 407, 14547, 1744, 11, 523, 356, 1276, 779, 262, 39280, 11018, 11848, 90, 43, 92, 62, 16, 3, 2593, 355, 257, 15741, 329, 599, 45826, 13, 198, 2, 198, 2, 39200, 720, 69, 3, 318, 720, 42, 3, 12, 82, 29572, 290, 326, 39280, 2725, 72, 3, 45653, 893, 471, 8577, 329, 5621, 286, 2546, 720, 19, 42, 35307, 3244, 356, 3953, 720, 88, 28, 59, 2725, 72, 277, 3, 290, 788, 8494, 198, 2, 198, 2, 1279, 16159, 29, 198, 2, 220, 220, 220, 220, 720, 1084, 62, 69, 8614, 69, 15886, 62, 16, 720, 810, 39280, 2725, 72, 277, 796, 331, 3, 198, 2, 7359, 16159, 29, 198, 2, 284, 8551, 720, 69, 3, 3446, 290, 356, 460, 779, 720, 44, 1875, 509, 3467, 6404, 399, 3, 13871, 11, 810, 262, 1271, 286, 13871, 318, 6702, 4961, 284, 262, 1271, 286, 4075, 6805, 13, 220, 220, 220, 3914, 338, 2074, 257, 10017, 1672, 286, 703, 428, 2499, 13, 198, 198, 2, 44386, 17934, 25, 3409, 11347, 10884, 385, 10994, 198, 198, 2, 3423, 11, 356, 6291, 287, 262, 640, 12, 27830, 11, 1813, 326, 356, 760, 262, 6737, 318, 29877, 287, 262, 8373, 7386, 13, 198, 2, 198, 2, 1279, 16159, 29, 198, 2, 32382, 3467, 5183, 90, 69, 92, 38016, 462, 4908, 8, 796, 3467, 16345, 23330, 72, 28, 16, 92, 61, 42, 3467, 26591, 62, 72, 3467, 67, 12514, 38016, 462, 4908, 62, 72, 12, 59, 462, 4908, 8, 32382, 198, 2, 7359, 16159, 29, 198, 2, 198, 2, 543, 45941, 13, 1326, 504, 326, 340, 10874, 286, 720, 42, 3, 12, 82, 29572, 1729, 22570, 4847, 13, 8447, 11, 262, 640, 7386, 6737, 318, 198, 2, 198, 2, 1279, 16159, 29, 198, 2, 32382, 277, 7, 83, 8, 796, 220, 3467, 16345, 23330, 72, 28, 16, 92, 61, 42, 3467, 26591, 62, 72, 304, 36796, 72, 3467, 462, 4908, 62, 72, 256, 92, 32382, 198, 2, 7359, 16159, 29, 198, 2, 198, 2, 810, 262, 39280, 26591, 62, 72, 3, 290, 39280, 462, 4908, 62, 72, 3, 389, 6439, 13, 775, 765, 8494, 329, 777, 6439, 82, 416, 2263, 720, 44, 3467, 13655, 509, 3467, 6404, 399, 3, 8405, 286, 720, 69, 35307, 198, 198, 2, 383, 1917, 356, 765, 284, 8494, 318, 198, 2, 198, 2, 720, 949, 62, 70, 8614, 3467, 5183, 90, 70, 92, 8614, 23330, 43, 62, 16, 92, 3, 198, 2, 198, 2, 2426, 284, 198, 2, 198, 2, 720, 308, 7, 83, 62, 76, 47505, 69, 7, 83, 62, 76, 8, 720, 198, 2, 198, 2, 383, 6908, 994, 318, 326, 389, 41366, 287, 262, 8373, 12, 27830, 981, 262, 17778, 389, 287, 262, 640, 12, 27830, 13, 1675, 787, 1243, 4577, 11, 356, 481, 4239, 674, 3241, 284, 1103, 640, 12, 27830, 10425, 720, 69, 3, 290, 356, 481, 691, 31081, 262, 772, 12, 9630, 276, 640, 12, 82, 12629, 422, 262, 6737, 13, 770, 45941, 13, 1326, 504, 356, 761, 257, 835, 286, 220, 16621, 262, 34062, 34296, 5277, 26981, 355, 257, 45941, 13, 6759, 8609, 286, 10537, 17778, 13, 383, 13196, 286, 1103, 12, 39728, 640, 12, 27830, 10425, 15565, 262, 1708, 40686, 287, 262, 8373, 12, 27830, 25, 198, 2, 198, 2, 720, 376, 7, 74, 8, 796, 376, 7, 45, 12, 74, 8, 61, 9, 720, 198, 2, 198, 2, 810, 720, 37, 3, 318, 262, 34296, 5277, 6121, 286, 720, 69, 3, 290, 262, 18503, 1984, 43397, 3716, 11644, 1018, 341, 290, 720, 74, 59, 259, 3467, 75, 46565, 657, 11, 16, 11, 492, 45, 12, 16, 59, 81, 46565, 3, 290, 720, 45, 3, 318, 262, 34296, 5277, 26981, 4129, 13, 1675, 787, 1243, 772, 517, 14998, 540, 356, 481, 7048, 262, 640, 12, 27830, 6737, 318, 772, 11, 543, 45941, 13, 1326, 504, 1103, 12, 39728, 34296, 5277, 6121, 3815, 13, 198, 2, 198, 2, 39200, 326, 39280, 11018, 19881, 90, 52, 92, 62, 45, 3, 318, 262, 720, 45, 3, 12, 4122, 360, 9792, 12, 37659, 13, 6759, 8609, 13, 5740, 326, 356, 1464, 7048, 720, 45, 3, 318, 772, 13, 4619, 356, 389, 7219, 351, 691, 1103, 12, 39728, 10425, 11, 262, 6121, 318, 23606, 19482, 11, 523, 356, 691, 761, 2063, 286, 262, 10958, 29231, 13, 632, 4962, 503, 326, 262, 772, 12, 9630, 276, 640, 12, 27830, 8405, 460, 307, 12006, 355, 5679, 25, 198, 2, 198, 2, 720, 3467, 11018, 19881, 90, 69, 23330, 10197, 11709, 796, 3467, 11018, 19881, 90, 52, 92, 23330, 45, 14, 17, 92, 3467, 27471, 90, 9374, 79, 13, 6759, 8609, 92, 13426, 198, 2, 376, 7, 15, 47762, 37, 7, 45, 14, 17, 8, 61, 9, 3467, 6852, 59, 198, 2, 376, 7, 16, 47762, 37, 7, 45, 14, 17, 12, 16, 8, 61, 9, 3467, 6852, 59, 198, 2, 376, 7, 17, 47762, 37, 7, 45, 14, 17, 12, 17, 8, 61, 9, 3467, 6852, 59, 198, 2, 3467, 67, 1747, 3467, 6852, 59, 198, 2, 376, 7, 45, 14, 17, 12, 16, 47762, 37, 7, 16, 8, 61, 9, 198, 2, 3467, 437, 90, 9374, 79, 13, 6759, 8609, 92, 3, 198, 2, 198, 2, 775, 460, 2252, 30276, 428, 416, 7163, 428, 656, 1103, 357, 37330, 364, 6519, 720, 49, 3, 8, 220, 290, 26726, 357, 37330, 364, 6519, 720, 40, 3, 8, 3354, 290, 5291, 691, 262, 1103, 636, 198, 2, 198, 2, 32382, 59, 11018, 19881, 90, 69, 23330, 10197, 11709, 796, 3467, 11018, 19881, 90, 52, 92, 23330, 45, 14, 17, 92, 61, 49, 198, 2, 3467, 27471, 90, 9374, 79, 13, 6759, 8609, 92, 13426, 198, 2, 376, 7, 15, 8, 61, 49, 10, 37, 7, 45, 14, 17, 8, 61, 49, 3467, 6852, 59, 198, 2, 376, 7, 16, 8, 61, 49, 10, 37, 7, 45, 14, 17, 12, 16, 8, 61, 49, 3467, 6852, 59, 198, 2, 376, 7, 17, 8, 61, 49, 10, 37, 7, 45, 14, 17, 12, 17, 8, 61, 49, 3467, 6852, 59, 198, 2, 3467, 67, 1747, 3467, 6852, 59, 198, 2, 376, 7, 45, 14, 17, 12, 16, 8, 61, 49, 10, 37, 7, 16, 8, 61, 49, 198, 2, 3467, 437, 90, 9374, 79, 13, 6759, 8609, 92, 198, 2, 1343, 198, 2, 3467, 11018, 19881, 90, 52, 92, 61, 40, 62, 45, 198, 2, 3467, 27471, 90, 9374, 79, 13, 6759, 8609, 92, 3467, 6852, 59, 198, 2, 532, 37, 7, 15, 8, 61, 40, 10, 37, 7, 45, 14, 17, 8, 61, 40, 220, 3467, 6852, 59, 198, 2, 532, 37, 7, 16, 8, 61, 40, 10, 37, 7, 45, 14, 17, 12, 16, 8, 61, 40, 220, 3467, 6852, 59, 198, 2, 532, 37, 7, 17, 8, 61, 40, 10, 37, 7, 45, 14, 17, 12, 17, 8, 61, 40, 220, 3467, 6852, 59, 198, 2, 3467, 67, 1747, 3467, 6852, 59, 198, 2, 532, 37, 7, 45, 14, 17, 12, 16, 8, 61, 40, 10, 37, 7, 16, 8, 61, 40, 198, 2, 3467, 437, 90, 9374, 79, 13, 6759, 8609, 92, 13702, 198, 2, 198, 2, 887, 356, 389, 1016, 284, 2700, 477, 262, 720, 37, 7, 74, 8, 61, 40, 3, 284, 307, 6632, 287, 674, 1672, 13, 5740, 326, 262, 1218, 3381, 815, 423, 257, 39280, 11018, 19881, 90, 52, 92, 23330, 45, 14, 17, 92, 3, 287, 340, 2427, 39280, 11018, 19881, 90, 52, 92, 62, 45, 3, 475, 612, 318, 1223, 2642, 351, 262, 44575, 30751, 329, 326, 1643, 286, 1665, 55, 13, 198, 2, 198, 2, 2735, 11, 1309, 338, 766, 611, 356, 460, 2513, 832, 284, 2239, 12, 1525, 12, 9662, 284, 787, 1654, 674, 23989, 460, 1682, 670, 13, 5740, 326, 356, 836, 470, 761, 262, 1218, 3381, 319, 262, 826, 351, 262, 720, 37, 61, 40, 3, 2846, 780, 416, 674, 5103, 11, 720, 37, 3, 318, 1103, 13, 198, 198, 2, 685, 31128, 60, 628, 198, 4299, 288, 701, 6759, 8609, 7, 45, 28, 23, 2599, 198, 220, 220, 220, 705, 5589, 1133, 34062, 360, 9792, 2603, 45977, 6, 198, 220, 220, 220, 299, 796, 45941, 13, 283, 858, 7, 45, 8, 198, 220, 220, 220, 471, 796, 45941, 13, 6759, 8609, 7, 37659, 13, 11201, 7, 16, 73, 1635, 362, 1635, 45941, 13, 14415, 1220, 399, 1635, 299, 1635, 299, 58, 45299, 6045, 60, 4008, 1220, 45941, 13, 31166, 17034, 7, 45, 8, 198, 220, 220, 220, 1441, 45941, 13, 6759, 8609, 7, 52, 8, 628, 198, 4299, 1195, 62, 81, 6759, 8609, 7, 45, 69, 28, 23, 2599, 198, 220, 220, 220, 705, 320, 1154, 902, 262, 302, 34555, 11, 4375, 11, 290, 41228, 286, 262, 2603, 45977, 2029, 6, 198, 220, 220, 220, 1195, 62, 81, 796, 45941, 13, 6759, 8609, 7, 37659, 13, 71, 25558, 26933, 37659, 13, 25379, 7, 600, 7, 45, 69, 1220, 362, 36911, 45941, 13, 25379, 7, 600, 7, 45, 69, 1220, 362, 4008, 1635, 657, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1343, 45941, 13, 71, 25558, 26933, 37659, 13, 9107, 418, 19510, 600, 7, 45, 69, 1220, 362, 828, 352, 36911, 45941, 13, 2704, 24705, 81, 7, 37659, 13, 25379, 7, 600, 7, 45, 69, 1220, 362, 4008, 828, 45941, 13, 9107, 418, 19510, 600, 7, 45, 69, 1220, 362, 828, 493, 7, 45, 69, 1220, 362, 8, 532, 352, 4008, 60, 4008, 198, 220, 220, 220, 1441, 1195, 62, 81, 628, 198, 45, 69, 796, 807, 198, 37, 796, 45941, 13, 9107, 418, 19510, 45, 69, 11, 352, 4008, 220, 1303, 807, 12, 4122, 360, 9792, 198, 37, 58, 15, 60, 796, 352, 220, 1303, 6257, 12, 4354, 11, 6937, 6737, 198, 77, 796, 45941, 13, 283, 858, 7, 45, 69, 1220, 362, 8, 198, 198, 701, 796, 288, 701, 6759, 8609, 7, 45, 69, 737, 39, 1635, 376, 220, 1303, 428, 3607, 262, 6937, 6737, 198, 198, 48, 62, 81, 796, 1195, 62, 81, 6759, 8609, 7, 45, 69, 8, 198, 52, 796, 288, 701, 6759, 8609, 7, 45, 69, 1220, 362, 8, 220, 1303, 2063, 34062, 360, 9792, 45941, 13, 6759, 8609, 198, 5036, 574, 796, 471, 13, 5305, 1635, 1195, 62, 81, 1635, 376, 220, 1303, 2063, 262, 2546, 198, 4798, 7, 37659, 13, 439, 19836, 7, 5036, 574, 11, 10117, 58, 3712, 17, 60, 4008, 220, 1303, 29517, 772, 12, 35565, 8405, 628, 198, 2, 685, 30743, 60, 628, 198, 2, 1309, 338, 1949, 428, 351, 1194, 29877, 8373, 12, 27830, 6737, 198, 37, 796, 45941, 13, 9107, 418, 19510, 45, 69, 11, 352, 4008, 198, 37, 58, 16, 60, 796, 352, 198, 37, 58, 45, 69, 532, 352, 60, 796, 352, 220, 1303, 23606, 19482, 636, 198, 701, 796, 288, 701, 6759, 8609, 7, 45, 69, 737, 39, 1635, 376, 220, 1303, 428, 3607, 262, 6937, 6737, 198, 5036, 574, 796, 471, 13, 5305, 1635, 1195, 62, 81, 1635, 376, 220, 1303, 2063, 262, 2546, 198, 4798, 7, 37659, 13, 439, 19836, 7, 5036, 574, 11, 10117, 58, 3712, 17, 60, 4008, 220, 1303, 29517, 772, 12, 35565, 8405, 198, 198, 489, 83, 13, 29487, 7, 37659, 13, 283, 858, 7, 45, 69, 828, 10117, 13, 5305, 11, 45941, 13, 283, 858, 7, 45, 69, 38381, 3712, 17, 4357, 730, 574, 11, 705, 78, 11537, 198, 489, 83, 13, 87, 18242, 10786, 3, 83, 3, 3256, 10369, 7857, 28, 1828, 8, 198, 489, 83, 13, 2645, 9608, 10786, 3, 69, 7, 83, 8, 3, 3256, 10369, 7857, 28, 1828, 8, 198, 489, 83, 13, 7839, 10786, 10197, 12, 35565, 8405, 11537, 628, 198, 2, 775, 460, 779, 262, 2029, 2685, 284, 2251, 517, 8253, 1103, 10425, 13, 921, 460, 6306, 351, 262, 2685, 2174, 13, 2329, 3505, 284, 13551, 262, 40686, 4006, 0, 198, 198, 2, 685, 15277, 60, 628, 198, 45, 69, 796, 3933, 220, 1303, 1276, 307, 772, 198, 37, 796, 45941, 13, 9107, 418, 19510, 45, 69, 11, 352, 4008, 198, 198, 2, 900, 3815, 290, 11188, 40686, 3403, 198, 198, 37, 58, 22, 60, 796, 352, 198, 37, 58, 1065, 60, 796, 657, 13, 20, 198, 37, 58, 24, 60, 796, 532, 15, 13, 1495, 198, 37, 58, 45, 69, 532, 860, 60, 796, 532, 15, 13, 1495, 198, 37, 58, 45, 69, 532, 1105, 60, 796, 657, 13, 20, 198, 37, 58, 45, 69, 532, 767, 60, 796, 352, 220, 1303, 23606, 19482, 636, 198, 198, 48, 62, 81, 796, 1195, 62, 81, 6759, 8609, 7, 45, 69, 8, 198, 52, 796, 288, 701, 6759, 8609, 7, 45, 69, 1220, 362, 8, 220, 1303, 2063, 34062, 360, 9792, 45941, 13, 6759, 8609, 198, 701, 796, 288, 701, 6759, 8609, 7, 45, 69, 737, 39, 1635, 376, 220, 1303, 428, 3607, 262, 6937, 6737, 198, 5036, 574, 796, 471, 13, 5305, 1635, 1195, 62, 81, 1635, 376, 220, 1303, 2063, 262, 2546, 198, 4798, 7, 37659, 13, 439, 19836, 7, 5036, 574, 11, 10117, 58, 3712, 17, 60, 4008, 220, 1303, 29517, 772, 12, 35565, 8405, 198, 198, 489, 83, 13, 29487, 7, 37659, 13, 283, 858, 7, 45, 69, 828, 10117, 13, 5305, 11, 45941, 13, 283, 858, 7, 45, 69, 38381, 3712, 17, 4357, 730, 574, 11, 705, 78, 11537, 198, 489, 83, 13, 87, 18242, 10786, 3, 83, 3, 3256, 10369, 7857, 28, 1828, 8, 198, 489, 83, 13, 2645, 9608, 10786, 3, 69, 7, 83, 8, 3, 3256, 10369, 7857, 28, 1828, 8, 198, 489, 83, 13, 7839, 10786, 10197, 12, 35565, 8405, 11537, 628, 198, 2, 2735, 326, 356, 423, 3750, 832, 477, 326, 5876, 284, 2251, 262, 772, 12, 82, 12629, 45941, 13, 6759, 8609, 11, 356, 460, 3443, 1234, 340, 656, 262, 9355, 286, 262, 720, 43, 62, 16, 3, 10356, 1634, 1917, 25, 198, 2, 198, 2, 720, 949, 62, 37, 8614, 3467, 11018, 19881, 90, 37, 92, 8614, 23330, 43, 62, 16, 92, 3, 198, 2, 198, 2, 2426, 284, 198, 2, 198, 2, 720, 3467, 11018, 19881, 90, 52, 92, 23330, 45, 14, 17, 92, 61, 49, 3467, 11018, 19881, 90, 48, 92, 62, 81, 220, 3467, 11018, 19881, 90, 37, 92, 28, 3467, 11018, 19881, 90, 69, 92, 720, 198, 198, 2, 685, 35195, 60, 628, 198, 4299, 37825, 858, 62, 38, 7, 87, 2599, 198, 220, 220, 220, 705, 40406, 284, 1234, 45460, 45941, 13, 6759, 8609, 351, 717, 352, 14, 17, 286, 4847, 355, 1388, 9633, 6, 198, 220, 220, 220, 299, 796, 2124, 13, 43358, 58, 15, 60, 198, 220, 220, 220, 1441, 45941, 13, 71, 25558, 26933, 87, 58, 45299, 45941, 13, 283, 858, 7, 15, 11, 299, 11, 362, 8, 1343, 352, 4357, 2124, 58, 45299, 45941, 13, 283, 858, 7, 15, 11, 299, 11, 362, 8, 11907, 8, 628, 198, 42, 796, 362, 220, 1303, 6805, 198, 45, 69, 796, 13108, 220, 1303, 1271, 286, 8405, 198, 44, 796, 1248, 220, 1303, 1875, 509, 2604, 7, 45, 1776, 997, 286, 13871, 198, 198, 2, 9058, 6737, 360, 9792, 355, 376, 198, 37, 796, 45941, 13, 9107, 418, 19510, 45, 69, 11, 352, 4008, 198, 37, 58, 16, 60, 796, 352, 198, 37, 58, 17, 60, 796, 657, 13, 20, 198, 37, 58, 45, 69, 532, 352, 60, 796, 352, 220, 1303, 23606, 19482, 3354, 198, 37, 58, 45, 69, 532, 362, 60, 796, 657, 13, 20, 198, 31387, 796, 288, 701, 6759, 8609, 7, 45, 69, 737, 39, 1635, 376, 220, 1303, 428, 3607, 262, 640, 12, 27830, 6737, 198, 31387, 796, 277, 2435, 13, 5305, 220, 1303, 340, 338, 1103, 6949, 198, 2435, 62, 82, 12629, 796, 685, 15, 11, 362, 11, 604, 11, 1105, 11, 1478, 11, 1467, 11, 1248, 11, 1987, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4974, 11, 4570, 11, 4353, 11, 2319, 11, 5846, 11, 6337, 11, 6740, 11, 7265, 11, 7175, 11, 8190, 60, 198, 13959, 62, 9630, 276, 62, 2435, 62, 82, 12629, 796, 357, 37659, 13, 18747, 7, 2435, 62, 82, 12629, 8, 1220, 362, 737, 459, 2981, 7, 600, 8, 198, 2725, 72, 796, 288, 701, 6759, 8609, 7, 45, 69, 1220, 362, 737, 5305, 1635, 1195, 62, 81, 6759, 8609, 7, 45, 69, 8, 198, 2725, 72, 62, 72, 796, 47256, 58, 13959, 62, 9630, 276, 62, 2435, 62, 82, 12629, 11, 1058, 60, 198, 198, 2, 4961, 871, 45941, 13, 6759, 8609, 351, 198, 38, 796, 2603, 40914, 7, 260, 3258, 858, 62, 38, 7, 1416, 541, 88, 13, 75, 1292, 70, 13, 9967, 62, 10989, 363, 7, 198, 220, 220, 220, 1635, 58, 37659, 13, 6759, 8609, 26933, 58, 12, 16, 11, 532, 16, 4357, 685, 16, 11, 532, 16, 13, 15, 11907, 828, 2361, 1635, 399, 69, 22305, 198, 2, 9432, 2163, 5752, 12, 37659, 13, 6759, 8609, 198, 66, 796, 2603, 40914, 7, 37659, 13, 71, 25558, 26933, 37659, 13, 9107, 418, 7, 45, 69, 828, 45941, 13, 1952, 7, 45, 69, 15437, 4008, 198, 2, 371, 7998, 329, 45460, 198, 71, 796, 2603, 40914, 26933, 15, 13, 15, 11, 2361, 1635, 357, 45, 69, 1635, 362, 828, 357, 45, 69, 1635, 362, 11, 352, 828, 705, 67, 11537, 198, 2, 10537, 32315, 45941, 13, 6759, 8609, 198, 32, 796, 2603, 40914, 7, 37659, 13, 71, 25558, 26933, 2725, 72, 62, 72, 11, 47256, 62, 72, 1635, 657, 60, 4008, 198, 2, 371, 7998, 329, 10537, 17778, 198, 65, 796, 2603, 40914, 7, 31387, 58, 2435, 62, 82, 12629, 12962, 198, 198, 34453, 796, 1540, 690, 13, 34431, 7, 66, 11, 402, 11, 289, 11, 317, 11, 275, 8, 628, 198, 2, 685, 1065, 60, 628, 198, 11748, 340, 861, 10141, 355, 340, 628, 198, 4299, 288, 701, 6759, 8609, 7, 45, 28, 23, 2599, 198, 220, 220, 220, 705, 5589, 1133, 34062, 360, 9792, 2603, 45977, 6, 198, 220, 220, 220, 299, 796, 45941, 13, 283, 858, 7, 45, 8, 198, 220, 220, 220, 471, 796, 45941, 13, 6759, 8609, 7, 37659, 13, 11201, 7, 16, 73, 1635, 362, 1635, 45941, 13, 14415, 1220, 399, 1635, 299, 1635, 299, 58, 45299, 6045, 60, 4008, 1220, 45941, 13, 31166, 17034, 7, 45, 8, 198, 220, 220, 220, 1441, 45941, 13, 6759, 8609, 7, 52, 8, 628, 198, 44, 796, 513, 198, 198, 2, 45941, 13, 37659, 13, 25120, 13, 25120, 13, 28826, 7, 20, 35890, 8, 220, 1303, 900, 45941, 13, 25120, 13, 25120, 9403, 329, 8186, 66, 2247, 198, 12016, 72, 796, 288, 701, 6759, 8609, 7, 12762, 8, 198, 2725, 72, 796, 45941, 13, 25120, 13, 25192, 77, 7, 44, 11, 13108, 8, 198, 82, 796, 45941, 13, 9107, 418, 19510, 12762, 11, 352, 4008, 198, 82, 58, 15, 60, 796, 352, 198, 82, 58, 940, 60, 796, 352, 198, 198, 464, 8326, 796, 47256, 1635, 350, 13396, 198, 88, 796, 383, 8326, 1635, 264, 198, 198, 1640, 1312, 287, 340, 13, 24011, 7352, 7, 9521, 7, 12762, 828, 362, 2599, 198, 220, 220, 220, 264, 7364, 796, 45941, 13, 9107, 418, 19510, 12762, 11, 352, 4008, 198, 220, 220, 220, 264, 7364, 58, 37659, 13, 18747, 7, 72, 15437, 796, 352, 198, 220, 220, 220, 611, 45941, 13, 439, 19836, 7, 464, 8326, 1635, 264, 7364, 11, 331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 17772, 25, 198, 220, 220, 220, 3601, 10786, 3919, 4610, 11537, 628, 198, 2, 685, 24, 60, 628, 198, 2, 685, 2361, 198 ]
2.698952
8,012
# ============================================================================= # # Explicit Finite Difference Method Code to Solve the 1D Linear Transport Equation # Adapted by: Cameron Armstrong (2019) # Source: Lorena Barba, 12 Steps to NS in Python # Institution: Virginia Commonwealth University # # ============================================================================= # Required Modules import numpy as np from matplotlib import pyplot as plt import time xl = 2 # x length nx = 600 # number of grid points x = np.linspace(0,xl,nx) # x grid dx = xl/(nx-1) # x stepsize nt = 350 # number of timesteps dt = 0.0025 # time stepsize c = 1 # wave speed g = .01 # gaussian variance parameter (peak width) theta = x/(0.5*xl) # gaussian mean parameter (peak position) cfl = round(c*dt/dx,2) # cfl condition 2 decimal places # Fun little CFL condition check and print report if cfl >= 1: print('Hold your horses! The CFL is %s, which is over 1' %(cfl)) else: print('CFL = %s' %(cfl)) # Array Initialization u = np.ones(nx) # initializing solution array un = np.ones(nx) # initializing temporary solution array u = (1/(2*np.sqrt(np.pi*(g))))*np.exp(-(1-theta)**2/(4*g)) # initial condition (IC) as a gaussian ui = u.copy() plt.plot(x,u); # plots IC # BDS/Upwind with inner for-loop with example on process timing start = time.process_time() for n in range(nt): un = u.copy() for i in range(1,nx-1): u[i] = un[i] - c*dt/(dx)*(un[i]-un[i-1]) # periodic BC's u[0] = u[nx-2] u[nx-1] = u[1] end = time.process_time() print(end-start) # # BDS/Upwind with vectorization # for n in range(nt): # un = u.copy() # u[1:-1] = un[1:-1] - c*dt/(dx)*(un[1:-1]-un[:-2]) # # periodic BC's # u[0] = u[nx-2] # u[nx-1] = u[1] # # CDS with inner for-loop #for n in range(nt): # un = u.copy() # for i in range(1,nx-1): # u[i] = un[i] - c*dt/(2*dx)*(un[i+1]-un[i-1]) # # periodic BC's # u[0] = u[nx-2] # u[nx-1] = u[1] # # CDS with vectorization #for n in range(nt): # un = u.copy() # u[1:-1] = un[1:-1] - c*dt/(2*dx)*(un[2:]-un[:-2]) # # periodic BC's # u[0] = u[nx-2] # u[nx-1] = u[1] plt.plot(x,u);
[ 2, 38093, 25609, 201, 198, 2, 220, 201, 198, 2, 11884, 4463, 578, 43795, 11789, 6127, 284, 4294, 303, 262, 352, 35, 44800, 19940, 7889, 341, 201, 198, 2, 30019, 276, 416, 25, 10821, 21166, 357, 23344, 8, 201, 198, 2, 8090, 25, 15639, 2616, 2409, 7012, 11, 1105, 32144, 284, 10896, 287, 11361, 201, 198, 2, 29426, 25, 6025, 17165, 2059, 201, 198, 2, 220, 201, 198, 2, 38093, 25609, 201, 198, 201, 198, 2, 20906, 3401, 5028, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 6738, 2603, 29487, 8019, 1330, 12972, 29487, 355, 458, 83, 201, 198, 11748, 640, 201, 198, 201, 198, 87, 75, 796, 362, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2124, 4129, 201, 198, 77, 87, 796, 10053, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1271, 286, 10706, 2173, 201, 198, 87, 796, 45941, 13, 21602, 10223, 7, 15, 11, 87, 75, 11, 77, 87, 8, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2124, 10706, 220, 201, 198, 34350, 796, 2124, 75, 29006, 77, 87, 12, 16, 8, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2124, 4831, 1096, 201, 198, 429, 796, 13803, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1271, 286, 4628, 395, 25386, 201, 198, 28664, 796, 657, 13, 405, 1495, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 640, 4831, 1096, 201, 198, 66, 796, 352, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 6769, 2866, 201, 198, 70, 796, 764, 486, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 31986, 31562, 24198, 11507, 357, 36729, 9647, 8, 201, 198, 1169, 8326, 796, 2124, 29006, 15, 13, 20, 9, 87, 75, 8, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 31986, 31562, 1612, 11507, 357, 36729, 2292, 8, 201, 198, 66, 2704, 796, 2835, 7, 66, 9, 28664, 14, 34350, 11, 17, 8, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 269, 2704, 4006, 362, 32465, 4113, 201, 198, 201, 198, 2, 11138, 1310, 45239, 4006, 2198, 290, 3601, 989, 201, 198, 361, 269, 2704, 18189, 352, 25, 201, 198, 220, 220, 220, 3601, 10786, 26807, 534, 14260, 0, 383, 45239, 318, 4064, 82, 11, 543, 318, 625, 352, 6, 4064, 7, 66, 2704, 4008, 201, 198, 17772, 25, 201, 198, 220, 220, 220, 3601, 10786, 34, 3697, 796, 4064, 82, 6, 4064, 7, 66, 2704, 4008, 201, 198, 201, 198, 2, 15690, 20768, 1634, 201, 198, 84, 796, 45941, 13, 1952, 7, 77, 87, 8, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4238, 2890, 4610, 7177, 201, 198, 403, 796, 45941, 13, 1952, 7, 77, 87, 8, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4238, 2890, 8584, 4610, 7177, 201, 198, 84, 796, 357, 16, 29006, 17, 9, 37659, 13, 31166, 17034, 7, 37659, 13, 14415, 9, 7, 70, 35514, 9, 37659, 13, 11201, 7, 30420, 16, 12, 1169, 8326, 8, 1174, 17, 29006, 19, 9, 70, 4008, 1303, 4238, 4006, 357, 2149, 8, 355, 257, 31986, 31562, 201, 198, 9019, 796, 334, 13, 30073, 3419, 201, 198, 489, 83, 13, 29487, 7, 87, 11, 84, 1776, 1303, 21528, 12460, 201, 198, 201, 198, 2, 33741, 14, 4933, 7972, 351, 8434, 329, 12, 26268, 351, 1672, 319, 1429, 10576, 201, 198, 9688, 796, 640, 13, 14681, 62, 2435, 3419, 201, 198, 1640, 299, 287, 2837, 7, 429, 2599, 201, 198, 220, 220, 220, 555, 796, 334, 13, 30073, 3419, 201, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 16, 11, 77, 87, 12, 16, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 334, 58, 72, 60, 796, 555, 58, 72, 60, 532, 269, 9, 28664, 29006, 34350, 27493, 7, 403, 58, 72, 45297, 403, 58, 72, 12, 16, 12962, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 27458, 11843, 338, 201, 198, 220, 220, 220, 220, 220, 220, 220, 334, 58, 15, 60, 796, 334, 58, 77, 87, 12, 17, 60, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 334, 58, 77, 87, 12, 16, 60, 796, 334, 58, 16, 60, 201, 198, 201, 198, 437, 796, 640, 13, 14681, 62, 2435, 3419, 201, 198, 4798, 7, 437, 12, 9688, 8, 201, 198, 201, 198, 2, 1303, 33741, 14, 4933, 7972, 351, 15879, 1634, 201, 198, 2, 329, 299, 287, 2837, 7, 429, 2599, 201, 198, 2, 220, 220, 220, 220, 555, 796, 334, 13, 30073, 3419, 201, 198, 2, 220, 220, 220, 220, 334, 58, 16, 21912, 16, 60, 796, 555, 58, 16, 21912, 16, 60, 532, 269, 9, 28664, 29006, 34350, 27493, 7, 403, 58, 16, 21912, 16, 45297, 403, 58, 21912, 17, 12962, 201, 198, 2, 220, 220, 220, 220, 1303, 27458, 11843, 338, 201, 198, 2, 220, 220, 220, 220, 334, 58, 15, 60, 796, 334, 58, 77, 87, 12, 17, 60, 201, 198, 2, 220, 220, 220, 220, 334, 58, 77, 87, 12, 16, 60, 796, 334, 58, 16, 60, 201, 198, 201, 198, 2, 1303, 327, 5258, 351, 8434, 329, 12, 26268, 201, 198, 2, 1640, 299, 287, 2837, 7, 429, 2599, 201, 198, 2, 220, 220, 220, 555, 796, 334, 13, 30073, 3419, 201, 198, 2, 220, 220, 220, 329, 1312, 287, 2837, 7, 16, 11, 77, 87, 12, 16, 2599, 201, 198, 2, 220, 220, 220, 220, 220, 220, 220, 334, 58, 72, 60, 796, 555, 58, 72, 60, 532, 269, 9, 28664, 29006, 17, 9, 34350, 27493, 7, 403, 58, 72, 10, 16, 45297, 403, 58, 72, 12, 16, 12962, 201, 198, 2, 220, 220, 220, 220, 220, 220, 220, 1303, 27458, 11843, 338, 201, 198, 2, 220, 220, 220, 220, 220, 220, 220, 334, 58, 15, 60, 796, 334, 58, 77, 87, 12, 17, 60, 201, 198, 2, 220, 220, 220, 220, 220, 220, 220, 334, 58, 77, 87, 12, 16, 60, 796, 334, 58, 16, 60, 201, 198, 201, 198, 2, 1303, 327, 5258, 351, 15879, 1634, 201, 198, 2, 1640, 299, 287, 2837, 7, 429, 2599, 201, 198, 2, 220, 220, 220, 555, 796, 334, 13, 30073, 3419, 201, 198, 2, 220, 220, 220, 334, 58, 16, 21912, 16, 60, 796, 555, 58, 16, 21912, 16, 60, 532, 269, 9, 28664, 29006, 17, 9, 34350, 27493, 7, 403, 58, 17, 25, 45297, 403, 58, 21912, 17, 12962, 201, 198, 2, 220, 220, 220, 1303, 27458, 11843, 338, 201, 198, 2, 220, 220, 220, 334, 58, 15, 60, 796, 334, 58, 77, 87, 12, 17, 60, 201, 198, 2, 220, 220, 220, 334, 58, 77, 87, 12, 16, 60, 796, 334, 58, 16, 60, 201, 198, 201, 198, 489, 83, 13, 29487, 7, 87, 11, 84, 1776, 220, 201, 198, 201, 198, 201, 198 ]
1.913545
1,388
import re from functools import partial from typing import Callable, Container, Iterable, List, Union from bs4 import BeautifulSoup from bs4.element import NavigableString, PageElement, SoupStrainer, Tag from monty.log import get_logger from . import MAX_SIGNATURE_AMOUNT log = get_logger(__name__) _UNWANTED_SIGNATURE_SYMBOLS_RE = re.compile(r"\[source]|\\\\|¶") _SEARCH_END_TAG_ATTRS = ( "data", "function", "class", "exception", "seealso", "section", "rubric", "sphinxsidebar", ) class Strainer(SoupStrainer): """Subclass of SoupStrainer to allow matching of both `Tag`s and `NavigableString`s.""" Markup = Union[PageElement, List["Markup"]] def search(self, markup: Markup) -> Union[PageElement, str]: """Extend default SoupStrainer behaviour to allow matching both `Tag`s` and `NavigableString`s.""" if isinstance(markup, str): # Let everything through the text filter if we're including strings and tags. if not self.name and not self.attrs and self.include_strings: return markup else: return super().search(markup) def _find_elements_until_tag( start_element: PageElement, end_tag_filter: Union[Container[str], Callable[[Tag], bool]], *, func: Callable, include_strings: bool = False, limit: int = None, ) -> List[Union[Tag, NavigableString]]: """ Get all elements up to `limit` or until a tag matching `end_tag_filter` is found. `end_tag_filter` can be either a container of string names to check against, or a filtering callable that's applied to tags. When `include_strings` is True, `NavigableString`s from the document will be included in the result along `Tag`s. `func` takes in a BeautifulSoup unbound method for finding multiple elements, such as `BeautifulSoup.find_all`. The method is then iterated over and all elements until the matching tag or the limit are added to the return list. """ use_container_filter = not callable(end_tag_filter) elements = [] for element in func(start_element, name=Strainer(include_strings=include_strings), limit=limit): if isinstance(element, Tag): if use_container_filter: if element.name in end_tag_filter: break elif end_tag_filter(element): break elements.append(element) return elements _find_next_children_until_tag = partial(_find_elements_until_tag, func=partial(BeautifulSoup.find_all, recursive=False)) _find_recursive_children_until_tag = partial(_find_elements_until_tag, func=BeautifulSoup.find_all) _find_next_siblings_until_tag = partial(_find_elements_until_tag, func=BeautifulSoup.find_next_siblings) _find_previous_siblings_until_tag = partial(_find_elements_until_tag, func=BeautifulSoup.find_previous_siblings) def _class_filter_factory(class_names: Iterable[str]) -> Callable[[Tag], bool]: """Create callable that returns True when the passed in tag's class is in `class_names` or when it's a table.""" return match_tag def get_general_description(start_element: PageElement) -> List[Union[Tag, NavigableString]]: """ Get page content to a table or a tag with its class in `SEARCH_END_TAG_ATTRS`. A headerlink tag is attempted to be found to skip repeating the symbol information in the description. If it's found it's used as the tag to start the search from instead of the `start_element`. """ child_tags = _find_recursive_children_until_tag(start_element, _class_filter_factory(["section"]), limit=100) header = next(filter(_class_filter_factory(["headerlink"]), child_tags), None) start_tag = header.parent if header is not None else start_element return _find_next_siblings_until_tag(start_tag, _class_filter_factory(_SEARCH_END_TAG_ATTRS), include_strings=True) def get_dd_description(symbol: PageElement) -> List[Union[Tag, NavigableString]]: """Get the contents of the next dd tag, up to a dt or a dl tag.""" description_tag = symbol.find_next("dd") return _find_next_children_until_tag(description_tag, ("dt", "dl"), include_strings=True) def get_signatures(start_signature: PageElement) -> List[str]: """ Collect up to `_MAX_SIGNATURE_AMOUNT` signatures from dt tags around the `start_signature` dt tag. First the signatures under the `start_signature` are included; if less than 2 are found, tags above the start signature are added to the result if any are present. """ signatures = [] for element in ( *reversed(_find_previous_siblings_until_tag(start_signature, ("dd",), limit=2)), start_signature, *_find_next_siblings_until_tag(start_signature, ("dd",), limit=2), )[-MAX_SIGNATURE_AMOUNT:]: signature = _UNWANTED_SIGNATURE_SYMBOLS_RE.sub("", element.text) if signature: signatures.append(signature) return signatures
[ 11748, 302, 198, 6738, 1257, 310, 10141, 1330, 13027, 198, 6738, 19720, 1330, 4889, 540, 11, 43101, 11, 40806, 540, 11, 7343, 11, 4479, 198, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 6738, 275, 82, 19, 13, 30854, 1330, 13244, 328, 540, 10100, 11, 7873, 20180, 11, 34011, 1273, 3201, 263, 11, 17467, 198, 198, 6738, 40689, 88, 13, 6404, 1330, 651, 62, 6404, 1362, 198, 198, 6738, 764, 1330, 25882, 62, 46224, 40086, 62, 2390, 28270, 628, 198, 6404, 796, 651, 62, 6404, 1362, 7, 834, 3672, 834, 8, 198, 198, 62, 4944, 54, 8643, 1961, 62, 46224, 40086, 62, 23060, 10744, 3535, 50, 62, 2200, 796, 302, 13, 5589, 576, 7, 81, 1, 59, 58, 10459, 60, 91, 13426, 91, 26604, 4943, 198, 62, 5188, 31315, 62, 10619, 62, 42197, 62, 1404, 5446, 50, 796, 357, 198, 220, 220, 220, 366, 7890, 1600, 198, 220, 220, 220, 366, 8818, 1600, 198, 220, 220, 220, 366, 4871, 1600, 198, 220, 220, 220, 366, 1069, 4516, 1600, 198, 220, 220, 220, 366, 325, 2287, 568, 1600, 198, 220, 220, 220, 366, 5458, 1600, 198, 220, 220, 220, 366, 25089, 1173, 1600, 198, 220, 220, 220, 366, 82, 746, 28413, 1589, 5657, 1600, 198, 8, 628, 198, 4871, 520, 3201, 263, 7, 50, 10486, 1273, 3201, 263, 2599, 198, 220, 220, 220, 37227, 7004, 4871, 286, 34011, 1273, 3201, 263, 284, 1249, 12336, 286, 1111, 4600, 24835, 63, 82, 290, 4600, 30575, 328, 540, 10100, 63, 82, 526, 15931, 628, 220, 220, 220, 2940, 929, 796, 4479, 58, 9876, 20180, 11, 7343, 14692, 9704, 929, 8973, 60, 628, 220, 220, 220, 825, 2989, 7, 944, 11, 41485, 25, 2940, 929, 8, 4613, 4479, 58, 9876, 20180, 11, 965, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 11627, 437, 4277, 34011, 1273, 3201, 263, 9172, 284, 1249, 12336, 1111, 4600, 24835, 63, 82, 63, 290, 4600, 30575, 328, 540, 10100, 63, 82, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 4102, 929, 11, 965, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 3914, 2279, 832, 262, 2420, 8106, 611, 356, 821, 1390, 13042, 290, 15940, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 407, 2116, 13, 3672, 290, 407, 2116, 13, 1078, 3808, 290, 2116, 13, 17256, 62, 37336, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 41485, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 2208, 22446, 12947, 7, 4102, 929, 8, 628, 198, 4299, 4808, 19796, 62, 68, 3639, 62, 28446, 62, 12985, 7, 198, 220, 220, 220, 923, 62, 30854, 25, 7873, 20180, 11, 198, 220, 220, 220, 886, 62, 12985, 62, 24455, 25, 4479, 58, 29869, 58, 2536, 4357, 4889, 540, 30109, 24835, 4357, 20512, 60, 4357, 198, 220, 220, 220, 1635, 11, 198, 220, 220, 220, 25439, 25, 4889, 540, 11, 198, 220, 220, 220, 2291, 62, 37336, 25, 20512, 796, 10352, 11, 198, 220, 220, 220, 4179, 25, 493, 796, 6045, 11, 198, 8, 4613, 7343, 58, 38176, 58, 24835, 11, 13244, 328, 540, 10100, 60, 5974, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3497, 477, 4847, 510, 284, 4600, 32374, 63, 393, 1566, 257, 7621, 12336, 4600, 437, 62, 12985, 62, 24455, 63, 318, 1043, 13, 628, 220, 220, 220, 4600, 437, 62, 12985, 62, 24455, 63, 460, 307, 2035, 257, 9290, 286, 4731, 3891, 284, 2198, 1028, 11, 198, 220, 220, 220, 393, 257, 25431, 869, 540, 326, 338, 5625, 284, 15940, 13, 628, 220, 220, 220, 1649, 4600, 17256, 62, 37336, 63, 318, 6407, 11, 4600, 30575, 328, 540, 10100, 63, 82, 422, 262, 3188, 481, 307, 3017, 287, 262, 1255, 1863, 4600, 24835, 63, 82, 13, 628, 220, 220, 220, 4600, 20786, 63, 2753, 287, 257, 23762, 50, 10486, 555, 7784, 2446, 329, 4917, 3294, 4847, 11, 884, 355, 4600, 38413, 4135, 50, 10486, 13, 19796, 62, 439, 44646, 198, 220, 220, 220, 383, 2446, 318, 788, 11629, 515, 625, 290, 477, 4847, 1566, 262, 12336, 7621, 393, 262, 4179, 389, 2087, 284, 262, 1441, 1351, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 779, 62, 34924, 62, 24455, 796, 407, 869, 540, 7, 437, 62, 12985, 62, 24455, 8, 198, 220, 220, 220, 4847, 796, 17635, 628, 220, 220, 220, 329, 5002, 287, 25439, 7, 9688, 62, 30854, 11, 1438, 28, 1273, 3201, 263, 7, 17256, 62, 37336, 28, 17256, 62, 37336, 828, 4179, 28, 32374, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 30854, 11, 17467, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 779, 62, 34924, 62, 24455, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5002, 13, 3672, 287, 886, 62, 12985, 62, 24455, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 886, 62, 12985, 62, 24455, 7, 30854, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 4847, 13, 33295, 7, 30854, 8, 628, 220, 220, 220, 1441, 4847, 628, 198, 62, 19796, 62, 19545, 62, 17197, 62, 28446, 62, 12985, 796, 13027, 28264, 19796, 62, 68, 3639, 62, 28446, 62, 12985, 11, 25439, 28, 47172, 7, 38413, 4135, 50, 10486, 13, 19796, 62, 439, 11, 45115, 28, 25101, 4008, 198, 62, 19796, 62, 8344, 30753, 62, 17197, 62, 28446, 62, 12985, 796, 13027, 28264, 19796, 62, 68, 3639, 62, 28446, 62, 12985, 11, 25439, 28, 38413, 4135, 50, 10486, 13, 19796, 62, 439, 8, 198, 62, 19796, 62, 19545, 62, 82, 19389, 62, 28446, 62, 12985, 796, 13027, 28264, 19796, 62, 68, 3639, 62, 28446, 62, 12985, 11, 25439, 28, 38413, 4135, 50, 10486, 13, 19796, 62, 19545, 62, 82, 19389, 8, 198, 62, 19796, 62, 3866, 1442, 62, 82, 19389, 62, 28446, 62, 12985, 796, 13027, 28264, 19796, 62, 68, 3639, 62, 28446, 62, 12985, 11, 25439, 28, 38413, 4135, 50, 10486, 13, 19796, 62, 3866, 1442, 62, 82, 19389, 8, 628, 198, 4299, 4808, 4871, 62, 24455, 62, 69, 9548, 7, 4871, 62, 14933, 25, 40806, 540, 58, 2536, 12962, 4613, 4889, 540, 30109, 24835, 4357, 20512, 5974, 198, 220, 220, 220, 37227, 16447, 869, 540, 326, 5860, 6407, 618, 262, 3804, 287, 7621, 338, 1398, 318, 287, 4600, 4871, 62, 14933, 63, 393, 618, 340, 338, 257, 3084, 526, 15931, 628, 220, 220, 220, 1441, 2872, 62, 12985, 628, 198, 4299, 651, 62, 24622, 62, 11213, 7, 9688, 62, 30854, 25, 7873, 20180, 8, 4613, 7343, 58, 38176, 58, 24835, 11, 13244, 328, 540, 10100, 60, 5974, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3497, 2443, 2695, 284, 257, 3084, 393, 257, 7621, 351, 663, 1398, 287, 4600, 5188, 31315, 62, 10619, 62, 42197, 62, 1404, 5446, 50, 44646, 628, 220, 220, 220, 317, 13639, 8726, 7621, 318, 7482, 284, 307, 1043, 284, 14267, 20394, 262, 6194, 1321, 287, 262, 6764, 13, 198, 220, 220, 220, 1002, 340, 338, 1043, 340, 338, 973, 355, 262, 7621, 284, 923, 262, 2989, 422, 2427, 286, 262, 4600, 9688, 62, 30854, 44646, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1200, 62, 31499, 796, 4808, 19796, 62, 8344, 30753, 62, 17197, 62, 28446, 62, 12985, 7, 9688, 62, 30854, 11, 4808, 4871, 62, 24455, 62, 69, 9548, 7, 14692, 5458, 8973, 828, 4179, 28, 3064, 8, 198, 220, 220, 220, 13639, 796, 1306, 7, 24455, 28264, 4871, 62, 24455, 62, 69, 9548, 7, 14692, 25677, 8726, 8973, 828, 1200, 62, 31499, 828, 6045, 8, 198, 220, 220, 220, 923, 62, 12985, 796, 13639, 13, 8000, 611, 13639, 318, 407, 6045, 2073, 923, 62, 30854, 198, 220, 220, 220, 1441, 4808, 19796, 62, 19545, 62, 82, 19389, 62, 28446, 62, 12985, 7, 9688, 62, 12985, 11, 4808, 4871, 62, 24455, 62, 69, 9548, 28264, 5188, 31315, 62, 10619, 62, 42197, 62, 1404, 5446, 50, 828, 2291, 62, 37336, 28, 17821, 8, 628, 198, 4299, 651, 62, 1860, 62, 11213, 7, 1837, 23650, 25, 7873, 20180, 8, 4613, 7343, 58, 38176, 58, 24835, 11, 13244, 328, 540, 10100, 60, 5974, 198, 220, 220, 220, 37227, 3855, 262, 10154, 286, 262, 1306, 49427, 7621, 11, 510, 284, 257, 288, 83, 393, 257, 288, 75, 7621, 526, 15931, 198, 220, 220, 220, 6764, 62, 12985, 796, 6194, 13, 19796, 62, 19545, 7203, 1860, 4943, 198, 220, 220, 220, 1441, 4808, 19796, 62, 19545, 62, 17197, 62, 28446, 62, 12985, 7, 11213, 62, 12985, 11, 5855, 28664, 1600, 366, 25404, 12340, 2291, 62, 37336, 28, 17821, 8, 628, 198, 4299, 651, 62, 12683, 6691, 7, 9688, 62, 12683, 1300, 25, 7873, 20180, 8, 4613, 7343, 58, 2536, 5974, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 9745, 510, 284, 4600, 62, 22921, 62, 46224, 40086, 62, 2390, 28270, 63, 17239, 422, 288, 83, 15940, 1088, 262, 4600, 9688, 62, 12683, 1300, 63, 288, 83, 7621, 13, 628, 220, 220, 220, 3274, 262, 17239, 739, 262, 4600, 9688, 62, 12683, 1300, 63, 389, 3017, 26, 198, 220, 220, 220, 611, 1342, 621, 362, 389, 1043, 11, 15940, 2029, 262, 923, 9877, 389, 2087, 284, 262, 1255, 611, 597, 389, 1944, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 17239, 796, 17635, 198, 220, 220, 220, 329, 5002, 287, 357, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 260, 690, 276, 28264, 19796, 62, 3866, 1442, 62, 82, 19389, 62, 28446, 62, 12985, 7, 9688, 62, 12683, 1300, 11, 5855, 1860, 1600, 828, 4179, 28, 17, 36911, 198, 220, 220, 220, 220, 220, 220, 220, 923, 62, 12683, 1300, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 62, 19796, 62, 19545, 62, 82, 19389, 62, 28446, 62, 12985, 7, 9688, 62, 12683, 1300, 11, 5855, 1860, 1600, 828, 4179, 28, 17, 828, 198, 220, 220, 220, 1267, 58, 12, 22921, 62, 46224, 40086, 62, 2390, 28270, 25, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 9877, 796, 4808, 4944, 54, 8643, 1961, 62, 46224, 40086, 62, 23060, 10744, 3535, 50, 62, 2200, 13, 7266, 7203, 1600, 5002, 13, 5239, 8, 628, 220, 220, 220, 220, 220, 220, 220, 611, 9877, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17239, 13, 33295, 7, 12683, 1300, 8, 628, 220, 220, 220, 1441, 17239, 198 ]
2.771205
1,792
""" This module describes procedures to sample preferences for different probability distributions. """ import numpy as np def generateICStrictProfile(nbVoters, alternatives): """ Generates a profile following the impartial culture. :param nbVoters: Number of orders to sample. :type nbVoters: int :param alternatives: List of alternatives. :type alternatives: list of int :return: A vote map, i.e., a dictionary whose keys are orders, mapping to the number of voters with the given order as their preferences. :rtype: dict """ return urnModel(nbVoters, 0, alternatives) def generateICAnonymousStrictProfile(nbVoters, alternatives): """ Generates a profile following the anonymous impartial culture. :param nbVoters: Number of orders to sample. :type nbVoters: int :param alternatives: List of alternatives. :type alternatives: list of int :return: A vote map, i.e., a dictionary whose keys are orders, mapping to the number of voters with the given order as their preferences. :rtype: dict """ return urnModel(nbVoters, 1, alternatives) def mallowsModel(nbVoters, nbAlternatives, mixture, dispersions, references): """ Generates a profile following a mixture of Mallow's models. :param nbVoters: Number of orders to sample. :type nbVoters: int :param nbAlternatives: Number of alternatives for the sampled orders. :type nbAlternatives: int :param mixture: A list of the weights of each element of the mixture. :type replace: list of int :param dispersions: A list of the dispersion coefficient of each element of the mixture. :type dispersions: list of float :param references: A list of the reference orders for each element of the mixture. :type references: list of tuples of tuples of int :return: A vote map, i.e., a dictionary whose keys are orders, mapping to the number of voters with the given order as their preferences. :rtype: dict """ if len(mixture) != len(dispersions) or len(mixture) != len(references): raise ValueError("Parameters of Mallows' mixture do not have the same length.") # We normalize the mixture so that it sums up to 1 if sum(mixture) != 1: mixture = [m / sum(mixture) for m in mixture] #Precompute the distros for each Phi. insertDistributions = [] for i in range(len(mixture)): insertDistributions.append(mallowsInsertDistributions(nbAlternatives, dispersions[i])) #Now, generate votes... votemap = {} for cvoter in range(nbVoters): cmodel = np.random.choice(range(len(mixture)), 1, p = mixture)[0] #Generate a vote for the selected model insertVector = [0] * nbAlternatives for i in range(1, len(insertVector) + 1): #options are 1...max insertVector[i - 1] = np.random.choice(range(1, i + 1), 1, p = insertDistributions[cmodel][i])[0] vote = [] for i in range(len(references[cmodel])): vote.insert(insertVector[i] - 1, references[cmodel][i]) tvote = tuple((alt,) for alt in vote) votemap[tvote] = votemap.get(tvote, 0) + 1 return votemap def mallowsMixture(nbVoters, nbReferences, alternatives): """ Generates a profile following a mixture of Mallow's models for which reference points and dispersion coefficients are independently and identically distributed. :param nbVoters: Number of orders to sample. :type nbVoters: int :param nbAlternatives: Number of alternatives for the sampled orders. :type nbAlternatives: int :param nbReferences: Number of element :type nbReferences: int :return: A vote map, i.e., a dictionary whose keys are orders, mapping to the number of voters with the given order as their preferences. :rtype: dict """ mixture = [] dispersions = [] references = [] for i in range(nbReferences): references.append(tuple(generateICStrictProfile(1, alternatives))[0]) dispersions.append(round(np.random.rand(), 5)) mixture.append(np.random.randint(1, 101)) sumMixture = sum(mixture) mixture = [float(i) / float(sumMixture) for i in mixture] return mallowsModel(nbVoters, len(alternatives), mixture, dispersions, references) def urnModel(nbVoters, replace, alternatives): """ Generates a profile following the urn model. :param nbVoters: Number of orders to sample. :type nbVoters: int :param replace: The number of replacements for the urn model. :type replace: int :param alternatives: List of alternatives. :type alternatives: list of int :return: A vote map, i.e., a dictionary whose keys are orders, mapping to the number of voters with the given order as their preferences. :rtype: dict """ voteMap = {} ReplaceVotes = {} ICsize = np.math.factorial(len(alternatives)) ReplaceSize = 0 for x in range(nbVoters): flip = np.random.randint(1, ICsize + ReplaceSize + 1) if flip <= ICsize: #generate an IC vote and make a suitable number of replacements... tvote = generateICVote(alternatives) voteMap[tvote] = (voteMap.get(tvote, 0) + 1) ReplaceVotes[tvote] = (ReplaceVotes.get(tvote, 0) + replace) ReplaceSize += replace #print("made " + str(tvote)) else: #iterate over replacement hash and select proper vote. flip = flip - ICsize for vote in ReplaceVotes.keys(): flip = flip - ReplaceVotes[vote] if flip <= 0: vote = tuple((alt,) for alt in vote) voteMap[vote] = (voteMap.get(vote, 0) + 1) ReplaceVotes[vote] = (ReplaceVotes.get(vote, 0) + replace) ReplaceSize += replace break else: print("We Have a problem... replace fell through....") exit() return voteMap def generateICVote(alternatives): """ Generates a strict order over the set of alternatives following the impartial culture. :param alternatives: List of alternatives. :type alternatives: list of int :return: A strict order over the alternatives, i.e., a tuple of tuples of size 1. :rtype: tuple """ options = list(alternatives) vote = [] while(len(options) > 0): #randomly select an option vote.append(options.pop(np.random.randint(0, len(options)))) return tuple((alt,) for alt in vote)
[ 37811, 770, 8265, 8477, 9021, 284, 6291, 15387, 329, 1180, 12867, 24570, 13, 198, 37811, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 4299, 7716, 2149, 1273, 2012, 37046, 7, 46803, 53, 26008, 11, 14693, 2599, 198, 197, 37811, 2980, 689, 257, 7034, 1708, 262, 32521, 3968, 13, 628, 197, 197, 25, 17143, 299, 65, 53, 26008, 25, 7913, 286, 6266, 284, 6291, 13, 198, 197, 197, 25, 4906, 299, 65, 53, 26008, 25, 493, 198, 197, 197, 25, 17143, 14693, 25, 7343, 286, 14693, 13, 198, 197, 197, 25, 4906, 14693, 25, 1351, 286, 493, 628, 197, 197, 25, 7783, 25, 317, 3015, 3975, 11, 1312, 13, 68, 1539, 257, 22155, 3025, 8251, 389, 6266, 11, 16855, 284, 262, 1271, 286, 4446, 351, 198, 197, 197, 197, 1169, 1813, 1502, 355, 511, 15387, 13, 198, 197, 197, 25, 81, 4906, 25, 8633, 198, 197, 37811, 198, 197, 7783, 220, 700, 17633, 7, 46803, 53, 26008, 11, 657, 11, 14693, 8, 198, 198, 4299, 7716, 2149, 20660, 1273, 2012, 37046, 7, 46803, 53, 26008, 11, 14693, 2599, 198, 197, 37811, 2980, 689, 257, 7034, 1708, 262, 11614, 32521, 3968, 13, 628, 197, 197, 25, 17143, 299, 65, 53, 26008, 25, 7913, 286, 6266, 284, 6291, 13, 198, 197, 197, 25, 4906, 299, 65, 53, 26008, 25, 493, 198, 197, 197, 25, 17143, 14693, 25, 7343, 286, 14693, 13, 198, 197, 197, 25, 4906, 14693, 25, 1351, 286, 493, 628, 197, 197, 25, 7783, 25, 317, 3015, 3975, 11, 1312, 13, 68, 1539, 257, 22155, 3025, 8251, 389, 6266, 11, 16855, 284, 262, 1271, 286, 4446, 351, 198, 197, 197, 197, 1169, 1813, 1502, 355, 511, 15387, 13, 198, 197, 197, 25, 81, 4906, 25, 8633, 198, 197, 37811, 198, 197, 7783, 220, 700, 17633, 7, 46803, 53, 26008, 11, 352, 11, 14693, 8, 198, 198, 4299, 17374, 1666, 17633, 7, 46803, 53, 26008, 11, 299, 65, 23081, 2929, 11, 11710, 11, 39895, 507, 11, 10288, 2599, 198, 197, 37811, 2980, 689, 257, 7034, 1708, 257, 11710, 286, 337, 12154, 338, 4981, 13, 628, 197, 197, 25, 17143, 299, 65, 53, 26008, 25, 7913, 286, 6266, 284, 6291, 13, 198, 197, 197, 25, 4906, 299, 65, 53, 26008, 25, 493, 198, 197, 197, 25, 17143, 299, 65, 23081, 2929, 25, 7913, 286, 14693, 329, 262, 35846, 6266, 13, 198, 197, 197, 25, 4906, 299, 65, 23081, 2929, 25, 493, 198, 197, 197, 25, 17143, 11710, 25, 317, 1351, 286, 262, 19590, 286, 1123, 5002, 286, 262, 11710, 13, 198, 197, 197, 25, 4906, 6330, 25, 1351, 286, 493, 198, 197, 197, 25, 17143, 39895, 507, 25, 317, 1351, 286, 262, 4596, 6900, 35381, 286, 1123, 5002, 286, 262, 11710, 13, 198, 197, 197, 25, 4906, 39895, 507, 25, 1351, 286, 12178, 198, 197, 197, 25, 17143, 10288, 25, 317, 1351, 286, 262, 4941, 6266, 329, 1123, 5002, 286, 262, 11710, 13, 198, 197, 197, 25, 4906, 10288, 25, 1351, 286, 12777, 2374, 286, 12777, 2374, 286, 493, 628, 197, 197, 25, 7783, 25, 317, 3015, 3975, 11, 1312, 13, 68, 1539, 257, 22155, 3025, 8251, 389, 6266, 11, 16855, 284, 262, 1271, 286, 4446, 351, 198, 197, 197, 197, 1169, 1813, 1502, 355, 511, 15387, 13, 198, 197, 197, 25, 81, 4906, 25, 8633, 198, 197, 37811, 628, 197, 361, 18896, 7, 76, 9602, 8, 14512, 18896, 7, 6381, 19276, 507, 8, 393, 18896, 7, 76, 9602, 8, 14512, 18896, 7, 5420, 4972, 2599, 198, 197, 197, 40225, 11052, 12331, 7203, 48944, 286, 16618, 1666, 6, 11710, 466, 407, 423, 262, 976, 4129, 19570, 198, 197, 2, 775, 3487, 1096, 262, 11710, 523, 326, 340, 21784, 510, 284, 352, 198, 197, 361, 2160, 7, 76, 9602, 8, 14512, 352, 25, 198, 197, 197, 76, 9602, 796, 685, 76, 1220, 2160, 7, 76, 9602, 8, 329, 285, 287, 11710, 60, 628, 197, 2, 6719, 5589, 1133, 262, 1233, 4951, 329, 1123, 47256, 13, 198, 197, 28463, 20344, 2455, 507, 796, 17635, 198, 197, 1640, 1312, 287, 2837, 7, 11925, 7, 76, 9602, 8, 2599, 198, 197, 197, 28463, 20344, 2455, 507, 13, 33295, 7, 76, 47205, 44402, 20344, 2455, 507, 7, 46803, 23081, 2929, 11, 39895, 507, 58, 72, 60, 4008, 198, 197, 198, 197, 2, 3844, 11, 7716, 5690, 986, 198, 197, 85, 313, 368, 499, 796, 23884, 198, 197, 1640, 269, 85, 19543, 287, 2837, 7, 46803, 53, 26008, 2599, 198, 197, 197, 66, 19849, 796, 45941, 13, 25120, 13, 25541, 7, 9521, 7, 11925, 7, 76, 9602, 36911, 352, 11, 279, 796, 11710, 38381, 15, 60, 628, 197, 197, 2, 8645, 378, 257, 3015, 329, 262, 6163, 2746, 198, 197, 197, 28463, 38469, 796, 685, 15, 60, 1635, 299, 65, 23081, 2929, 198, 197, 197, 1640, 1312, 287, 2837, 7, 16, 11, 18896, 7, 28463, 38469, 8, 1343, 352, 2599, 198, 197, 197, 197, 2, 25811, 389, 352, 986, 9806, 198, 197, 197, 197, 28463, 38469, 58, 72, 532, 352, 60, 796, 45941, 13, 25120, 13, 25541, 7, 9521, 7, 16, 11, 1312, 1343, 352, 828, 352, 11, 279, 796, 7550, 20344, 2455, 507, 58, 66, 19849, 7131, 72, 12962, 58, 15, 60, 628, 197, 197, 27257, 796, 17635, 198, 197, 197, 1640, 1312, 287, 2837, 7, 11925, 7, 5420, 4972, 58, 66, 19849, 12962, 2599, 198, 197, 197, 197, 27257, 13, 28463, 7, 28463, 38469, 58, 72, 60, 532, 352, 11, 10288, 58, 66, 19849, 7131, 72, 12962, 628, 197, 197, 14981, 1258, 796, 46545, 19510, 2501, 35751, 329, 5988, 287, 3015, 8, 198, 197, 197, 85, 313, 368, 499, 58, 14981, 1258, 60, 796, 1993, 368, 499, 13, 1136, 7, 14981, 1258, 11, 657, 8, 1343, 352, 628, 197, 7783, 1993, 368, 499, 198, 198, 4299, 17374, 1666, 44, 9602, 7, 46803, 53, 26008, 11, 299, 65, 19927, 11, 14693, 2599, 198, 197, 37811, 2980, 689, 257, 7034, 1708, 257, 11710, 286, 337, 12154, 338, 4981, 329, 543, 4941, 2173, 290, 4596, 6900, 220, 198, 197, 197, 1073, 41945, 389, 14799, 290, 1852, 1146, 9387, 13, 628, 197, 197, 25, 17143, 299, 65, 53, 26008, 25, 7913, 286, 6266, 284, 6291, 13, 198, 197, 197, 25, 4906, 299, 65, 53, 26008, 25, 493, 198, 197, 197, 25, 17143, 299, 65, 23081, 2929, 25, 7913, 286, 14693, 329, 262, 35846, 6266, 13, 198, 197, 197, 25, 4906, 299, 65, 23081, 2929, 25, 493, 198, 197, 197, 25, 17143, 299, 65, 19927, 25, 7913, 286, 5002, 198, 197, 197, 25, 4906, 299, 65, 19927, 25, 493, 628, 197, 197, 25, 7783, 25, 317, 3015, 3975, 11, 1312, 13, 68, 1539, 257, 22155, 3025, 8251, 389, 6266, 11, 16855, 284, 262, 1271, 286, 4446, 351, 198, 197, 197, 197, 1169, 1813, 1502, 355, 511, 15387, 13, 198, 197, 197, 25, 81, 4906, 25, 8633, 198, 197, 37811, 198, 197, 76, 9602, 796, 17635, 198, 197, 6381, 19276, 507, 796, 17635, 198, 197, 5420, 4972, 796, 17635, 198, 197, 1640, 1312, 287, 2837, 7, 46803, 19927, 2599, 198, 197, 197, 5420, 4972, 13, 33295, 7, 83, 29291, 7, 8612, 378, 2149, 1273, 2012, 37046, 7, 16, 11, 14693, 4008, 58, 15, 12962, 198, 197, 197, 6381, 19276, 507, 13, 33295, 7, 744, 7, 37659, 13, 25120, 13, 25192, 22784, 642, 4008, 198, 197, 197, 76, 9602, 13, 33295, 7, 37659, 13, 25120, 13, 25192, 600, 7, 16, 11, 8949, 4008, 198, 197, 16345, 44, 9602, 796, 2160, 7, 76, 9602, 8, 198, 197, 76, 9602, 796, 685, 22468, 7, 72, 8, 1220, 12178, 7, 16345, 44, 9602, 8, 329, 1312, 287, 11710, 60, 197, 198, 197, 7783, 17374, 1666, 17633, 7, 46803, 53, 26008, 11, 18896, 7, 33645, 2929, 828, 11710, 11, 39895, 507, 11, 10288, 8, 198, 198, 4299, 220, 700, 17633, 7, 46803, 53, 26008, 11, 6330, 11, 14693, 2599, 198, 197, 37811, 2980, 689, 257, 7034, 1708, 262, 220, 700, 2746, 13, 628, 197, 197, 25, 17143, 299, 65, 53, 26008, 25, 7913, 286, 6266, 284, 6291, 13, 198, 197, 197, 25, 4906, 299, 65, 53, 26008, 25, 493, 198, 197, 197, 25, 17143, 6330, 25, 383, 1271, 286, 36205, 329, 262, 220, 700, 2746, 13, 198, 197, 197, 25, 4906, 6330, 25, 493, 198, 197, 197, 25, 17143, 14693, 25, 7343, 286, 14693, 13, 198, 197, 197, 25, 4906, 14693, 25, 1351, 286, 493, 628, 197, 197, 25, 7783, 25, 317, 3015, 3975, 11, 1312, 13, 68, 1539, 257, 22155, 3025, 8251, 389, 6266, 11, 16855, 284, 262, 1271, 286, 4446, 351, 198, 197, 197, 197, 1169, 1813, 1502, 355, 511, 15387, 13, 198, 197, 197, 25, 81, 4906, 25, 8633, 198, 197, 37811, 198, 197, 27257, 13912, 796, 23884, 198, 197, 3041, 5372, 53, 6421, 796, 23884, 198, 197, 198, 197, 2149, 7857, 796, 45941, 13, 11018, 13, 22584, 5132, 7, 11925, 7, 33645, 2929, 4008, 198, 197, 3041, 5372, 10699, 796, 657, 198, 197, 198, 197, 1640, 2124, 287, 2837, 7, 46803, 53, 26008, 2599, 198, 197, 197, 2704, 541, 796, 45941, 13, 25120, 13, 25192, 600, 7, 16, 11, 12460, 7857, 1343, 40177, 10699, 1343, 352, 8, 198, 197, 197, 361, 14283, 19841, 12460, 7857, 25, 198, 197, 197, 197, 2, 8612, 378, 281, 12460, 3015, 290, 787, 257, 11080, 1271, 286, 36205, 986, 198, 197, 197, 197, 14981, 1258, 796, 7716, 2149, 37394, 7, 33645, 2929, 8, 198, 197, 197, 197, 27257, 13912, 58, 14981, 1258, 60, 796, 357, 27257, 13912, 13, 1136, 7, 14981, 1258, 11, 657, 8, 1343, 352, 8, 198, 197, 197, 197, 3041, 5372, 53, 6421, 58, 14981, 1258, 60, 796, 357, 3041, 5372, 53, 6421, 13, 1136, 7, 14981, 1258, 11, 657, 8, 1343, 6330, 8, 198, 197, 197, 197, 3041, 5372, 10699, 15853, 6330, 198, 197, 197, 197, 2, 4798, 7203, 9727, 366, 1343, 965, 7, 14981, 1258, 4008, 198, 197, 197, 197, 197, 197, 198, 197, 197, 17772, 25, 198, 197, 197, 197, 2, 2676, 378, 625, 9014, 12234, 290, 2922, 1774, 3015, 13, 198, 197, 197, 197, 2704, 541, 796, 14283, 532, 12460, 7857, 198, 197, 197, 197, 1640, 3015, 287, 40177, 53, 6421, 13, 13083, 33529, 198, 197, 197, 197, 197, 2704, 541, 796, 14283, 532, 40177, 53, 6421, 58, 27257, 60, 198, 197, 197, 197, 197, 361, 14283, 19841, 657, 25, 198, 197, 197, 197, 197, 197, 27257, 796, 46545, 19510, 2501, 35751, 329, 5988, 287, 3015, 8, 198, 197, 197, 197, 197, 197, 27257, 13912, 58, 27257, 60, 796, 357, 27257, 13912, 13, 1136, 7, 27257, 11, 657, 8, 1343, 352, 8, 198, 197, 197, 197, 197, 197, 3041, 5372, 53, 6421, 58, 27257, 60, 796, 357, 3041, 5372, 53, 6421, 13, 1136, 7, 27257, 11, 657, 8, 1343, 6330, 8, 198, 197, 197, 197, 197, 197, 3041, 5372, 10699, 15853, 6330, 198, 197, 197, 197, 197, 197, 9032, 198, 197, 197, 197, 197, 17772, 25, 198, 197, 197, 197, 197, 197, 4798, 7203, 1135, 8192, 257, 1917, 986, 6330, 3214, 832, 1106, 4943, 197, 197, 198, 197, 197, 197, 197, 197, 37023, 3419, 198, 197, 197, 198, 197, 7783, 3015, 13912, 198, 198, 4299, 7716, 2149, 37394, 7, 33645, 2929, 2599, 198, 197, 37811, 2980, 689, 257, 7646, 1502, 625, 262, 900, 286, 14693, 1708, 262, 32521, 3968, 13, 628, 197, 197, 25, 17143, 14693, 25, 7343, 286, 14693, 13, 198, 197, 197, 25, 4906, 14693, 25, 1351, 286, 493, 628, 197, 197, 25, 7783, 25, 317, 7646, 1502, 625, 262, 14693, 11, 1312, 13, 68, 1539, 257, 46545, 286, 12777, 2374, 286, 2546, 352, 13, 198, 197, 197, 25, 81, 4906, 25, 46545, 198, 197, 37811, 198, 197, 25811, 796, 1351, 7, 33645, 2929, 8, 198, 197, 27257, 796, 17635, 198, 197, 4514, 7, 11925, 7, 25811, 8, 1875, 657, 2599, 198, 197, 197, 2, 25120, 306, 2922, 281, 3038, 198, 197, 197, 27257, 13, 33295, 7, 25811, 13, 12924, 7, 37659, 13, 25120, 13, 25192, 600, 7, 15, 11, 18896, 7, 25811, 35514, 198, 197, 7783, 46545, 19510, 2501, 35751, 329, 5988, 287, 3015, 8 ]
3.027177
1,987
import sqlite3 import pandas as pd !wget https://raw.githubusercontent.com/jonathanmendoza-tx/DS-Unit-3-Sprint-2-SQL-and-Databases/master/module1-introduction-to-sql/buddymove_holidayiq.csv conn = sqlite3.connect('buddymove_holidayiq.sqlite3') cur = conn.cursor() df = pd.read_csv('/content/buddymove_holidayiq.csv', index_col= 'User Id') df.to_sql(name = 'review', con = conn) query_rows = """ SELECT COUNT(*) FROM review """ cur.execute(query_rows) total_people = cur.fetchall() print(f'There are a total of {total_people[0][0]} rows') query_nature_shopping = """ SELECT COUNT(*) FROM review WHERE Nature >= 100 AND Shopping >= 100 """ cur.execute(query_nature_shopping) nature_shop = cur.fetchall() print(f'There are {nature_shop[0][0]} people who reviewed nature and shopping at least 100 times') columns = ['Sports', 'Religious', 'Nature', 'Theatre', 'Shopping', 'Picnic'] for ii in range(len(columns)): query = """ SELECT AVG(%s) FROM review """ cur.execute(query %columns[ii]) avg = cur.fetchall() print(f'Average number of reviews for {columns[ii]} is {avg[0][0]}')
[ 11748, 44161, 578, 18, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 0, 86, 1136, 3740, 1378, 1831, 13, 12567, 43667, 13, 785, 14, 46286, 6696, 76, 31110, 4496, 12, 17602, 14, 5258, 12, 26453, 12, 18, 12, 50, 4798, 12, 17, 12, 17861, 12, 392, 12, 27354, 18826, 14, 9866, 14, 21412, 16, 12, 27427, 596, 12, 1462, 12, 25410, 14, 65, 4185, 4948, 659, 62, 37689, 25011, 13, 40664, 198, 198, 37043, 796, 44161, 578, 18, 13, 8443, 10786, 65, 4185, 4948, 659, 62, 37689, 25011, 13, 25410, 578, 18, 11537, 198, 22019, 796, 48260, 13, 66, 21471, 3419, 198, 198, 7568, 796, 279, 67, 13, 961, 62, 40664, 10786, 14, 11299, 14, 65, 4185, 4948, 659, 62, 37689, 25011, 13, 40664, 3256, 6376, 62, 4033, 28, 705, 12982, 5121, 11537, 198, 198, 7568, 13, 1462, 62, 25410, 7, 3672, 796, 705, 19023, 3256, 369, 796, 48260, 8, 198, 198, 22766, 62, 8516, 796, 37227, 198, 46506, 327, 28270, 7, 28104, 198, 10913, 2662, 2423, 198, 37811, 198, 198, 22019, 13, 41049, 7, 22766, 62, 8516, 8, 198, 23350, 62, 15332, 796, 1090, 13, 69, 7569, 439, 3419, 198, 4798, 7, 69, 6, 1858, 389, 257, 2472, 286, 1391, 23350, 62, 15332, 58, 15, 7131, 15, 48999, 15274, 11537, 198, 198, 22766, 62, 21353, 62, 1477, 33307, 796, 37227, 198, 46506, 327, 28270, 7, 28104, 198, 10913, 2662, 2423, 198, 47357, 10362, 18189, 1802, 5357, 39109, 18189, 1802, 198, 37811, 198, 198, 22019, 13, 41049, 7, 22766, 62, 21353, 62, 1477, 33307, 8, 198, 21353, 62, 24643, 796, 1090, 13, 69, 7569, 439, 3419, 198, 198, 4798, 7, 69, 6, 1858, 389, 1391, 21353, 62, 24643, 58, 15, 7131, 15, 48999, 661, 508, 11765, 3450, 290, 9735, 379, 1551, 1802, 1661, 11537, 198, 198, 28665, 82, 796, 37250, 18153, 3256, 705, 6892, 10956, 3256, 705, 46934, 3256, 705, 464, 10562, 3256, 705, 2484, 33307, 3256, 705, 39507, 6988, 20520, 198, 1640, 21065, 287, 2837, 7, 11925, 7, 28665, 82, 8, 2599, 198, 220, 12405, 796, 37227, 198, 220, 33493, 35224, 7, 4, 82, 8, 198, 220, 16034, 2423, 220, 198, 220, 37227, 628, 220, 1090, 13, 41049, 7, 22766, 4064, 28665, 82, 58, 4178, 12962, 198, 220, 42781, 796, 1090, 13, 69, 7569, 439, 3419, 628, 220, 3601, 7, 69, 6, 26287, 1271, 286, 8088, 329, 1391, 28665, 82, 58, 4178, 48999, 318, 1391, 615, 70, 58, 15, 7131, 15, 48999, 11537 ]
2.716049
405
"""quart_redoc version file.""" __version__ = "0.5.1"
[ 37811, 36008, 62, 445, 420, 2196, 2393, 526, 15931, 198, 834, 9641, 834, 796, 366, 15, 13, 20, 13, 16, 1, 198 ]
2.454545
22
#!/usr/local/CyberCP/bin/python import os,sys sys.path.append('/usr/local/CyberCP') import django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings") django.setup() from inspect import stack from cli.cliLogger import cliLogger as logger import json from plogical.virtualHostUtilities import virtualHostUtilities import re from websiteFunctions.models import Websites, ChildDomains from plogical.dnsUtilities import DNS import time import plogical.backupUtilities as backupUtilities import requests from loginSystem.models import Administrator from packages.models import Package from plogical.mysqlUtilities import mysqlUtilities from cli.cliParser import cliParser from plogical.vhost import vhost from plogical.mailUtilities import mailUtilities from plogical.ftpUtilities import FTPUtilities from plogical.sslUtilities import sslUtilities from plogical.processUtilities import ProcessUtilities from plogical.backupSchedule import backupSchedule # All that we see or seem is but a dream within a dream. ## Website Functions ## DNS Functions ## Backup Functions ## Packages ## Database functions ## Email functions ## FTP Functions ## FTP Functions # FTP Functions ## FTP Functions ## SSL Functions if __name__ == "__main__": main()
[ 2, 48443, 14629, 14, 12001, 14, 20418, 527, 8697, 14, 8800, 14, 29412, 198, 11748, 28686, 11, 17597, 198, 17597, 13, 6978, 13, 33295, 10786, 14, 14629, 14, 12001, 14, 20418, 527, 8697, 11537, 198, 11748, 42625, 14208, 198, 418, 13, 268, 2268, 13, 2617, 12286, 7203, 35028, 1565, 11230, 62, 28480, 51, 20754, 62, 33365, 24212, 1600, 366, 20418, 527, 8697, 13, 33692, 4943, 198, 28241, 14208, 13, 40406, 3419, 198, 6738, 10104, 1330, 8931, 198, 6738, 537, 72, 13, 44506, 11187, 1362, 1330, 537, 72, 11187, 1362, 355, 49706, 198, 11748, 33918, 198, 6738, 458, 30766, 13, 32844, 17932, 18274, 2410, 1330, 7166, 17932, 18274, 2410, 198, 11748, 302, 198, 6738, 3052, 24629, 2733, 13, 27530, 1330, 47736, 2737, 11, 5932, 24510, 1299, 198, 6738, 458, 30766, 13, 67, 5907, 18274, 2410, 1330, 18538, 198, 11748, 640, 198, 11748, 458, 30766, 13, 1891, 929, 18274, 2410, 355, 11559, 18274, 2410, 198, 11748, 7007, 198, 6738, 17594, 11964, 13, 27530, 1330, 22998, 198, 6738, 10392, 13, 27530, 1330, 15717, 198, 6738, 458, 30766, 13, 28744, 13976, 18274, 2410, 1330, 48761, 18274, 2410, 198, 6738, 537, 72, 13, 44506, 46677, 1330, 537, 72, 46677, 198, 6738, 458, 30766, 13, 85, 4774, 1330, 410, 4774, 198, 6738, 458, 30766, 13, 4529, 18274, 2410, 1330, 6920, 18274, 2410, 198, 6738, 458, 30766, 13, 701, 79, 18274, 2410, 1330, 19446, 5105, 83, 2410, 198, 6738, 458, 30766, 13, 45163, 18274, 2410, 1330, 264, 6649, 18274, 2410, 198, 6738, 458, 30766, 13, 14681, 18274, 2410, 1330, 10854, 18274, 2410, 198, 6738, 458, 30766, 13, 1891, 929, 27054, 5950, 1330, 11559, 27054, 5950, 198, 198, 2, 1439, 326, 356, 766, 393, 1283, 318, 475, 257, 4320, 1626, 257, 4320, 13, 628, 220, 220, 220, 22492, 15887, 40480, 628, 198, 220, 220, 220, 22492, 18538, 40480, 628, 220, 220, 220, 22492, 35071, 40480, 628, 220, 220, 220, 22492, 6400, 1095, 628, 198, 220, 220, 220, 22492, 24047, 5499, 628, 220, 220, 220, 22492, 9570, 5499, 628, 220, 220, 220, 22492, 45854, 40480, 628, 220, 220, 220, 22492, 45854, 40480, 628, 198, 220, 220, 220, 1303, 45854, 40480, 628, 220, 220, 220, 22492, 45854, 40480, 628, 198, 220, 220, 220, 22492, 25952, 40480, 628, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419 ]
3.420779
385
from collections import deque class FixedArray(object): """ Object acts a queue of fixed length """
[ 6738, 17268, 1330, 390, 4188, 198, 198, 4871, 10832, 19182, 7, 15252, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 9515, 6529, 257, 16834, 286, 5969, 4129, 198, 220, 220, 220, 37227, 628, 198 ]
3.194444
36
# Copyright (c) 2019, Xilinx # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # 3. Neither the name of the copyright holder nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from setuptools import setup, find_packages from distutils.dir_util import copy_tree import os from pynq.utils import build_py as _build_py __author__ = "Lucian Petrica" __copyright__ = "Copyright 2019, Xilinx" # global variables module_name = "resnet50_pynq" data_files = [] class build_py(_build_py): """Overload the pynq.utils 'build_py' command (that performs overlay download) to also call the function 'copy_notebooks'. """ with open("README.md", encoding="utf-8") as fh: readme_lines = fh.readlines() readme_lines = readme_lines[ readme_lines.index("## PYNQ quick start\n") + 2: readme_lines.index("## Author\n"): ] long_description = ("".join(readme_lines)) extend_package(os.path.join(module_name, "notebooks")) setup(name=module_name, version="1.0", description="Quantized dataflow implementation of ResNet50 on Alveo", long_description=long_description, long_description_content_type="text/markdown", author="Lucian Petrica", url="https://github.com/Xilinx/ResNet50-PYNQ", packages=find_packages(), download_url="https://github.com/Xilinx/ResNet50-PYNQ", package_data={ "": data_files, }, python_requires=">=3.5.2", # keeping 'setup_requires' only for readability - relying on # pyproject.toml and PEP 517/518 setup_requires=[ "pynq>=2.5.1" ], install_requires=[ "pynq>=2.5.1", "jupyter", "jupyterlab", "plotly", "opencv-python", "wget" ], extras_require={ ':python_version<"3.6"': [ 'matplotlib<3.1', 'ipython==7.9' ], ':python_version>="3.6"': [ 'matplotlib' ] }, entry_points={ "pynq.notebooks": [ "ResNet50 = {}.notebooks".format(module_name) ] }, cmdclass={"build_py": build_py}, license="BSD 3-Clause" )
[ 2, 220, 15069, 357, 66, 8, 13130, 11, 1395, 346, 28413, 198, 2, 220, 1439, 2489, 10395, 13, 198, 2, 198, 2, 220, 2297, 396, 3890, 290, 779, 287, 2723, 290, 13934, 5107, 11, 351, 393, 1231, 198, 2, 220, 17613, 11, 389, 10431, 2810, 326, 262, 1708, 3403, 389, 1138, 25, 198, 2, 198, 2, 220, 352, 13, 2297, 396, 2455, 507, 286, 2723, 2438, 1276, 12377, 262, 2029, 6634, 4003, 11, 428, 198, 2, 220, 220, 220, 220, 1351, 286, 3403, 290, 262, 1708, 37592, 13, 198, 2, 198, 2, 220, 362, 13, 2297, 396, 2455, 507, 287, 13934, 1296, 1276, 22919, 262, 2029, 6634, 4003, 11, 198, 2, 220, 220, 220, 220, 428, 1351, 286, 3403, 290, 262, 1708, 37592, 287, 262, 10314, 198, 2, 220, 220, 220, 220, 290, 14, 273, 584, 5696, 2810, 351, 262, 6082, 13, 198, 2, 198, 2, 220, 513, 13, 16126, 262, 1438, 286, 262, 6634, 15762, 4249, 262, 3891, 286, 663, 198, 2, 220, 220, 220, 220, 20420, 743, 307, 973, 284, 11438, 393, 7719, 3186, 10944, 422, 198, 2, 220, 220, 220, 220, 428, 3788, 1231, 2176, 3161, 3194, 7170, 13, 198, 2, 198, 2, 220, 12680, 47466, 3180, 36592, 2389, 1961, 11050, 3336, 27975, 38162, 9947, 367, 15173, 4877, 5357, 27342, 9865, 3843, 20673, 366, 1921, 3180, 1, 198, 2, 220, 5357, 15529, 7788, 32761, 6375, 8959, 49094, 34764, 11015, 11, 47783, 2751, 11, 21728, 5626, 40880, 5390, 11, 3336, 198, 2, 220, 8959, 49094, 34764, 11015, 3963, 34482, 3398, 1565, 5603, 25382, 5357, 376, 46144, 7473, 317, 16652, 2149, 37232, 33079, 48933, 15986, 198, 2, 220, 13954, 48778, 1961, 13, 3268, 8005, 49261, 50163, 3336, 27975, 38162, 9947, 49707, 14418, 6375, 27342, 9865, 3843, 20673, 9348, 43031, 19146, 198, 2, 220, 7473, 15529, 42242, 11, 3268, 17931, 23988, 11, 19387, 25256, 1847, 11, 38846, 11, 7788, 3620, 6489, 13153, 11, 6375, 7102, 5188, 10917, 3525, 12576, 198, 2, 220, 29506, 25552, 357, 1268, 39149, 2751, 11, 21728, 5626, 40880, 5390, 11, 41755, 11335, 10979, 3963, 28932, 2257, 2043, 37780, 21090, 50, 6375, 198, 2, 220, 49254, 26, 406, 18420, 3963, 23210, 11, 42865, 11, 6375, 4810, 19238, 29722, 26, 6375, 43949, 44180, 23255, 49, 8577, 24131, 8, 29630, 36, 5959, 198, 2, 220, 7257, 2937, 1961, 5357, 6177, 15529, 3336, 15513, 3963, 43031, 25382, 11, 7655, 2767, 16879, 3268, 27342, 10659, 11, 19269, 18379, 43031, 25382, 11, 198, 2, 220, 6375, 309, 9863, 357, 1268, 39149, 2751, 399, 7156, 43, 3528, 18310, 6375, 25401, 54, 24352, 8, 5923, 1797, 2751, 3268, 15529, 34882, 16289, 3963, 3336, 23210, 198, 2, 220, 3963, 12680, 47466, 11, 45886, 16876, 5984, 29817, 1961, 3963, 3336, 28069, 11584, 25382, 3963, 13558, 3398, 29506, 11879, 13, 198, 198, 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 6738, 1233, 26791, 13, 15908, 62, 22602, 1330, 4866, 62, 21048, 198, 11748, 28686, 198, 6738, 279, 2047, 80, 13, 26791, 1330, 1382, 62, 9078, 355, 4808, 11249, 62, 9078, 628, 198, 834, 9800, 834, 796, 366, 22946, 666, 4767, 30997, 1, 198, 834, 22163, 4766, 834, 796, 366, 15269, 13130, 11, 1395, 346, 28413, 1, 628, 198, 2, 3298, 9633, 198, 21412, 62, 3672, 796, 366, 411, 3262, 1120, 62, 79, 2047, 80, 1, 198, 7890, 62, 16624, 796, 17635, 628, 198, 198, 4871, 1382, 62, 9078, 28264, 11249, 62, 9078, 2599, 198, 220, 220, 220, 37227, 5886, 2220, 262, 279, 2047, 80, 13, 26791, 705, 11249, 62, 9078, 6, 3141, 357, 5562, 17706, 33345, 198, 220, 220, 220, 4321, 8, 220, 284, 635, 869, 262, 2163, 705, 30073, 62, 11295, 12106, 4458, 198, 220, 220, 220, 37227, 628, 198, 4480, 1280, 7203, 15675, 11682, 13, 9132, 1600, 21004, 2625, 40477, 12, 23, 4943, 355, 277, 71, 25, 198, 220, 220, 220, 1100, 1326, 62, 6615, 796, 277, 71, 13, 961, 6615, 3419, 198, 220, 220, 220, 1100, 1326, 62, 6615, 796, 1100, 1326, 62, 6615, 58, 198, 220, 220, 220, 220, 220, 220, 220, 1100, 1326, 62, 6615, 13, 9630, 7203, 2235, 350, 40760, 48, 2068, 923, 59, 77, 4943, 1343, 362, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1100, 1326, 62, 6615, 13, 9630, 7203, 2235, 6434, 59, 77, 1, 2599, 198, 220, 220, 220, 2361, 198, 198, 6511, 62, 11213, 796, 5855, 1911, 22179, 7, 961, 1326, 62, 6615, 4008, 198, 198, 2302, 437, 62, 26495, 7, 418, 13, 6978, 13, 22179, 7, 21412, 62, 3672, 11, 366, 11295, 12106, 48774, 198, 40406, 7, 3672, 28, 21412, 62, 3672, 11, 198, 220, 220, 220, 220, 220, 2196, 2625, 16, 13, 15, 1600, 198, 220, 220, 220, 220, 220, 6764, 2625, 24915, 1143, 1366, 11125, 7822, 286, 1874, 7934, 1120, 319, 978, 303, 78, 1600, 198, 220, 220, 220, 220, 220, 890, 62, 11213, 28, 6511, 62, 11213, 11, 198, 220, 220, 220, 220, 220, 890, 62, 11213, 62, 11299, 62, 4906, 2625, 5239, 14, 4102, 2902, 1600, 198, 220, 220, 220, 220, 220, 1772, 2625, 22946, 666, 4767, 30997, 1600, 198, 220, 220, 220, 220, 220, 19016, 2625, 5450, 1378, 12567, 13, 785, 14, 55, 346, 28413, 14, 4965, 7934, 1120, 12, 47, 40760, 48, 1600, 198, 220, 220, 220, 220, 220, 10392, 28, 19796, 62, 43789, 22784, 198, 220, 220, 220, 220, 220, 4321, 62, 6371, 2625, 5450, 1378, 12567, 13, 785, 14, 55, 346, 28413, 14, 4965, 7934, 1120, 12, 47, 40760, 48, 1600, 198, 220, 220, 220, 220, 220, 5301, 62, 7890, 34758, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 1298, 1366, 62, 16624, 11, 198, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 21015, 62, 47911, 2625, 29, 28, 18, 13, 20, 13, 17, 1600, 198, 220, 220, 220, 220, 220, 1303, 5291, 705, 40406, 62, 47911, 6, 691, 329, 1100, 1799, 532, 17965, 319, 198, 220, 220, 220, 220, 220, 1303, 12972, 16302, 13, 39532, 75, 290, 350, 8905, 642, 1558, 14, 44085, 198, 220, 220, 220, 220, 220, 9058, 62, 47911, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 79, 2047, 80, 29, 28, 17, 13, 20, 13, 16, 1, 198, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 2721, 62, 47911, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 79, 2047, 80, 29, 28, 17, 13, 20, 13, 16, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 73, 929, 88, 353, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 73, 929, 88, 353, 23912, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 29487, 306, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 9654, 33967, 12, 29412, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 86, 1136, 1, 198, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 33849, 62, 46115, 34758, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 25, 29412, 62, 9641, 27, 1, 18, 13, 21, 1, 10354, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 6759, 29487, 8019, 27, 18, 13, 16, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 541, 7535, 855, 22, 13, 24, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 25, 29412, 62, 9641, 29, 2625, 18, 13, 21, 1, 10354, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 6759, 29487, 8019, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2361, 198, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 5726, 62, 13033, 34758, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 79, 2047, 80, 13, 11295, 12106, 1298, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 4965, 7934, 1120, 796, 23884, 13, 11295, 12106, 1911, 18982, 7, 21412, 62, 3672, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2361, 198, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 23991, 4871, 28, 4895, 11249, 62, 9078, 1298, 1382, 62, 9078, 5512, 198, 220, 220, 220, 220, 220, 5964, 2625, 21800, 513, 12, 2601, 682, 1, 198, 220, 220, 220, 220, 220, 1267, 198 ]
2.53868
1,409
"""Unit tests for Faucet State Collector""" import unittest from unit_base import FaucetStateCollectorTestBase from forch.proto.faucet_event_pb2 import StackTopoChange from forch.utils import dict_proto class DataplaneStateTestCase(FaucetStateCollectorTestBase): """Test cases for dataplane state""" def test_topology_loop(self): """test faucet_state_collector behavior when faucet sends loop in path to egress topology""" self._faucet_state_collector.topo_state = self._build_loop_topo_obj() egress_path = self._faucet_state_collector.get_switch_egress_path('sw1') self.assertEqual(egress_path['path_state'], 1) self.assertEqual(egress_path['path_state_detail'], 'No path to root found. Loop in topology.') def test_egress_path(self): """test faucet_state_collector behavior when faucet sends loop in path to egress topology""" self._faucet_state_collector.topo_state = self._build_topo_obj() # pylint: disable=protected-access self._faucet_state_collector._get_egress_port = lambda port: 28 egress_path = self._faucet_state_collector.get_switch_egress_path('sw3') self.assertEqual(egress_path['path_state'], 5) self.assertEqual(egress_path['path'], [{'switch': 'sw3', 'out': 1}, {'switch': 'sw1', 'in': 2, 'out': 28}]) if __name__ == '__main__': unittest.main()
[ 37811, 26453, 5254, 329, 376, 14272, 316, 1812, 17573, 37811, 198, 198, 11748, 555, 715, 395, 198, 6738, 4326, 62, 8692, 1330, 376, 14272, 316, 9012, 31337, 273, 14402, 14881, 198, 198, 6738, 329, 354, 13, 1676, 1462, 13, 69, 14272, 316, 62, 15596, 62, 40842, 17, 1330, 23881, 9126, 78, 19400, 198, 6738, 329, 354, 13, 26791, 1330, 8633, 62, 1676, 1462, 628, 198, 4871, 6060, 14382, 9012, 14402, 20448, 7, 37, 14272, 316, 9012, 31337, 273, 14402, 14881, 2599, 198, 220, 220, 220, 37227, 14402, 2663, 329, 1366, 14382, 1181, 37811, 628, 220, 220, 220, 825, 1332, 62, 4852, 1435, 62, 26268, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 9288, 277, 14272, 316, 62, 5219, 62, 33327, 273, 4069, 618, 277, 14272, 316, 12800, 9052, 287, 3108, 284, 304, 5914, 1353, 1435, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 69, 14272, 316, 62, 5219, 62, 33327, 273, 13, 4852, 78, 62, 5219, 796, 2116, 13557, 11249, 62, 26268, 62, 4852, 78, 62, 26801, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 304, 5914, 62, 6978, 796, 2116, 13557, 69, 14272, 316, 62, 5219, 62, 33327, 273, 13, 1136, 62, 31943, 62, 1533, 601, 62, 6978, 10786, 2032, 16, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 1533, 601, 62, 6978, 17816, 6978, 62, 5219, 6, 4357, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 1533, 601, 62, 6978, 17816, 6978, 62, 5219, 62, 49170, 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, 705, 2949, 3108, 284, 6808, 1043, 13, 26304, 287, 1353, 1435, 2637, 8, 628, 220, 220, 220, 825, 1332, 62, 1533, 601, 62, 6978, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 9288, 277, 14272, 316, 62, 5219, 62, 33327, 273, 4069, 618, 277, 14272, 316, 12800, 9052, 287, 3108, 284, 304, 5914, 1353, 1435, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 69, 14272, 316, 62, 5219, 62, 33327, 273, 13, 4852, 78, 62, 5219, 796, 2116, 13557, 11249, 62, 4852, 78, 62, 26801, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 279, 2645, 600, 25, 15560, 28, 24326, 12, 15526, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 69, 14272, 316, 62, 5219, 62, 33327, 273, 13557, 1136, 62, 1533, 601, 62, 634, 796, 37456, 2493, 25, 2579, 198, 220, 220, 220, 220, 220, 220, 220, 304, 5914, 62, 6978, 796, 2116, 13557, 69, 14272, 316, 62, 5219, 62, 33327, 273, 13, 1136, 62, 31943, 62, 1533, 601, 62, 6978, 10786, 2032, 18, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 1533, 601, 62, 6978, 17816, 6978, 62, 5219, 6, 4357, 642, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 1533, 601, 62, 6978, 17816, 6978, 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, 685, 90, 6, 31943, 10354, 705, 2032, 18, 3256, 705, 448, 10354, 352, 5512, 1391, 6, 31943, 10354, 705, 2032, 16, 3256, 705, 259, 10354, 362, 11, 705, 448, 10354, 2579, 92, 12962, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
2.414141
594
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from marionette.by import By from gaiatest.apps.base import Base
[ 2, 770, 8090, 6127, 5178, 318, 2426, 284, 262, 2846, 286, 262, 29258, 5094, 198, 2, 13789, 11, 410, 13, 362, 13, 15, 13, 1002, 257, 4866, 286, 262, 4904, 43, 373, 407, 9387, 351, 428, 198, 2, 2393, 11, 921, 460, 7330, 530, 379, 2638, 1378, 5908, 16496, 13, 2398, 14, 44, 6489, 14, 17, 13, 15, 11757, 198, 198, 6738, 1667, 295, 5857, 13, 1525, 1330, 2750, 198, 6738, 308, 1872, 265, 395, 13, 18211, 13, 8692, 1330, 7308, 628 ]
3.243902
82
import time import click import requests from elasticsearch.connection import Connection from elasticsearch.connection_pool import DummyConnectionPool from elasticsearch.transport import Transport from elasticsearch.exceptions import ( ConnectionError, ConnectionTimeout, SSLError ) from elasticsearch.compat import urlencode from requests import Session from ethevents.client.app import App import logging log = logging.getLogger(__name__) @click.option( '--limits/--no-limits', default=True ) @click.command() if __name__ == '__main__': main()
[ 11748, 640, 198, 198, 11748, 3904, 198, 11748, 7007, 198, 6738, 27468, 12947, 13, 38659, 1330, 26923, 198, 6738, 27468, 12947, 13, 38659, 62, 7742, 1330, 360, 13513, 32048, 27201, 198, 6738, 27468, 12947, 13, 7645, 634, 1330, 19940, 198, 6738, 27468, 12947, 13, 1069, 11755, 1330, 357, 198, 220, 220, 220, 26923, 12331, 11, 198, 220, 220, 220, 26923, 48031, 11, 198, 220, 220, 220, 6723, 2538, 81, 1472, 198, 8, 198, 6738, 27468, 12947, 13, 5589, 265, 1330, 2956, 11925, 8189, 198, 6738, 7007, 1330, 23575, 198, 6738, 304, 1169, 85, 658, 13, 16366, 13, 1324, 1330, 2034, 198, 198, 11748, 18931, 198, 198, 6404, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 628, 198, 31, 12976, 13, 18076, 7, 198, 220, 220, 220, 705, 438, 49196, 14, 438, 3919, 12, 49196, 3256, 198, 220, 220, 220, 4277, 28, 17821, 198, 8, 198, 31, 12976, 13, 21812, 3419, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419, 198 ]
3.346821
173
from pystache import TemplateSpec
[ 198, 6738, 12972, 301, 4891, 1330, 37350, 22882, 628 ]
4
9
import random # imports the random module, which contains a variety of things to do with random number generation. number = random.randint(1,10) #If we wanted a random integer, we can use the randint function Randint accepts two parameters: a lowest and a highest number. for i in range(0,3): user = int(input("guess the number")) if user == number: print("Hurray!!") print(f"you guessed the number right it's {number}") break if user != number: print(f"Your guess is incorrect the number is {number}")
[ 11748, 4738, 220, 220, 220, 220, 220, 220, 220, 1303, 17944, 262, 4738, 8265, 11, 543, 4909, 257, 4996, 286, 1243, 284, 466, 351, 4738, 1271, 5270, 13, 198, 17618, 796, 4738, 13, 25192, 600, 7, 16, 11, 940, 8, 220, 220, 220, 220, 220, 1303, 1532, 356, 2227, 257, 4738, 18253, 11, 356, 460, 779, 262, 43720, 600, 2163, 8790, 600, 18178, 734, 10007, 25, 257, 9016, 290, 257, 4511, 1271, 13, 198, 1640, 1312, 287, 2837, 7, 15, 11, 18, 2599, 198, 220, 220, 220, 2836, 796, 493, 7, 15414, 7203, 5162, 408, 262, 1271, 48774, 198, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2836, 6624, 1271, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 42633, 2433, 37160, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 69, 1, 5832, 25183, 262, 1271, 826, 340, 338, 1391, 17618, 92, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 361, 2836, 14512, 1271, 25, 198, 4798, 7, 69, 1, 7120, 4724, 318, 11491, 262, 1271, 318, 1391, 17618, 92, 4943, 198 ]
2.952632
190
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from djangosaml2.conf import get_config from djangosaml2.utils import available_idps from saml2.attribute_converter import ac_factory from saml2.mdstore import InMemoryMetaData, MetaDataFile from saml2.mdstore import name as get_idp_name from saml2.s_utils import UnknownSystemEntity from . import models
[ 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 7295, 13, 1069, 11755, 1330, 9515, 13921, 3673, 3109, 396, 198, 6738, 42625, 648, 418, 43695, 17, 13, 10414, 1330, 651, 62, 11250, 198, 6738, 42625, 648, 418, 43695, 17, 13, 26791, 1330, 1695, 62, 312, 862, 198, 6738, 6072, 75, 17, 13, 42348, 62, 1102, 332, 353, 1330, 936, 62, 69, 9548, 198, 6738, 6072, 75, 17, 13, 9132, 8095, 1330, 554, 30871, 48526, 6601, 11, 30277, 6601, 8979, 198, 6738, 6072, 75, 17, 13, 9132, 8095, 1330, 1438, 355, 651, 62, 312, 79, 62, 3672, 198, 6738, 6072, 75, 17, 13, 82, 62, 26791, 1330, 16185, 11964, 32398, 198, 198, 6738, 764, 1330, 4981, 628, 628, 628 ]
3.289256
121
# -*- coding: utf-8 -*- # Copyright 2011 Takeshi KOMIYA # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import math import unicodedata from functools import wraps from blockdiag.utils import Size from blockdiag.utils.compat import u def is_zenkaku(char): """Detect given character is Japanese ZENKAKU character""" char_width = unicodedata.east_asian_width(char) return char_width in u("WFA") def zenkaku_len(string): """Count Japanese ZENKAKU characters from string""" return len([x for x in string if is_zenkaku(x)]) def hankaku_len(string): """Count non Japanese ZENKAKU characters from string""" return len([x for x in string if not is_zenkaku(x)]) def string_width(string): """Measure rendering width of string. Count ZENKAKU-character as 2-point and non ZENKAKU-character as 1-point """ widthmap = {'Na': 1, 'N': 1, 'H': 1, 'W': 2, 'F': 2, 'A': 2} return sum(widthmap[unicodedata.east_asian_width(c)] for c in string) def textsize(string, font): """Measure rendering size (width and height) of line. Returned size will not be exactly as rendered text size, Because this method does not use fonts to measure size. """ width = (zenkaku_len(string) * font.size + hankaku_len(string) * font.size * 0.55) return Size(int(math.ceil(width)), font.size)
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 220, 15069, 2813, 33687, 5303, 509, 2662, 40, 44947, 198, 2, 198, 2, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 220, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 220, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 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, 220, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 220, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 2, 220, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 2, 220, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2, 220, 11247, 739, 262, 13789, 13, 198, 198, 11748, 10688, 198, 11748, 28000, 9043, 1045, 198, 6738, 1257, 310, 10141, 1330, 27521, 198, 6738, 2512, 10989, 363, 13, 26791, 1330, 12849, 198, 6738, 2512, 10989, 363, 13, 26791, 13, 5589, 265, 1330, 334, 628, 198, 4299, 318, 62, 4801, 74, 8719, 7, 10641, 2599, 198, 220, 220, 220, 37227, 47504, 1813, 2095, 318, 4960, 1168, 1677, 42, 10206, 52, 2095, 37811, 198, 220, 220, 220, 1149, 62, 10394, 796, 28000, 9043, 1045, 13, 23316, 62, 292, 666, 62, 10394, 7, 10641, 8, 198, 220, 220, 220, 1441, 1149, 62, 10394, 287, 334, 7203, 54, 7708, 4943, 628, 198, 4299, 1976, 268, 74, 8719, 62, 11925, 7, 8841, 2599, 198, 220, 220, 220, 37227, 12332, 4960, 1168, 1677, 42, 10206, 52, 3435, 422, 4731, 37811, 198, 220, 220, 220, 1441, 18896, 26933, 87, 329, 2124, 287, 4731, 611, 318, 62, 4801, 74, 8719, 7, 87, 8, 12962, 628, 198, 4299, 289, 962, 8719, 62, 11925, 7, 8841, 2599, 198, 220, 220, 220, 37227, 12332, 1729, 4960, 1168, 1677, 42, 10206, 52, 3435, 422, 4731, 37811, 198, 220, 220, 220, 1441, 18896, 26933, 87, 329, 2124, 287, 4731, 611, 407, 318, 62, 4801, 74, 8719, 7, 87, 8, 12962, 628, 198, 4299, 4731, 62, 10394, 7, 8841, 2599, 198, 220, 220, 220, 37227, 47384, 14837, 9647, 286, 4731, 13, 198, 220, 220, 220, 220, 220, 220, 2764, 1168, 1677, 42, 10206, 52, 12, 22769, 355, 362, 12, 4122, 290, 1729, 1168, 1677, 42, 10206, 52, 12, 22769, 355, 352, 12, 4122, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 9647, 8899, 796, 1391, 6, 26705, 10354, 352, 11, 705, 45, 10354, 352, 11, 705, 39, 10354, 352, 11, 705, 54, 10354, 362, 11, 705, 37, 10354, 362, 11, 705, 32, 10354, 362, 92, 198, 220, 220, 220, 1441, 2160, 7, 10394, 8899, 58, 46903, 9043, 1045, 13, 23316, 62, 292, 666, 62, 10394, 7, 66, 15437, 329, 269, 287, 4731, 8, 628, 198, 4299, 2420, 7857, 7, 8841, 11, 10369, 2599, 198, 220, 220, 220, 37227, 47384, 14837, 2546, 357, 10394, 290, 6001, 8, 286, 1627, 13, 198, 220, 220, 220, 220, 220, 220, 8229, 276, 2546, 481, 407, 307, 3446, 355, 15111, 2420, 2546, 11, 198, 220, 220, 220, 220, 220, 220, 4362, 428, 2446, 857, 407, 779, 26806, 284, 3953, 2546, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 9647, 796, 357, 4801, 74, 8719, 62, 11925, 7, 8841, 8, 1635, 10369, 13, 7857, 1343, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 289, 962, 8719, 62, 11925, 7, 8841, 8, 1635, 10369, 13, 7857, 1635, 657, 13, 2816, 8, 628, 220, 220, 220, 1441, 12849, 7, 600, 7, 11018, 13, 344, 346, 7, 10394, 36911, 10369, 13, 7857, 8, 628 ]
2.924765
638
from django.db import models
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 628 ]
3.75
8
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # 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 socket import time from subprocess import Popen import redis MAX_ACTOR_NUM = 40 MAX_LEARNER_NUM = 10 START_PORT = 20000 PORTNUM_PERLEARNER = MAX_ACTOR_NUM + 1 # 初始化,查看redis,连接redis, 生成端口池,即检测端口号哪些可用 def get_port(start_port): ''' get port used by module ''' predict_port = start_port + 1 if (predict_port + MAX_ACTOR_NUM - start_port) > PORTNUM_PERLEARNER: raise Exception("port num is not enough") return start_port, predict_port def test(): ''' test interface''' test_comm_conf = CommConf() redis_key = 'port_pool' print("{} len: {}".format(redis_key, test_comm_conf.redis.llen(redis_key))) for _ in range(test_comm_conf.redis.llen(redis_key)): pop_val = test_comm_conf.redis.lpop(redis_key) print("pop val: {} from '{}'".format(pop_val, redis_key)) start = time.time() test_comm_conf.init_portpool() print("use time", time.time() - start) train_port = get_port(20000) print(train_port) if __name__ == "__main__": test()
[ 2, 15069, 357, 34, 8, 12131, 13, 43208, 21852, 1766, 1539, 12052, 13, 1439, 2489, 10395, 13, 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, 198, 2, 3336, 47466, 13, 198, 11748, 17802, 198, 11748, 640, 198, 6738, 850, 14681, 1330, 8099, 268, 198, 198, 11748, 2266, 271, 198, 198, 22921, 62, 10659, 1581, 62, 41359, 796, 2319, 198, 22921, 62, 2538, 1503, 21479, 62, 41359, 796, 838, 198, 2257, 7227, 62, 15490, 796, 939, 405, 198, 15490, 41359, 62, 18973, 2538, 1503, 21479, 796, 25882, 62, 10659, 1581, 62, 41359, 1343, 352, 198, 198, 2, 10263, 230, 251, 34650, 233, 44293, 244, 171, 120, 234, 162, 253, 98, 40367, 233, 445, 271, 171, 120, 234, 32573, 252, 162, 236, 98, 445, 271, 11, 13328, 242, 253, 22755, 238, 44165, 107, 20998, 96, 162, 109, 254, 171, 120, 234, 39355, 111, 162, 96, 222, 38184, 233, 44165, 107, 20998, 96, 20998, 115, 161, 241, 103, 12859, 249, 20998, 107, 18796, 101, 628, 198, 4299, 651, 62, 634, 7, 9688, 62, 634, 2599, 198, 220, 220, 220, 705, 7061, 651, 2493, 973, 416, 8265, 705, 7061, 198, 220, 220, 220, 4331, 62, 634, 796, 923, 62, 634, 1343, 352, 198, 220, 220, 220, 611, 357, 79, 17407, 62, 634, 1343, 25882, 62, 10659, 1581, 62, 41359, 532, 923, 62, 634, 8, 1875, 350, 9863, 41359, 62, 18973, 2538, 1503, 21479, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 35528, 7203, 634, 997, 318, 407, 1576, 4943, 628, 220, 220, 220, 1441, 923, 62, 634, 11, 4331, 62, 634, 628, 198, 4299, 1332, 33529, 198, 220, 220, 220, 705, 7061, 1332, 7071, 7061, 6, 198, 220, 220, 220, 1332, 62, 9503, 62, 10414, 796, 1520, 18546, 3419, 198, 220, 220, 220, 2266, 271, 62, 2539, 796, 705, 634, 62, 7742, 6, 198, 220, 220, 220, 3601, 7203, 90, 92, 18896, 25, 23884, 1911, 18982, 7, 445, 271, 62, 2539, 11, 1332, 62, 9503, 62, 10414, 13, 445, 271, 13, 297, 268, 7, 445, 271, 62, 2539, 22305, 198, 220, 220, 220, 329, 4808, 287, 2837, 7, 9288, 62, 9503, 62, 10414, 13, 445, 271, 13, 297, 268, 7, 445, 271, 62, 2539, 8, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1461, 62, 2100, 796, 1332, 62, 9503, 62, 10414, 13, 445, 271, 13, 75, 12924, 7, 445, 271, 62, 2539, 8, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 12924, 1188, 25, 23884, 422, 705, 90, 92, 6, 1911, 18982, 7, 12924, 62, 2100, 11, 2266, 271, 62, 2539, 4008, 198, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 628, 220, 220, 220, 1332, 62, 9503, 62, 10414, 13, 15003, 62, 634, 7742, 3419, 198, 220, 220, 220, 3601, 7203, 1904, 640, 1600, 640, 13, 2435, 3419, 532, 923, 8, 628, 220, 220, 220, 4512, 62, 634, 796, 651, 62, 634, 7, 2167, 405, 8, 198, 220, 220, 220, 3601, 7, 27432, 62, 634, 8, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1332, 3419, 198 ]
2.80599
768
""" Static threshold based anomaly detection """ from typing import List, Tuple import logging import numpy as np import pandas as pd from nbdb.anomaly.anomaly_interface import AnomalyInterface from nbdb.readapi.graphite_response import Anomaly from nbdb.readapi.time_series_response import TimeRange logger = logging.getLogger(__name__) class Static(AnomalyInterface): # pylint: disable=too-few-public-methods """ Simple algorithm to do threshold based anomaly detection. Currently supports two functions (lt, gt). """ def find_anomalies(self, baseline: np.ndarray, raw_data: pd.Series) -> List[Tuple]: """ Use static threshold to determine anomalies in the raw data. Supports the lt, gt functions to compare against the threshold :param baseline: :param raw_data: :return: """ comparator_fn = self.config.get('comparator_fn', 'gt') threshold = self.config.get('threshold') raw_data.dropna(inplace=True) if comparator_fn == 'gt': anomalous_points = raw_data[raw_data > threshold] elif comparator_fn == 'lt': anomalous_points = raw_data[raw_data < threshold] else: raise NotImplementedError('Unknown comparator fn: {}'.format( comparator_fn)) anomalies = [] # No anomalous points found. Return early if len(anomalous_points) == 0: return anomalies previous_epoch = anomalous_points.index[0] anomaly_start = anomalous_points.index[0] sampling_interval = np.diff(raw_data.index).min() anomaly_score = 1.0 epoch = None for epoch, _ in anomalous_points.iteritems(): if (epoch - previous_epoch) / sampling_interval > 1: # Mark the current anomaly as ended and start a new one anomaly_window = TimeRange(anomaly_start, previous_epoch, sampling_interval) anomalies.append(Anomaly(anomaly_window, anomaly_score)) anomaly_score = 1.0 anomaly_start = epoch else: previous_epoch = epoch anomaly_score += 1 # append the final anomaly if epoch is not None: anomaly_window = TimeRange(anomaly_start, epoch, sampling_interval) anomalies.append(Anomaly(anomaly_window, anomaly_score)) return anomalies
[ 37811, 198, 45442, 11387, 1912, 32172, 13326, 198, 37811, 198, 6738, 19720, 1330, 7343, 11, 309, 29291, 198, 11748, 18931, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 6738, 299, 65, 9945, 13, 272, 24335, 13, 272, 24335, 62, 39994, 1330, 1052, 24335, 39317, 198, 6738, 299, 65, 9945, 13, 961, 15042, 13, 34960, 578, 62, 26209, 1330, 1052, 24335, 198, 6738, 299, 65, 9945, 13, 961, 15042, 13, 2435, 62, 25076, 62, 26209, 1330, 3862, 17257, 198, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 198, 4871, 36125, 7, 2025, 24335, 39317, 2599, 220, 1303, 279, 2645, 600, 25, 15560, 28, 18820, 12, 32146, 12, 11377, 12, 24396, 82, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 17427, 11862, 284, 466, 11387, 1912, 32172, 13326, 13, 198, 220, 220, 220, 16888, 6971, 734, 5499, 357, 2528, 11, 308, 83, 737, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 1064, 62, 272, 18048, 444, 7, 944, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14805, 25, 45941, 13, 358, 18747, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8246, 62, 7890, 25, 279, 67, 13, 27996, 8, 4613, 7343, 58, 51, 29291, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 5765, 9037, 11387, 284, 5004, 35907, 287, 262, 198, 220, 220, 220, 220, 220, 220, 220, 8246, 1366, 13, 45267, 262, 300, 83, 11, 308, 83, 5499, 284, 8996, 198, 220, 220, 220, 220, 220, 220, 220, 1028, 262, 11387, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 14805, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 8246, 62, 7890, 25, 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, 4616, 1352, 62, 22184, 796, 2116, 13, 11250, 13, 1136, 10786, 785, 1845, 1352, 62, 22184, 3256, 705, 13655, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 11387, 796, 2116, 13, 11250, 13, 1136, 10786, 400, 10126, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 8246, 62, 7890, 13, 14781, 2616, 7, 259, 5372, 28, 17821, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 4616, 1352, 62, 22184, 6624, 705, 13655, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26921, 516, 62, 13033, 796, 8246, 62, 7890, 58, 1831, 62, 7890, 1875, 11387, 60, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 4616, 1352, 62, 22184, 6624, 705, 2528, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26921, 516, 62, 13033, 796, 8246, 62, 7890, 58, 1831, 62, 7890, 1279, 11387, 60, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 10786, 20035, 4616, 1352, 24714, 25, 23884, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4616, 1352, 62, 22184, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 35907, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 1400, 26921, 516, 2173, 1043, 13, 8229, 1903, 198, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 272, 18048, 516, 62, 13033, 8, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 35907, 628, 220, 220, 220, 220, 220, 220, 220, 2180, 62, 538, 5374, 796, 26921, 516, 62, 13033, 13, 9630, 58, 15, 60, 198, 220, 220, 220, 220, 220, 220, 220, 32172, 62, 9688, 796, 26921, 516, 62, 13033, 13, 9630, 58, 15, 60, 198, 220, 220, 220, 220, 220, 220, 220, 19232, 62, 3849, 2100, 796, 45941, 13, 26069, 7, 1831, 62, 7890, 13, 9630, 737, 1084, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 32172, 62, 26675, 796, 352, 13, 15, 198, 220, 220, 220, 220, 220, 220, 220, 36835, 796, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 329, 36835, 11, 4808, 287, 26921, 516, 62, 13033, 13, 2676, 23814, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 357, 538, 5374, 532, 2180, 62, 538, 5374, 8, 1220, 19232, 62, 3849, 2100, 1875, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2940, 262, 1459, 32172, 355, 4444, 290, 923, 257, 649, 530, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 32172, 62, 17497, 796, 3862, 17257, 7, 272, 24335, 62, 9688, 11, 2180, 62, 538, 5374, 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, 19232, 62, 3849, 2100, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35907, 13, 33295, 7, 2025, 24335, 7, 272, 24335, 62, 17497, 11, 32172, 62, 26675, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 32172, 62, 26675, 796, 352, 13, 15, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 32172, 62, 9688, 796, 36835, 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, 2180, 62, 538, 5374, 796, 36835, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 32172, 62, 26675, 15853, 352, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 24443, 262, 2457, 32172, 198, 220, 220, 220, 220, 220, 220, 220, 611, 36835, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 32172, 62, 17497, 796, 3862, 17257, 7, 272, 24335, 62, 9688, 11, 36835, 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, 19232, 62, 3849, 2100, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35907, 13, 33295, 7, 2025, 24335, 7, 272, 24335, 62, 17497, 11, 32172, 62, 26675, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 35907, 198 ]
2.252189
1,142
#!/usr/bin/env python3 import unittest from R_ev3dev.interpreter import Interpreter, Command from R_ev3dev.help import Help, Version class TestCommand01(Command): """ this is the test command 01 usage: c01 """ class TestCommand02(Command): """ this is the test command 02 """
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 555, 715, 395, 198, 6738, 371, 62, 1990, 18, 7959, 13, 3849, 3866, 353, 1330, 4225, 3866, 353, 11, 9455, 198, 6738, 371, 62, 1990, 18, 7959, 13, 16794, 1330, 10478, 11, 10628, 628, 198, 4871, 6208, 21575, 486, 7, 21575, 2599, 198, 220, 220, 220, 37227, 428, 318, 262, 1332, 3141, 5534, 628, 220, 220, 220, 220, 220, 220, 220, 8748, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 269, 486, 198, 220, 220, 220, 37227, 628, 198, 4871, 6208, 21575, 2999, 7, 21575, 2599, 198, 220, 220, 220, 37227, 428, 318, 262, 1332, 3141, 7816, 628, 220, 220, 220, 37227, 628 ]
2.709402
117
from django.urls import path from rest_framework.urlpatterns import format_suffix_patterns from news import views app_name = "news" urlpatterns = [ path("news/", views.NewsList.as_view()), path("news/<int:pk>/", views.NewsDetail.as_view()), path("category/", views.CategoryList.as_view()), path("category/<str:pk>/", views.CategoryDetail.as_view()), ] urlpatterns = format_suffix_patterns(urlpatterns)
[ 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 198, 6738, 1334, 62, 30604, 13, 6371, 33279, 82, 1330, 5794, 62, 37333, 844, 62, 33279, 82, 198, 6738, 1705, 1330, 5009, 198, 198, 1324, 62, 3672, 796, 366, 10827, 1, 198, 6371, 33279, 82, 796, 685, 198, 220, 220, 220, 3108, 7203, 10827, 14, 1600, 5009, 13, 9980, 8053, 13, 292, 62, 1177, 3419, 828, 198, 220, 220, 220, 3108, 7203, 10827, 14, 27, 600, 25, 79, 74, 29, 14, 1600, 5009, 13, 9980, 11242, 603, 13, 292, 62, 1177, 3419, 828, 198, 220, 220, 220, 3108, 7203, 22872, 14, 1600, 5009, 13, 27313, 8053, 13, 292, 62, 1177, 3419, 828, 198, 220, 220, 220, 3108, 7203, 22872, 14, 27, 2536, 25, 79, 74, 29, 14, 1600, 5009, 13, 27313, 11242, 603, 13, 292, 62, 1177, 3419, 828, 198, 60, 198, 198, 6371, 33279, 82, 796, 5794, 62, 37333, 844, 62, 33279, 82, 7, 6371, 33279, 82, 8, 198 ]
2.658228
158
import torch from torch import nn from .retrieve import SEG_MODELS_REGISTRY @SEG_MODELS_REGISTRY.register()
[ 11748, 28034, 198, 6738, 28034, 1330, 299, 77, 198, 198, 6738, 764, 1186, 30227, 1330, 311, 7156, 62, 33365, 37142, 62, 31553, 1797, 40405, 628, 628, 198, 198, 31, 5188, 38, 62, 33365, 37142, 62, 31553, 1797, 40405, 13, 30238, 3419, 198 ]
2.714286
42
try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from sipHeader import SIPHeader from sipStartLineFactory import SIPStartLineFactory
[ 28311, 25, 198, 220, 220, 220, 422, 269, 10100, 9399, 1330, 10903, 9399, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 422, 10903, 9399, 1330, 10903, 9399, 198, 6738, 31145, 39681, 1330, 311, 4061, 39681, 198, 6738, 31145, 10434, 13949, 22810, 1330, 311, 4061, 10434, 13949, 22810, 628, 198 ]
3.6
50
# # @lc app=leetcode.cn id=1635 lang=python3 # # [1635] number-of-good-pairs # None # @lc code=end
[ 2, 198, 2, 2488, 44601, 598, 28, 293, 316, 8189, 13, 31522, 4686, 28, 1433, 2327, 42392, 28, 29412, 18, 198, 2, 198, 2, 685, 1433, 2327, 60, 1271, 12, 1659, 12, 11274, 12, 79, 3468, 198, 2, 198, 14202, 198, 2, 2488, 44601, 2438, 28, 437 ]
2.085106
47
# Exercise 12: Prompting People # Variables age = raw_input("How old are you? ") height = raw_input("How tall are you? ") weight = raw_input("How much do you weigh? ") # Print print "So, you're %r old, %r tall and %r heavy." % (age, height, weight) # Study Drills # 1. In Terminal where you normally run python to run your scripts, # type pydoc raw_input. Read what it says. If you're on Windows # try python -m pydoc raw_input instead. # 2. Get out of pydoc by typing q to quit. # 3. Look onine for what the pydoc command does. # 4. Use pydoc to also read about open, file, os and sys. It's # alright if you do not understand thosel just read through # and take notes about interesting things. # Drill 1 # Help on built-in function raw_input in module __builtin__: # raw_input(...) # raw_input([prompt]) -> string # # Read a string from standard input. The trailing newline is stripped. # If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError. # On Unix, GNU readline is used if enabled. The prompt string, if given, # is printed without a trailing newline before reading.
[ 2, 32900, 1105, 25, 45965, 278, 4380, 198, 198, 2, 15965, 2977, 198, 496, 796, 8246, 62, 15414, 7203, 2437, 1468, 389, 345, 30, 366, 8, 198, 17015, 796, 8246, 62, 15414, 7203, 2437, 7331, 389, 345, 30, 366, 8, 198, 6551, 796, 8246, 62, 15414, 7203, 2437, 881, 466, 345, 10164, 30, 366, 8, 198, 198, 2, 12578, 198, 4798, 366, 2396, 11, 345, 821, 4064, 81, 1468, 11, 4064, 81, 7331, 290, 4064, 81, 4334, 526, 4064, 357, 496, 11, 6001, 11, 3463, 8, 628, 198, 2, 12481, 1583, 2171, 198, 2, 197, 16, 13, 554, 24523, 810, 345, 7685, 1057, 21015, 284, 1057, 534, 14750, 11, 198, 2, 197, 4906, 279, 5173, 420, 8246, 62, 15414, 13, 4149, 644, 340, 1139, 13, 1002, 345, 821, 319, 3964, 198, 2, 197, 28311, 21015, 532, 76, 279, 5173, 420, 8246, 62, 15414, 2427, 13, 198, 2, 197, 17, 13, 3497, 503, 286, 279, 5173, 420, 416, 19720, 10662, 284, 11238, 13, 198, 2, 197, 18, 13, 6803, 319, 500, 329, 644, 262, 279, 5173, 420, 3141, 857, 13, 198, 2, 197, 19, 13, 5765, 279, 5173, 420, 284, 635, 1100, 546, 1280, 11, 2393, 11, 28686, 290, 25064, 13, 632, 338, 198, 2, 197, 282, 3506, 611, 345, 466, 407, 1833, 883, 75, 655, 1100, 832, 198, 2, 197, 392, 1011, 4710, 546, 3499, 1243, 13, 198, 198, 2, 46350, 352, 198, 2, 197, 22087, 319, 3170, 12, 259, 2163, 8246, 62, 15414, 287, 8265, 11593, 18780, 259, 834, 25, 198, 198, 2, 197, 1831, 62, 15414, 7, 23029, 198, 2, 220, 220, 220, 220, 197, 1831, 62, 15414, 26933, 16963, 457, 12962, 4613, 4731, 198, 2, 220, 220, 220, 220, 198, 2, 197, 5569, 257, 4731, 422, 3210, 5128, 13, 220, 383, 25462, 649, 1370, 318, 18818, 13, 198, 2, 197, 1532, 262, 2836, 7127, 412, 19238, 357, 47000, 25, 327, 28781, 12, 35, 11, 3964, 25, 327, 28781, 12, 57, 10, 13615, 828, 5298, 412, 19238, 12331, 13, 198, 2, 197, 2202, 33501, 11, 22961, 1100, 1370, 318, 973, 611, 9343, 13, 220, 383, 6152, 4731, 11, 611, 1813, 11, 198, 2, 197, 271, 10398, 1231, 257, 25462, 649, 1370, 878, 3555, 13, 198 ]
3.024523
367
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import *
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 33918, 198, 198, 6738, 435, 541, 323, 13, 64, 404, 13, 15042, 13, 9979, 415, 13, 22973, 34184, 1187, 1330, 1635, 628, 628 ]
2.446809
47
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Checker functions for Azure ML notebooks.""" import json import os import socket import sys import urllib from pathlib import Path from typing import Any, List, Mapping, Optional, Tuple, Union from IPython import get_ipython from IPython.display import HTML, display from pkg_resources import parse_version from .._version import VERSION from ..common.pkg_config import refresh_config __version__ = VERSION AZ_GET_STARTED = ( "https://github.com/Azure/Azure-Sentinel-Notebooks/blob/master/A%20Getting" "%20Started%20Guide%20For%20Azure%20Sentinel%20ML%20Notebooks.ipynb" ) TROUBLE_SHOOTING = ( "https://github.com/Azure/Azure-Sentinel-Notebooks/blob/master/" "TroubleShootingNotebooks.ipynb" ) MISSING_PKG_ERR = """ <h4><font color='orange'>The package '<b>{package}</b>' is not installed or has an unsupported version (installed version = '{inst_ver}')</font></h4> Please install or upgrade before continuing: required version is {package}>={req_ver} """ MP_INSTALL_FAILED = """ <h4><font color='red'>The notebook may not run correctly without the correct version of '<b>{pkg}</b>' ({ver} or later).</font></h4> Please see the <a href="{nbk_uri}"> Getting Started Guide For Azure Sentinel ML Notebooks</a></b> for more information<br><hr> """ RELOAD_MP = """ <h4><font color='orange'>Kernel restart needed</h4> An error was detected trying to load the updated version of MSTICPy.<br> Please restart the notebook kernel and re-run this cell - it should run without error. """ MIN_PYTHON_VER_DEF = "3.6" MSTICPY_REQ_VERSION = __version__ VER_RGX = r"(?P<maj>\d+)\.(?P<min>\d+).(?P<pnt>\d+)(?P<suff>.*)" MP_ENV_VAR = "MSTICPYCONFIG" MP_FILE = "msticpyconfig.yaml" NB_CHECK_URI = ( "https://raw.githubusercontent.com/Azure/Azure-Sentinel-" "Notebooks/master/utils/nb_check.py" ) def is_in_aml(): """Return True if running in Azure Machine Learning.""" return os.environ.get("APPSETTING_WEBSITE_SITE_NAME") == "AMLComputeInstance" def check_versions( min_py_ver: Union[str, Tuple] = MIN_PYTHON_VER_DEF, min_mp_ver: Union[str, Tuple] = MSTICPY_REQ_VERSION, extras: Optional[List[str]] = None, mp_release: Optional[str] = None, **kwargs, ): """ Check the current versions of the Python kernel and MSTICPy. Parameters ---------- min_py_ver : Union[Tuple[int, int], str] Minimum Python version min_mp_ver : Union[Tuple[int, int], str] Minimum MSTICPy version extras : Optional[List[str]], optional A list of extras required for MSTICPy mp_release : Optional[str], optional Override the MSTICPy release version. This can also be specified in the environment variable 'MP_TEST_VER' Raises ------ RuntimeError If the Python version does not support the notebook. If the MSTICPy version does not support the notebook and the user chose not to upgrade """ del kwargs _disp_html("<h4>Starting notebook pre-checks...</h4>") if isinstance(min_py_ver, str): min_py_ver = _get_pkg_version(min_py_ver).release check_python_ver(min_py_ver=min_py_ver) _check_mp_install(min_mp_ver, mp_release, extras) _check_kql_prereqs() _set_kql_env_vars(extras) _run_user_settings() _set_mpconfig_var() _disp_html("<h4>Notebook pre-checks complete.</h4>") def check_python_ver(min_py_ver: Union[str, Tuple] = MIN_PYTHON_VER_DEF): """ Check the current version of the Python kernel. Parameters ---------- min_py_ver : Tuple[int, int] Minimum Python version Raises ------ RuntimeError If the Python version does not support the notebook. """ min_py_ver = _get_pkg_version(min_py_ver) sys_ver = _get_pkg_version(sys.version_info[:3]) _disp_html("Checking Python kernel version...") if sys_ver < min_py_ver: # Bandit SQL inject error found here _disp_html( f""" <h4><font color='red'>This notebook requires a later (Python) kernel version.</h4></font> Select a kernel from the notebook toolbar (above), that is Python {min_py_ver} or later (Python 3.8 recommended)<br> """ # nosec ) _disp_html( f""" Please see the <a href="{TROUBLE_SHOOTING}">TroubleShootingNotebooks</a> for more information<br><br><hr> """ ) # Bandit SQL inject error found here raise RuntimeError(f"Python {min_py_ver} or later kernel is required.") # nosec if sys_ver < _get_pkg_version("3.8"): _disp_html( "Recommended: switch to using the 'Python 3.8 - AzureML' notebook kernel" " if this is available." ) _disp_html(f"Info: Python kernel version {sys_ver} - OK<br>") def _check_mp_install( min_mp_ver: Union[str, Tuple], mp_release: Optional[str], extras: Optional[List[str]], ): """Check for and try to install required MSTICPy version.""" # Use the release ver specified in params, in the environment or # the notebook default. pkg_version = _get_pkg_version(min_mp_ver) mp_install_version = mp_release or os.environ.get("MP_TEST_VER") or str(pkg_version) check_mp_ver(min_msticpy_ver=mp_install_version, extras=extras) def check_mp_ver(min_msticpy_ver: Union[str, Tuple], extras: Optional[List[str]]): """ Check and optionally update the current version of msticpy. Parameters ---------- min_msticpy_ver : Tuple[int, int] Minimum MSTICPy version extras : Optional[List[str]], optional A list of extras required for MSTICPy Raises ------ ImportError If MSTICPy version is insufficient and we need to upgrade """ mp_min_pkg_ver = _get_pkg_version(min_msticpy_ver) _disp_html("Checking msticpy version...<br>") inst_version = _get_pkg_version(__version__) if inst_version < mp_min_pkg_ver: _disp_html( MISSING_PKG_ERR.format( package="msticpy", inst_ver=inst_version, req_ver=mp_min_pkg_ver, ) ) mp_pkg_spec = f"msticpy[{','.join(extras)}]" if extras else "msticpy" mp_pkg_spec = f"{mp_pkg_spec}>={min_msticpy_ver}" _disp_html( f"Please run the following command to upgrade MSTICPy<br>" f"<pre>!{mp_pkg_spec}</pre><br>" ) raise ImportError( "Unsupported version of MSTICPy installed", f"Installed version: {inst_version}", f"Required version: {mp_min_pkg_ver}", ) _disp_html(f"Info: msticpy version {inst_version} (>= {mp_min_pkg_ver}) - OK<br>") def _set_kql_env_vars(extras: Optional[List[str]]): """Set environment variables for Kqlmagic based on MP extras.""" jp_extended = ("azsentinel", "azuresentinel", "kql") if extras and any(extra for extra in extras if extra in jp_extended): os.environ["KQLMAGIC_EXTRAS_REQUIRE"] = "jupyter-extended" else: os.environ["KQLMAGIC_EXTRAS_REQUIRE"] = "jupyter-basic" if is_in_aml(): os.environ["KQLMAGIC_AZUREML_COMPUTE"] = _get_vm_fqdn() def _get_pkg_version(version: Union[str, Tuple]) -> Any: """Return pkg_resources parsed version from string or tuple.""" if isinstance(version, str): return parse_version(version) if isinstance(version, tuple): return parse_version(".".join(str(ver) for ver in version)) raise TypeError(f"Unparseable type version {version}") def _disp_html(text: str): """Display the HTML text.""" display(HTML(text)) def get_aml_user_folder() -> Optional[Path]: """Return the root of the user folder.""" path_parts = Path(".").absolute().parts if "Users" not in path_parts: return None # find the index of the last occurrence of "users" users_idx = len(path_parts) - path_parts[::-1].index("Users") # the user folder is one item below this if len(path_parts) < users_idx + 1: return None return Path("/".join(path_parts[: users_idx + 1])) # pylint: disable=import-outside-toplevel, unused-import, import-error def _run_user_settings(): """Import nbuser_settings.py, if it exists.""" user_folder = get_aml_user_folder() if user_folder.joinpath("nbuser_settings.py").is_file(): sys.path.append(str(user_folder)) import nbuser_settings # noqa: F401 # pylint: enable=import-outside-toplevel, unused-import, import-error def _set_mpconfig_var(): """Set MSTICPYCONFIG to file in user directory if no other found.""" mp_path_val = os.environ.get(MP_ENV_VAR) if ( # If a valid MSTICPYCONFIG value is found - return (mp_path_val and Path(mp_path_val).is_file()) # Or if there is a msticpconfig in the current folder. or Path(".").joinpath(MP_FILE).is_file() ): return # Otherwise check the user's root folder user_dir = get_aml_user_folder() mp_path = Path(user_dir).joinpath(MP_FILE) if mp_path.is_file(): # If there's a file there, set the env variable to that. os.environ[MP_ENV_VAR] = str(mp_path) # Since we have already imported msticpy to check the version # it will have already configured settings so we need to refresh. refresh_config() _disp_html( f"<br>No {MP_FILE} found. Will use {MP_FILE} in user folder {user_dir}<br>" ) def _get_vm_metadata() -> Mapping[str, Any]: """Use local request to get VM metadata.""" vm_uri = "http://169.254.169.254/metadata/instance?api-version=2017-08-01" req = urllib.request.Request(vm_uri) # type: ignore req.add_header("Metadata", "true") # Bandit warning on urlopen - Fixed private URL with urllib.request.urlopen(req) as resp: # type: ignore # nosec metadata = json.loads(resp.read()) return metadata if isinstance(metadata, dict) else {} def _get_vm_fqdn() -> str: """Get the FQDN of the host.""" az_region = _get_vm_metadata().get("compute", {}).get("location") return ".".join( [ socket.gethostname(), az_region, "instances.azureml.ms", ] if az_region else "" ) def _check_kql_prereqs(): """ Check and install packages for Kqlmagic/msal_extensions. Notes ----- Kqlmagic may trigger warnings about a missing PyGObject package and some system library dependencies. To fix this do the following:<br> From a notebook run: %pip uninstall enum34 !sudo apt-get --yes install libgirepository1.0-dev !sudo apt-get --yes install gir1.2-secret-1 %pip install pygobject You can also do this from a terminal - but ensure that you've activated the environment corresponding to the kernel you are using prior to running the pip commands. # Install the libgi dependency sudo apt install libgirepository1.0-dev sudo apt install gir1.2-secret-1 # activate the environment # conda activate azureml_py38 # source ./env_path/scripts/activate # Uninstall enum34 python -m pip uninstall enum34 # Install pygobject python -m install pygobject """ if not is_in_aml(): return try: # If this successfully imports, we are ok # pylint: disable=import-outside-toplevel import gi # pylint: enable=import-outside-toplevel del gi except ImportError: # Check for system packages ip_shell = get_ipython() if not ip_shell: return apt_list = ip_shell.run_line_magic("sx", "apt list") apt_list = [apt.split("/", maxsplit=1)[0] for apt in apt_list] missing_lx_pkg = [ apt_pkg for apt_pkg in ("libgirepository1.0-dev", "gir1.2-secret-1") if apt_pkg not in apt_list ] if missing_lx_pkg: _disp_html( "Kqlmagic/msal-extensions pre-requisite PyGObject not installed." ) _disp_html( "To prevent warnings when loading the Kqlmagic data provider," " Please run the following command:<br>" "!conda install --yes -c conda-forge pygobject<br>" )
[ 2, 16529, 45537, 198, 2, 15069, 357, 66, 8, 5413, 10501, 13, 1439, 2489, 10395, 13, 198, 2, 49962, 739, 262, 17168, 13789, 13, 4091, 13789, 13, 14116, 287, 262, 1628, 6808, 329, 198, 2, 5964, 1321, 13, 198, 2, 16529, 35937, 198, 37811, 9787, 263, 5499, 329, 22134, 10373, 43935, 526, 15931, 198, 11748, 33918, 198, 11748, 28686, 198, 11748, 17802, 198, 11748, 25064, 198, 11748, 2956, 297, 571, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 19720, 1330, 4377, 11, 7343, 11, 337, 5912, 11, 32233, 11, 309, 29291, 11, 4479, 198, 198, 6738, 6101, 7535, 1330, 651, 62, 541, 7535, 198, 6738, 6101, 7535, 13, 13812, 1330, 11532, 11, 3359, 198, 6738, 279, 10025, 62, 37540, 1330, 21136, 62, 9641, 198, 198, 6738, 11485, 62, 9641, 1330, 44156, 2849, 198, 6738, 11485, 11321, 13, 35339, 62, 11250, 1330, 14976, 62, 11250, 628, 198, 834, 9641, 834, 796, 44156, 2849, 198, 198, 22778, 62, 18851, 62, 2257, 7227, 1961, 796, 357, 198, 220, 220, 220, 366, 5450, 1378, 12567, 13, 785, 14, 26903, 495, 14, 26903, 495, 12, 31837, 20538, 12, 6425, 12106, 14, 2436, 672, 14, 9866, 14, 32, 4, 1238, 20570, 1, 198, 220, 220, 220, 36521, 1238, 10434, 276, 4, 1238, 47889, 4, 1238, 1890, 4, 1238, 26903, 495, 4, 1238, 31837, 20538, 4, 1238, 5805, 4, 1238, 6425, 12106, 13, 541, 2047, 65, 1, 198, 8, 198, 5446, 2606, 19146, 62, 9693, 46, 2394, 2751, 796, 357, 198, 220, 220, 220, 366, 5450, 1378, 12567, 13, 785, 14, 26903, 495, 14, 26903, 495, 12, 31837, 20538, 12, 6425, 12106, 14, 2436, 672, 14, 9866, 30487, 198, 220, 220, 220, 366, 51, 472, 903, 2484, 12494, 6425, 12106, 13, 541, 2047, 65, 1, 198, 8, 198, 44, 16744, 2751, 62, 40492, 38, 62, 1137, 49, 796, 37227, 198, 220, 220, 220, 1279, 71, 19, 6927, 10331, 3124, 11639, 43745, 44167, 464, 5301, 705, 27, 65, 29, 90, 26495, 92, 3556, 65, 29, 6, 318, 407, 198, 220, 220, 220, 6589, 393, 468, 281, 24222, 2196, 357, 37050, 2196, 796, 705, 90, 8625, 62, 332, 92, 11537, 3556, 10331, 12240, 71, 19, 29, 198, 220, 220, 220, 4222, 2721, 393, 8515, 878, 8282, 25, 2672, 2196, 318, 1391, 26495, 92, 29, 34758, 42180, 62, 332, 92, 198, 220, 220, 220, 37227, 198, 7378, 62, 38604, 7036, 62, 7708, 4146, 1961, 796, 37227, 198, 220, 220, 220, 1279, 71, 19, 6927, 10331, 3124, 11639, 445, 44167, 464, 20922, 743, 407, 1057, 9380, 1231, 198, 220, 220, 220, 262, 3376, 2196, 286, 705, 27, 65, 29, 90, 35339, 92, 3556, 65, 29, 6, 37913, 332, 92, 393, 1568, 737, 3556, 10331, 12240, 71, 19, 29, 198, 220, 220, 220, 4222, 766, 262, 1279, 64, 13291, 2625, 90, 46803, 74, 62, 9900, 92, 5320, 198, 220, 220, 220, 18067, 31026, 10005, 1114, 22134, 26716, 10373, 5740, 12106, 3556, 64, 12240, 65, 29, 198, 220, 220, 220, 329, 517, 1321, 27, 1671, 6927, 11840, 29, 198, 37811, 198, 16448, 41048, 62, 7378, 796, 37227, 198, 220, 220, 220, 1279, 71, 19, 6927, 10331, 3124, 11639, 43745, 44167, 42, 7948, 15765, 2622, 3556, 71, 19, 29, 198, 220, 220, 220, 1052, 4049, 373, 12326, 2111, 284, 3440, 262, 6153, 2196, 286, 337, 2257, 2149, 20519, 29847, 1671, 29, 198, 220, 220, 220, 4222, 15765, 262, 20922, 9720, 290, 302, 12, 5143, 428, 2685, 532, 340, 815, 198, 220, 220, 220, 1057, 1231, 4049, 13, 198, 220, 220, 220, 37227, 198, 198, 23678, 62, 47, 56, 4221, 1340, 62, 5959, 62, 32988, 796, 366, 18, 13, 21, 1, 198, 44, 2257, 2149, 47, 56, 62, 2200, 48, 62, 43717, 796, 11593, 9641, 834, 198, 198, 5959, 62, 48192, 55, 796, 374, 18109, 30, 47, 27, 76, 1228, 29, 59, 67, 10, 19415, 12195, 30, 47, 27, 1084, 29, 59, 67, 10, 737, 7, 30, 47, 27, 79, 429, 29, 59, 67, 10, 5769, 30, 47, 27, 37333, 29, 15885, 16725, 198, 7378, 62, 1677, 53, 62, 53, 1503, 796, 366, 44, 2257, 2149, 47, 56, 10943, 16254, 1, 198, 7378, 62, 25664, 796, 366, 76, 11268, 9078, 11250, 13, 88, 43695, 1, 198, 32819, 62, 50084, 62, 47269, 796, 357, 198, 220, 220, 220, 366, 5450, 1378, 1831, 13, 12567, 43667, 13, 785, 14, 26903, 495, 14, 26903, 495, 12, 31837, 20538, 21215, 198, 220, 220, 220, 366, 6425, 12106, 14, 9866, 14, 26791, 14, 46803, 62, 9122, 13, 9078, 1, 198, 8, 628, 198, 4299, 318, 62, 259, 62, 43695, 33529, 198, 220, 220, 220, 37227, 13615, 6407, 611, 2491, 287, 22134, 10850, 18252, 526, 15931, 198, 220, 220, 220, 1441, 28686, 13, 268, 2268, 13, 1136, 7203, 2969, 3705, 2767, 48996, 62, 8845, 4462, 12709, 62, 50, 12709, 62, 20608, 4943, 6624, 366, 2390, 5639, 3361, 1133, 33384, 1, 628, 198, 4299, 2198, 62, 47178, 7, 198, 220, 220, 220, 949, 62, 9078, 62, 332, 25, 4479, 58, 2536, 11, 309, 29291, 60, 796, 20625, 62, 47, 56, 4221, 1340, 62, 5959, 62, 32988, 11, 198, 220, 220, 220, 949, 62, 3149, 62, 332, 25, 4479, 58, 2536, 11, 309, 29291, 60, 796, 337, 2257, 2149, 47, 56, 62, 2200, 48, 62, 43717, 11, 198, 220, 220, 220, 33849, 25, 32233, 58, 8053, 58, 2536, 11907, 796, 6045, 11, 198, 220, 220, 220, 29034, 62, 20979, 25, 32233, 58, 2536, 60, 796, 6045, 11, 198, 220, 220, 220, 12429, 46265, 22046, 11, 198, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6822, 262, 1459, 6300, 286, 262, 11361, 9720, 290, 337, 2257, 2149, 20519, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 949, 62, 9078, 62, 332, 1058, 4479, 58, 51, 29291, 58, 600, 11, 493, 4357, 965, 60, 198, 220, 220, 220, 220, 220, 220, 220, 26265, 11361, 2196, 198, 220, 220, 220, 949, 62, 3149, 62, 332, 1058, 4479, 58, 51, 29291, 58, 600, 11, 493, 4357, 965, 60, 198, 220, 220, 220, 220, 220, 220, 220, 26265, 337, 2257, 2149, 20519, 2196, 198, 220, 220, 220, 33849, 1058, 32233, 58, 8053, 58, 2536, 60, 4357, 11902, 198, 220, 220, 220, 220, 220, 220, 220, 317, 1351, 286, 33849, 2672, 329, 337, 2257, 2149, 20519, 198, 220, 220, 220, 29034, 62, 20979, 1058, 32233, 58, 2536, 4357, 11902, 198, 220, 220, 220, 220, 220, 220, 220, 3827, 13154, 262, 337, 2257, 2149, 20519, 2650, 2196, 13, 770, 198, 220, 220, 220, 220, 220, 220, 220, 460, 635, 307, 7368, 287, 262, 2858, 7885, 705, 7378, 62, 51, 6465, 62, 5959, 6, 628, 220, 220, 220, 7567, 2696, 198, 220, 220, 220, 40103, 198, 220, 220, 220, 43160, 12331, 198, 220, 220, 220, 220, 220, 220, 220, 1002, 262, 11361, 2196, 857, 407, 1104, 262, 20922, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1002, 262, 337, 2257, 2149, 20519, 2196, 857, 407, 1104, 262, 20922, 198, 220, 220, 220, 220, 220, 220, 220, 290, 262, 2836, 7690, 407, 284, 8515, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 1619, 479, 86, 22046, 198, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7203, 27, 71, 19, 29, 22851, 20922, 662, 12, 42116, 986, 3556, 71, 19, 29, 4943, 198, 220, 220, 220, 611, 318, 39098, 7, 1084, 62, 9078, 62, 332, 11, 965, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 949, 62, 9078, 62, 332, 796, 4808, 1136, 62, 35339, 62, 9641, 7, 1084, 62, 9078, 62, 332, 737, 20979, 198, 220, 220, 220, 2198, 62, 29412, 62, 332, 7, 1084, 62, 9078, 62, 332, 28, 1084, 62, 9078, 62, 332, 8, 628, 220, 220, 220, 4808, 9122, 62, 3149, 62, 17350, 7, 1084, 62, 3149, 62, 332, 11, 29034, 62, 20979, 11, 33849, 8, 198, 220, 220, 220, 4808, 9122, 62, 74, 13976, 62, 3866, 42180, 82, 3419, 198, 220, 220, 220, 4808, 2617, 62, 74, 13976, 62, 24330, 62, 85, 945, 7, 2302, 8847, 8, 198, 220, 220, 220, 4808, 5143, 62, 7220, 62, 33692, 3419, 198, 220, 220, 220, 4808, 2617, 62, 3149, 11250, 62, 7785, 3419, 198, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7203, 27, 71, 19, 29, 6425, 2070, 662, 12, 42116, 1844, 25970, 71, 19, 29, 4943, 628, 198, 4299, 2198, 62, 29412, 62, 332, 7, 1084, 62, 9078, 62, 332, 25, 4479, 58, 2536, 11, 309, 29291, 60, 796, 20625, 62, 47, 56, 4221, 1340, 62, 5959, 62, 32988, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6822, 262, 1459, 2196, 286, 262, 11361, 9720, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 949, 62, 9078, 62, 332, 1058, 309, 29291, 58, 600, 11, 493, 60, 198, 220, 220, 220, 220, 220, 220, 220, 26265, 11361, 2196, 628, 220, 220, 220, 7567, 2696, 198, 220, 220, 220, 40103, 198, 220, 220, 220, 43160, 12331, 198, 220, 220, 220, 220, 220, 220, 220, 1002, 262, 11361, 2196, 857, 407, 1104, 262, 20922, 13, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 949, 62, 9078, 62, 332, 796, 4808, 1136, 62, 35339, 62, 9641, 7, 1084, 62, 9078, 62, 332, 8, 198, 220, 220, 220, 25064, 62, 332, 796, 4808, 1136, 62, 35339, 62, 9641, 7, 17597, 13, 9641, 62, 10951, 58, 25, 18, 12962, 198, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7203, 9787, 278, 11361, 9720, 2196, 9313, 8, 198, 220, 220, 220, 611, 25064, 62, 332, 1279, 949, 62, 9078, 62, 332, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 10243, 270, 16363, 8677, 4049, 1043, 994, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1279, 71, 19, 6927, 10331, 3124, 11639, 445, 44167, 1212, 20922, 4433, 257, 1568, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 37906, 8, 9720, 2196, 25970, 71, 19, 12240, 10331, 29, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 9683, 257, 9720, 422, 262, 20922, 50149, 357, 29370, 828, 326, 318, 11361, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1391, 1084, 62, 9078, 62, 332, 92, 393, 1568, 357, 37906, 513, 13, 23, 7151, 8, 27, 1671, 29, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 37227, 220, 1303, 9686, 66, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4222, 766, 262, 1279, 64, 13291, 2625, 90, 5446, 2606, 19146, 62, 9693, 46, 2394, 2751, 92, 5320, 51, 472, 903, 2484, 12494, 6425, 12106, 3556, 64, 29, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 517, 1321, 27, 1671, 6927, 1671, 6927, 11840, 29, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 10243, 270, 16363, 8677, 4049, 1043, 994, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 43160, 12331, 7, 69, 1, 37906, 1391, 1084, 62, 9078, 62, 332, 92, 393, 1568, 9720, 318, 2672, 19570, 220, 1303, 9686, 66, 628, 220, 220, 220, 611, 25064, 62, 332, 1279, 4808, 1136, 62, 35339, 62, 9641, 7203, 18, 13, 23, 1, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 36171, 25, 5078, 284, 1262, 262, 705, 37906, 513, 13, 23, 532, 22134, 5805, 6, 20922, 9720, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 611, 428, 318, 1695, 526, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7, 69, 1, 12360, 25, 11361, 9720, 2196, 1391, 17597, 62, 332, 92, 532, 7477, 27, 1671, 29, 4943, 628, 198, 4299, 4808, 9122, 62, 3149, 62, 17350, 7, 198, 220, 220, 220, 949, 62, 3149, 62, 332, 25, 4479, 58, 2536, 11, 309, 29291, 4357, 198, 220, 220, 220, 29034, 62, 20979, 25, 32233, 58, 2536, 4357, 198, 220, 220, 220, 33849, 25, 32233, 58, 8053, 58, 2536, 60, 4357, 198, 2599, 198, 220, 220, 220, 37227, 9787, 329, 290, 1949, 284, 2721, 2672, 337, 2257, 2149, 20519, 2196, 526, 15931, 198, 220, 220, 220, 1303, 5765, 262, 2650, 3326, 7368, 287, 42287, 11, 287, 262, 2858, 393, 198, 220, 220, 220, 1303, 262, 20922, 4277, 13, 198, 220, 220, 220, 279, 10025, 62, 9641, 796, 4808, 1136, 62, 35339, 62, 9641, 7, 1084, 62, 3149, 62, 332, 8, 198, 220, 220, 220, 29034, 62, 17350, 62, 9641, 796, 29034, 62, 20979, 393, 28686, 13, 268, 2268, 13, 1136, 7203, 7378, 62, 51, 6465, 62, 5959, 4943, 393, 965, 7, 35339, 62, 9641, 8, 628, 220, 220, 220, 2198, 62, 3149, 62, 332, 7, 1084, 62, 76, 11268, 9078, 62, 332, 28, 3149, 62, 17350, 62, 9641, 11, 33849, 28, 2302, 8847, 8, 628, 198, 4299, 2198, 62, 3149, 62, 332, 7, 1084, 62, 76, 11268, 9078, 62, 332, 25, 4479, 58, 2536, 11, 309, 29291, 4357, 33849, 25, 32233, 58, 8053, 58, 2536, 11907, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6822, 290, 42976, 4296, 262, 1459, 2196, 286, 285, 11268, 9078, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 949, 62, 76, 11268, 9078, 62, 332, 1058, 309, 29291, 58, 600, 11, 493, 60, 198, 220, 220, 220, 220, 220, 220, 220, 26265, 337, 2257, 2149, 20519, 2196, 198, 220, 220, 220, 33849, 1058, 32233, 58, 8053, 58, 2536, 60, 4357, 11902, 198, 220, 220, 220, 220, 220, 220, 220, 317, 1351, 286, 33849, 2672, 329, 337, 2257, 2149, 20519, 628, 220, 220, 220, 7567, 2696, 198, 220, 220, 220, 40103, 198, 220, 220, 220, 17267, 12331, 198, 220, 220, 220, 220, 220, 220, 220, 1002, 337, 2257, 2149, 20519, 2196, 318, 19022, 290, 356, 761, 284, 8515, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 29034, 62, 1084, 62, 35339, 62, 332, 796, 4808, 1136, 62, 35339, 62, 9641, 7, 1084, 62, 76, 11268, 9078, 62, 332, 8, 628, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7203, 9787, 278, 285, 11268, 9078, 2196, 986, 27, 1671, 29, 4943, 628, 220, 220, 220, 916, 62, 9641, 796, 4808, 1136, 62, 35339, 62, 9641, 7, 834, 9641, 834, 8, 198, 220, 220, 220, 611, 916, 62, 9641, 1279, 29034, 62, 1084, 62, 35339, 62, 332, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49684, 2751, 62, 40492, 38, 62, 1137, 49, 13, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5301, 2625, 76, 11268, 9078, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 916, 62, 332, 28, 8625, 62, 9641, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 43089, 62, 332, 28, 3149, 62, 1084, 62, 35339, 62, 332, 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, 29034, 62, 35339, 62, 16684, 796, 277, 1, 76, 11268, 9078, 58, 90, 3256, 4458, 22179, 7, 2302, 8847, 38165, 30866, 611, 33849, 2073, 366, 76, 11268, 9078, 1, 198, 220, 220, 220, 220, 220, 220, 220, 29034, 62, 35339, 62, 16684, 796, 277, 1, 90, 3149, 62, 35339, 62, 16684, 92, 29, 34758, 1084, 62, 76, 11268, 9078, 62, 332, 36786, 628, 220, 220, 220, 220, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 5492, 1057, 262, 1708, 3141, 284, 8515, 337, 2257, 2149, 20519, 27, 1671, 24618, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 27, 3866, 29, 0, 90, 3149, 62, 35339, 62, 16684, 92, 3556, 3866, 6927, 1671, 24618, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 17267, 12331, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 3118, 15999, 2196, 286, 337, 2257, 2149, 20519, 6589, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 6310, 4262, 2196, 25, 1391, 8625, 62, 9641, 92, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 37374, 2196, 25, 1391, 3149, 62, 1084, 62, 35339, 62, 332, 92, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7, 69, 1, 12360, 25, 285, 11268, 9078, 2196, 1391, 8625, 62, 9641, 92, 45160, 28, 1391, 3149, 62, 1084, 62, 35339, 62, 332, 30072, 532, 7477, 27, 1671, 29, 4943, 628, 198, 4299, 4808, 2617, 62, 74, 13976, 62, 24330, 62, 85, 945, 7, 2302, 8847, 25, 32233, 58, 8053, 58, 2536, 11907, 2599, 198, 220, 220, 220, 37227, 7248, 2858, 9633, 329, 509, 13976, 32707, 1912, 319, 4904, 33849, 526, 15931, 198, 220, 220, 220, 474, 79, 62, 2302, 1631, 796, 5855, 1031, 34086, 20538, 1600, 366, 1031, 942, 298, 20538, 1600, 366, 74, 13976, 4943, 198, 220, 220, 220, 611, 33849, 290, 597, 7, 26086, 329, 3131, 287, 33849, 611, 3131, 287, 474, 79, 62, 2302, 1631, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 28686, 13, 268, 2268, 14692, 42, 9711, 45820, 2149, 62, 6369, 5446, 1921, 62, 2200, 49128, 8973, 796, 366, 73, 929, 88, 353, 12, 2302, 1631, 1, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 28686, 13, 268, 2268, 14692, 42, 9711, 45820, 2149, 62, 6369, 5446, 1921, 62, 2200, 49128, 8973, 796, 366, 73, 929, 88, 353, 12, 35487, 1, 198, 220, 220, 220, 611, 318, 62, 259, 62, 43695, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 28686, 13, 268, 2268, 14692, 42, 9711, 45820, 2149, 62, 22778, 11335, 5805, 62, 9858, 30076, 36, 8973, 796, 4808, 1136, 62, 14761, 62, 69, 80, 32656, 3419, 628, 198, 4299, 4808, 1136, 62, 35339, 62, 9641, 7, 9641, 25, 4479, 58, 2536, 11, 309, 29291, 12962, 4613, 4377, 25, 198, 220, 220, 220, 37227, 13615, 279, 10025, 62, 37540, 44267, 2196, 422, 4731, 393, 46545, 526, 15931, 198, 220, 220, 220, 611, 318, 39098, 7, 9641, 11, 965, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 21136, 62, 9641, 7, 9641, 8, 198, 220, 220, 220, 611, 318, 39098, 7, 9641, 11, 46545, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 21136, 62, 9641, 7203, 526, 13, 22179, 7, 2536, 7, 332, 8, 329, 3326, 287, 2196, 4008, 198, 220, 220, 220, 5298, 5994, 12331, 7, 69, 1, 3118, 29572, 540, 2099, 2196, 1391, 9641, 92, 4943, 628, 198, 4299, 4808, 6381, 79, 62, 6494, 7, 5239, 25, 965, 2599, 198, 220, 220, 220, 37227, 23114, 262, 11532, 2420, 526, 15931, 198, 220, 220, 220, 3359, 7, 28656, 7, 5239, 4008, 628, 198, 4299, 651, 62, 43695, 62, 7220, 62, 43551, 3419, 4613, 32233, 58, 15235, 5974, 198, 220, 220, 220, 37227, 13615, 262, 6808, 286, 262, 2836, 9483, 526, 15931, 198, 220, 220, 220, 3108, 62, 42632, 796, 10644, 7203, 526, 737, 48546, 22446, 42632, 198, 220, 220, 220, 611, 366, 14490, 1, 407, 287, 3108, 62, 42632, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 6045, 198, 220, 220, 220, 1303, 1064, 262, 6376, 286, 262, 938, 19810, 286, 366, 18417, 1, 198, 220, 220, 220, 2985, 62, 312, 87, 796, 18896, 7, 6978, 62, 42632, 8, 532, 3108, 62, 42632, 58, 3712, 12, 16, 4083, 9630, 7203, 14490, 4943, 198, 220, 220, 220, 1303, 262, 2836, 9483, 318, 530, 2378, 2174, 428, 198, 220, 220, 220, 611, 18896, 7, 6978, 62, 42632, 8, 1279, 2985, 62, 312, 87, 1343, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 6045, 198, 220, 220, 220, 1441, 10644, 7203, 14, 1911, 22179, 7, 6978, 62, 42632, 58, 25, 2985, 62, 312, 87, 1343, 352, 60, 4008, 628, 198, 2, 279, 2645, 600, 25, 15560, 28, 11748, 12, 43435, 12, 83, 643, 626, 11, 21958, 12, 11748, 11, 1330, 12, 18224, 198, 4299, 4808, 5143, 62, 7220, 62, 33692, 33529, 198, 220, 220, 220, 37227, 20939, 299, 65, 7220, 62, 33692, 13, 9078, 11, 611, 340, 7160, 526, 15931, 198, 220, 220, 220, 2836, 62, 43551, 796, 651, 62, 43695, 62, 7220, 62, 43551, 3419, 198, 220, 220, 220, 611, 2836, 62, 43551, 13, 22179, 6978, 7203, 46803, 7220, 62, 33692, 13, 9078, 11074, 271, 62, 7753, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 25064, 13, 6978, 13, 33295, 7, 2536, 7, 7220, 62, 43551, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 1330, 299, 65, 7220, 62, 33692, 220, 1303, 645, 20402, 25, 376, 21844, 628, 198, 2, 279, 2645, 600, 25, 7139, 28, 11748, 12, 43435, 12, 83, 643, 626, 11, 21958, 12, 11748, 11, 1330, 12, 18224, 628, 198, 4299, 4808, 2617, 62, 3149, 11250, 62, 7785, 33529, 198, 220, 220, 220, 37227, 7248, 337, 2257, 2149, 47, 56, 10943, 16254, 284, 2393, 287, 2836, 8619, 611, 645, 584, 1043, 526, 15931, 198, 220, 220, 220, 29034, 62, 6978, 62, 2100, 796, 28686, 13, 268, 2268, 13, 1136, 7, 7378, 62, 1677, 53, 62, 53, 1503, 8, 198, 220, 220, 220, 611, 357, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 1002, 257, 4938, 337, 2257, 2149, 47, 56, 10943, 16254, 1988, 318, 1043, 532, 1441, 198, 220, 220, 220, 220, 220, 220, 220, 357, 3149, 62, 6978, 62, 2100, 290, 10644, 7, 3149, 62, 6978, 62, 2100, 737, 271, 62, 7753, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 1471, 611, 612, 318, 257, 285, 11268, 79, 11250, 287, 262, 1459, 9483, 13, 198, 220, 220, 220, 220, 220, 220, 220, 393, 10644, 7203, 526, 737, 22179, 6978, 7, 7378, 62, 25664, 737, 271, 62, 7753, 3419, 198, 220, 220, 220, 15179, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 198, 220, 220, 220, 1303, 15323, 2198, 262, 2836, 338, 6808, 9483, 198, 220, 220, 220, 2836, 62, 15908, 796, 651, 62, 43695, 62, 7220, 62, 43551, 3419, 198, 220, 220, 220, 29034, 62, 6978, 796, 10644, 7, 7220, 62, 15908, 737, 22179, 6978, 7, 7378, 62, 25664, 8, 198, 220, 220, 220, 611, 29034, 62, 6978, 13, 271, 62, 7753, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 1002, 612, 338, 257, 2393, 612, 11, 900, 262, 17365, 7885, 284, 326, 13, 198, 220, 220, 220, 220, 220, 220, 220, 28686, 13, 268, 2268, 58, 7378, 62, 1677, 53, 62, 53, 1503, 60, 796, 965, 7, 3149, 62, 6978, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4619, 356, 423, 1541, 17392, 285, 11268, 9078, 284, 2198, 262, 2196, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 340, 481, 423, 1541, 17839, 6460, 523, 356, 761, 284, 14976, 13, 198, 220, 220, 220, 220, 220, 220, 220, 14976, 62, 11250, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 27, 1671, 29, 2949, 1391, 7378, 62, 25664, 92, 1043, 13, 2561, 779, 1391, 7378, 62, 25664, 92, 287, 2836, 9483, 1391, 7220, 62, 15908, 92, 27, 1671, 24618, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 198, 4299, 4808, 1136, 62, 14761, 62, 38993, 3419, 4613, 337, 5912, 58, 2536, 11, 4377, 5974, 198, 220, 220, 220, 37227, 11041, 1957, 2581, 284, 651, 16990, 20150, 526, 15931, 198, 220, 220, 220, 45887, 62, 9900, 796, 366, 4023, 1378, 22172, 13, 24970, 13, 22172, 13, 24970, 14, 38993, 14, 39098, 30, 15042, 12, 9641, 28, 5539, 12, 2919, 12, 486, 1, 198, 220, 220, 220, 43089, 796, 2956, 297, 571, 13, 25927, 13, 18453, 7, 14761, 62, 9900, 8, 220, 1303, 2099, 25, 8856, 198, 220, 220, 220, 43089, 13, 2860, 62, 25677, 7203, 9171, 14706, 1600, 366, 7942, 4943, 628, 220, 220, 220, 1303, 10243, 270, 6509, 319, 19016, 9654, 532, 10832, 2839, 10289, 198, 220, 220, 220, 351, 2956, 297, 571, 13, 25927, 13, 6371, 9654, 7, 42180, 8, 355, 1217, 25, 220, 1303, 2099, 25, 8856, 220, 1303, 9686, 66, 198, 220, 220, 220, 220, 220, 220, 220, 20150, 796, 33918, 13, 46030, 7, 4363, 13, 961, 28955, 198, 220, 220, 220, 1441, 20150, 611, 318, 39098, 7, 38993, 11, 8633, 8, 2073, 23884, 628, 198, 4299, 4808, 1136, 62, 14761, 62, 69, 80, 32656, 3419, 4613, 965, 25, 198, 220, 220, 220, 37227, 3855, 262, 376, 48, 35504, 286, 262, 2583, 526, 15931, 198, 220, 220, 220, 35560, 62, 36996, 796, 4808, 1136, 62, 14761, 62, 38993, 22446, 1136, 7203, 5589, 1133, 1600, 23884, 737, 1136, 7203, 24886, 4943, 198, 220, 220, 220, 1441, 366, 526, 13, 22179, 7, 198, 220, 220, 220, 220, 220, 220, 220, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17802, 13, 1136, 4774, 3672, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35560, 62, 36996, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 8625, 1817, 13, 1031, 495, 4029, 13, 907, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 2361, 198, 220, 220, 220, 220, 220, 220, 220, 611, 35560, 62, 36996, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 13538, 198, 220, 220, 220, 1267, 628, 198, 4299, 4808, 9122, 62, 74, 13976, 62, 3866, 42180, 82, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6822, 290, 2721, 10392, 329, 509, 13976, 32707, 14, 907, 282, 62, 2302, 5736, 13, 628, 220, 220, 220, 11822, 198, 220, 220, 220, 37404, 198, 220, 220, 220, 509, 13976, 32707, 743, 7616, 14601, 546, 257, 4814, 9485, 38, 10267, 5301, 198, 220, 220, 220, 290, 617, 1080, 5888, 20086, 13, 1675, 4259, 428, 466, 262, 198, 220, 220, 220, 1708, 25, 27, 1671, 29, 198, 220, 220, 220, 3574, 257, 20922, 1057, 25, 628, 220, 220, 220, 220, 220, 220, 220, 4064, 79, 541, 43194, 33829, 2682, 198, 220, 220, 220, 220, 220, 220, 220, 5145, 24032, 15409, 12, 1136, 1377, 8505, 2721, 9195, 70, 557, 1930, 37765, 16, 13, 15, 12, 7959, 198, 220, 220, 220, 220, 220, 220, 220, 5145, 24032, 15409, 12, 1136, 1377, 8505, 2721, 37370, 16, 13, 17, 12, 21078, 12, 16, 198, 220, 220, 220, 220, 220, 220, 220, 4064, 79, 541, 2721, 12972, 70, 15252, 628, 220, 220, 220, 921, 460, 635, 466, 428, 422, 257, 12094, 532, 475, 4155, 326, 345, 1053, 198, 220, 220, 220, 13906, 262, 2858, 11188, 284, 262, 9720, 345, 389, 198, 220, 220, 220, 1262, 3161, 284, 2491, 262, 7347, 9729, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 15545, 262, 9195, 12397, 20203, 198, 220, 220, 220, 220, 220, 220, 220, 21061, 15409, 2721, 9195, 70, 557, 1930, 37765, 16, 13, 15, 12, 7959, 198, 220, 220, 220, 220, 220, 220, 220, 21061, 15409, 2721, 37370, 16, 13, 17, 12, 21078, 12, 16, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 15155, 262, 2858, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 1779, 64, 15155, 35560, 495, 4029, 62, 9078, 2548, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 2723, 24457, 24330, 62, 6978, 14, 46521, 14, 39022, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 791, 17350, 33829, 2682, 198, 220, 220, 220, 220, 220, 220, 220, 21015, 532, 76, 7347, 43194, 33829, 2682, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 15545, 12972, 70, 15252, 198, 220, 220, 220, 220, 220, 220, 220, 21015, 532, 76, 2721, 12972, 70, 15252, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 407, 318, 62, 259, 62, 43695, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 1002, 428, 7675, 17944, 11, 356, 389, 12876, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 279, 2645, 600, 25, 15560, 28, 11748, 12, 43435, 12, 83, 643, 626, 198, 220, 220, 220, 220, 220, 220, 220, 1330, 308, 72, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 279, 2645, 600, 25, 7139, 28, 11748, 12, 43435, 12, 83, 643, 626, 198, 220, 220, 220, 220, 220, 220, 220, 1619, 308, 72, 198, 220, 220, 220, 2845, 17267, 12331, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 6822, 329, 1080, 10392, 198, 220, 220, 220, 220, 220, 220, 220, 20966, 62, 29149, 796, 651, 62, 541, 7535, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 611, 407, 20966, 62, 29149, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 198, 220, 220, 220, 220, 220, 220, 220, 15409, 62, 4868, 796, 20966, 62, 29149, 13, 5143, 62, 1370, 62, 32707, 7203, 82, 87, 1600, 366, 2373, 1351, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 15409, 62, 4868, 796, 685, 2373, 13, 35312, 7203, 14, 1600, 3509, 35312, 28, 16, 38381, 15, 60, 329, 15409, 287, 15409, 62, 4868, 60, 198, 220, 220, 220, 220, 220, 220, 220, 4814, 62, 75, 87, 62, 35339, 796, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15409, 62, 35339, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 15409, 62, 35339, 287, 5855, 8019, 70, 557, 1930, 37765, 16, 13, 15, 12, 7959, 1600, 366, 70, 343, 16, 13, 17, 12, 21078, 12, 16, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 15409, 62, 35339, 407, 287, 15409, 62, 4868, 198, 220, 220, 220, 220, 220, 220, 220, 2361, 198, 220, 220, 220, 220, 220, 220, 220, 611, 4814, 62, 75, 87, 62, 35339, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 6381, 79, 62, 6494, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 42, 13976, 32707, 14, 907, 282, 12, 2302, 5736, 662, 12, 27614, 9485, 38, 10267, 407, 6589, 526, 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, 4808, 6381, 79, 62, 6494, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 2514, 2948, 14601, 618, 11046, 262, 509, 13976, 32707, 1366, 10131, 553, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 4222, 1057, 262, 1708, 3141, 25, 27, 1671, 24618, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 0, 66, 13533, 2721, 1377, 8505, 532, 66, 1779, 64, 12, 30293, 12972, 70, 15252, 27, 1671, 24618, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198 ]
2.415137
5,285
"""Endpoints of the Konfuzio Host.""" import logging from konfuzio_sdk import KONFUZIO_HOST, KONFUZIO_PROJECT_ID logger = logging.getLogger(__name__) def get_auth_token_url() -> str: """ Generate URL that creates an authentication token for the user. :return: URL to generate the token. """ return f"{KONFUZIO_HOST}/api/token-auth/" def get_project_list_url() -> str: """ Generate URL to load all the projects available for the user. :return: URL to get all the projects for the user. """ return f"{KONFUZIO_HOST}/api/projects/" def create_new_project_url() -> str: """ Generate URL to create a new project. :return: URL to create a new project. """ return f"{KONFUZIO_HOST}/api/projects/" def get_documents_meta_url() -> str: """ Generate URL to load meta information about documents. :return: URL to get all the documents details. """ return f"{KONFUZIO_HOST}/api/projects/{KONFUZIO_PROJECT_ID}/docs/" def get_upload_document_url() -> str: """ Generate URL to upload a document. :return: URL to upload a document """ return f"{KONFUZIO_HOST}/api/v2/docs/" def get_create_label_url() -> str: """ Generate URL to create a label. :return: URL to create a label. """ return f"{KONFUZIO_HOST}/api/v2/labels/" def get_document_ocr_file_url(document_id: int) -> str: """ Generate URL to access OCR version of document. :param document_id: ID of the document as integer :return: URL to get OCR document file. """ return f'{KONFUZIO_HOST}/doc/show/{document_id}/' def get_document_original_file_url(document_id: int) -> str: """ Generate URL to access original version of the document. :param document_id: ID of the document as integer :return: URL to get the original document """ return f'{KONFUZIO_HOST}/doc/show-original/{document_id}/' def get_document_api_details_url(document_id: int, include_extractions: bool = False, extra_fields='bbox') -> str: """ Generate URL to access document details of one document in a project. :param document_id: ID of the document as integer :param include_extractions: Bool to include extractions :param extra_fields: Extra information to include in the response :return: URL to get document details """ return ( f'{KONFUZIO_HOST}/api/projects/{KONFUZIO_PROJECT_ID}/docs/{document_id}/' f'?include_extractions={include_extractions}&extra_fields={extra_fields}' ) def get_project_url(project_id=None) -> str: """ Generate URL to get project details. :param project_id: ID of the project :return: URL to get project details. """ project_id = project_id if project_id else KONFUZIO_PROJECT_ID return f'{KONFUZIO_HOST}/api/projects/{project_id}/' def post_project_api_document_annotations_url(document_id: int) -> str: """ Add new annotations to a document. :param document_id: ID of the document as integer :return: URL for adding annotations to a document """ return f'{KONFUZIO_HOST}/api/projects/{KONFUZIO_PROJECT_ID}/docs/{document_id}/annotations/' def delete_project_api_document_annotations_url(document_id: int, annotation_id: int) -> str: """ Delete the annotation of a document. :param document_id: ID of the document as integer :param annotation_id: ID of the annotation as integer :return: URL to delete annotation of a document """ return f'{KONFUZIO_HOST}/api/projects/{KONFUZIO_PROJECT_ID}/docs/{document_id}/' f'annotations/{annotation_id}/' def get_document_result_v1(document_id: int) -> str: """ Generate URL to access web interface for labeling of this project. :param document_id: ID of the document as integer :return: URL for labeling of the project. """ return f'{KONFUZIO_HOST}/api/v1/docs/{document_id}/' def get_document_segmentation_details_url(document_id: int, project_id, action='segmentation') -> str: """ Generate URL to get the segmentation results of a document. :param document_id: ID of the document as integer :param project_id: ID of the project :param action: Action from where to get the results :return: URL to access the segmentation results of a document """ return f'https://app.konfuzio.com/api/projects/{project_id}/docs/{document_id}/{action}/'
[ 37811, 12915, 13033, 286, 262, 17431, 69, 10277, 952, 14504, 526, 15931, 198, 198, 11748, 18931, 198, 198, 6738, 479, 261, 69, 10277, 952, 62, 21282, 74, 1330, 509, 1340, 38989, 57, 9399, 62, 39, 10892, 11, 509, 1340, 38989, 57, 9399, 62, 31190, 23680, 62, 2389, 198, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 198, 4299, 651, 62, 18439, 62, 30001, 62, 6371, 3419, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 326, 8075, 281, 18239, 11241, 329, 262, 2836, 13, 628, 220, 220, 220, 1058, 7783, 25, 10289, 284, 7716, 262, 11241, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 1, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 30001, 12, 18439, 30487, 628, 198, 4299, 651, 62, 16302, 62, 4868, 62, 6371, 3419, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 3440, 477, 262, 4493, 1695, 329, 262, 2836, 13, 628, 220, 220, 220, 1058, 7783, 25, 10289, 284, 651, 477, 262, 4493, 329, 262, 2836, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 1, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 42068, 30487, 628, 198, 4299, 2251, 62, 3605, 62, 16302, 62, 6371, 3419, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 2251, 257, 649, 1628, 13, 628, 220, 220, 220, 1058, 7783, 25, 10289, 284, 2251, 257, 649, 1628, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 1, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 42068, 30487, 628, 198, 4299, 651, 62, 15390, 2886, 62, 28961, 62, 6371, 3419, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 3440, 13634, 1321, 546, 4963, 13, 628, 220, 220, 220, 1058, 7783, 25, 10289, 284, 651, 477, 262, 4963, 3307, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 1, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 42068, 14, 90, 42, 1340, 38989, 57, 9399, 62, 31190, 23680, 62, 2389, 92, 14, 31628, 30487, 628, 198, 4299, 651, 62, 25850, 62, 22897, 62, 6371, 3419, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 9516, 257, 3188, 13, 628, 220, 220, 220, 1058, 7783, 25, 10289, 284, 9516, 257, 3188, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 1, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 85, 17, 14, 31628, 30487, 628, 198, 4299, 651, 62, 17953, 62, 18242, 62, 6371, 3419, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 2251, 257, 6167, 13, 628, 220, 220, 220, 1058, 7783, 25, 10289, 284, 2251, 257, 6167, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 1, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 85, 17, 14, 23912, 1424, 30487, 628, 198, 4299, 651, 62, 22897, 62, 1696, 62, 7753, 62, 6371, 7, 22897, 62, 312, 25, 493, 8, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 1895, 440, 9419, 2196, 286, 3188, 13, 628, 220, 220, 220, 1058, 17143, 3188, 62, 312, 25, 4522, 286, 262, 3188, 355, 18253, 198, 220, 220, 220, 1058, 7783, 25, 10289, 284, 651, 440, 9419, 3188, 2393, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 6, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15390, 14, 12860, 14, 90, 22897, 62, 312, 92, 14, 6, 628, 198, 4299, 651, 62, 22897, 62, 14986, 62, 7753, 62, 6371, 7, 22897, 62, 312, 25, 493, 8, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 1895, 2656, 2196, 286, 262, 3188, 13, 628, 220, 220, 220, 1058, 17143, 3188, 62, 312, 25, 4522, 286, 262, 3188, 355, 18253, 198, 220, 220, 220, 1058, 7783, 25, 10289, 284, 651, 262, 2656, 3188, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 6, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15390, 14, 12860, 12, 14986, 14, 90, 22897, 62, 312, 92, 14, 6, 628, 198, 4299, 651, 62, 22897, 62, 15042, 62, 36604, 62, 6371, 7, 22897, 62, 312, 25, 493, 11, 2291, 62, 2302, 37810, 25, 20512, 796, 10352, 11, 3131, 62, 25747, 11639, 65, 3524, 11537, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 1895, 3188, 3307, 286, 530, 3188, 287, 257, 1628, 13, 628, 220, 220, 220, 1058, 17143, 3188, 62, 312, 25, 4522, 286, 262, 3188, 355, 18253, 198, 220, 220, 220, 1058, 17143, 2291, 62, 2302, 37810, 25, 347, 970, 284, 2291, 7925, 507, 198, 220, 220, 220, 1058, 17143, 3131, 62, 25747, 25, 17221, 1321, 284, 2291, 287, 262, 2882, 198, 220, 220, 220, 1058, 7783, 25, 10289, 284, 651, 3188, 3307, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 357, 198, 220, 220, 220, 220, 220, 220, 220, 277, 6, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 42068, 14, 90, 42, 1340, 38989, 57, 9399, 62, 31190, 23680, 62, 2389, 92, 14, 31628, 14, 90, 22897, 62, 312, 92, 14, 6, 198, 220, 220, 220, 220, 220, 220, 220, 277, 30960, 17256, 62, 2302, 37810, 34758, 17256, 62, 2302, 37810, 92, 5, 26086, 62, 25747, 34758, 26086, 62, 25747, 92, 6, 198, 220, 220, 220, 1267, 628, 198, 4299, 651, 62, 16302, 62, 6371, 7, 16302, 62, 312, 28, 14202, 8, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 651, 1628, 3307, 13, 628, 220, 220, 220, 1058, 17143, 1628, 62, 312, 25, 4522, 286, 262, 1628, 198, 220, 220, 220, 1058, 7783, 25, 10289, 284, 651, 1628, 3307, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1628, 62, 312, 796, 1628, 62, 312, 611, 1628, 62, 312, 2073, 509, 1340, 38989, 57, 9399, 62, 31190, 23680, 62, 2389, 198, 220, 220, 220, 1441, 277, 6, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 42068, 14, 90, 16302, 62, 312, 92, 14, 6, 628, 198, 4299, 1281, 62, 16302, 62, 15042, 62, 22897, 62, 34574, 602, 62, 6371, 7, 22897, 62, 312, 25, 493, 8, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3060, 649, 37647, 284, 257, 3188, 13, 628, 220, 220, 220, 1058, 17143, 3188, 62, 312, 25, 4522, 286, 262, 3188, 355, 18253, 198, 220, 220, 220, 1058, 7783, 25, 10289, 329, 4375, 37647, 284, 257, 3188, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 6, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 42068, 14, 90, 42, 1340, 38989, 57, 9399, 62, 31190, 23680, 62, 2389, 92, 14, 31628, 14, 90, 22897, 62, 312, 92, 14, 34574, 602, 14, 6, 628, 198, 4299, 12233, 62, 16302, 62, 15042, 62, 22897, 62, 34574, 602, 62, 6371, 7, 22897, 62, 312, 25, 493, 11, 23025, 62, 312, 25, 493, 8, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 23520, 262, 23025, 286, 257, 3188, 13, 628, 220, 220, 220, 1058, 17143, 3188, 62, 312, 25, 4522, 286, 262, 3188, 355, 18253, 198, 220, 220, 220, 1058, 17143, 23025, 62, 312, 25, 4522, 286, 262, 23025, 355, 18253, 198, 220, 220, 220, 1058, 7783, 25, 10289, 284, 12233, 23025, 286, 257, 3188, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 6, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 42068, 14, 90, 42, 1340, 38989, 57, 9399, 62, 31190, 23680, 62, 2389, 92, 14, 31628, 14, 90, 22897, 62, 312, 92, 14, 6, 277, 6, 34574, 602, 14, 90, 1236, 14221, 62, 312, 92, 14, 6, 628, 198, 4299, 651, 62, 22897, 62, 20274, 62, 85, 16, 7, 22897, 62, 312, 25, 493, 8, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 1895, 3992, 7071, 329, 27393, 286, 428, 1628, 13, 628, 220, 220, 220, 1058, 17143, 3188, 62, 312, 25, 4522, 286, 262, 3188, 355, 18253, 198, 220, 220, 220, 1058, 7783, 25, 10289, 329, 27393, 286, 262, 1628, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 6, 90, 42, 1340, 38989, 57, 9399, 62, 39, 10892, 92, 14, 15042, 14, 85, 16, 14, 31628, 14, 90, 22897, 62, 312, 92, 14, 6, 628, 198, 4299, 651, 62, 22897, 62, 325, 5154, 341, 62, 36604, 62, 6371, 7, 22897, 62, 312, 25, 493, 11, 1628, 62, 312, 11, 2223, 11639, 325, 5154, 341, 11537, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2980, 378, 10289, 284, 651, 262, 10618, 341, 2482, 286, 257, 3188, 13, 628, 220, 220, 220, 1058, 17143, 3188, 62, 312, 25, 4522, 286, 262, 3188, 355, 18253, 198, 220, 220, 220, 1058, 17143, 1628, 62, 312, 25, 4522, 286, 262, 1628, 198, 220, 220, 220, 1058, 17143, 2223, 25, 7561, 422, 810, 284, 651, 262, 2482, 198, 220, 220, 220, 1058, 7783, 25, 10289, 284, 1895, 262, 10618, 341, 2482, 286, 257, 3188, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 277, 6, 5450, 1378, 1324, 13, 74, 261, 69, 10277, 952, 13, 785, 14, 15042, 14, 42068, 14, 90, 16302, 62, 312, 92, 14, 31628, 14, 90, 22897, 62, 312, 92, 14, 90, 2673, 92, 14, 6, 198 ]
2.701894
1,637
from django.db import models from django.contrib.auth.models import AbstractUser from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.base_user import BaseUserManager # Create your models here.
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 27741, 12982, 198, 6738, 42625, 14208, 13, 26791, 13, 41519, 1330, 334, 1136, 5239, 62, 75, 12582, 355, 4808, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 8692, 62, 7220, 1330, 7308, 12982, 13511, 198, 198, 2, 13610, 534, 4981, 994, 13, 628, 198 ]
3.461538
65
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import subprocess from argparse import ArgumentParser from getpass import getpass from typing import List, Union from huggingface_hub.commands import BaseHuggingfaceCLICommand from huggingface_hub.constants import ( REPO_TYPES, REPO_TYPES_URL_PREFIXES, SPACES_SDK_TYPES, ) from huggingface_hub.hf_api import HfApi, HfFolder from requests.exceptions import HTTPError class ANSI: """ Helper for en.wikipedia.org/wiki/ANSI_escape_code """ _bold = "\u001b[1m" _red = "\u001b[31m" _gray = "\u001b[90m" _reset = "\u001b[0m" @classmethod @classmethod @classmethod def tabulate(rows: List[List[Union[str, int]]], headers: List[str]) -> str: """ Inspired by: - stackoverflow.com/a/8356620/593036 - stackoverflow.com/questions/9535954/printing-lists-as-tabular-data """ col_widths = [max(len(str(x)) for x in col) for col in zip(*rows, headers)] row_format = ("{{:{}}} " * len(headers)).format(*col_widths) lines = [] lines.append(row_format.format(*headers)) lines.append(row_format.format(*["-" * w for w in col_widths])) for row in rows: lines.append(row_format.format(*row)) return "\n".join(lines) NOTEBOOK_LOGIN_PASSWORD_HTML = """<center> <img src=https://huggingface.co/front/assets/huggingface_logo-noborder.svg alt='Hugging Face'> <br> Immediately click login after typing your password or it might be stored in plain text in this notebook file. </center>""" NOTEBOOK_LOGIN_TOKEN_HTML_START = """<center> <img src=https://huggingface.co/front/assets/huggingface_logo-noborder.svg alt='Hugging Face'> <br> Copy a token from <a href="https://huggingface.co/settings/tokens" target="_blank">your Hugging Face tokens page</a> and paste it below. <br> Immediately click login after copying your token or it might be stored in plain text in this notebook file. </center>""" NOTEBOOK_LOGIN_TOKEN_HTML_END = """ <b>Pro Tip:</b> If you don't already have one, you can create a dedicated 'notebooks' token with 'write' access, that you can then easily reuse for all notebooks. <br> <i>Logging in with your username and password is deprecated and won't be possible anymore in the near future. You can still use them for now by clicking below.</i> </center>""" def notebook_login(): """ Displays a widget to login to the HF website and store the token. """ try: import ipywidgets.widgets as widgets from IPython.display import clear_output, display except ImportError: raise ImportError( "The `notebook_login` function can only be used in a notebook (Jupyter or Colab) and you need the " "`ipywdidgets` module: `pip install ipywidgets`." ) box_layout = widgets.Layout( display="flex", flex_flow="column", align_items="center", width="50%" ) token_widget = widgets.Password(description="Token:") token_finish_button = widgets.Button(description="Login") switch_button = widgets.Button(description="Use password") login_token_widget = widgets.VBox( [ widgets.HTML(NOTEBOOK_LOGIN_TOKEN_HTML_START), token_widget, token_finish_button, widgets.HTML(NOTEBOOK_LOGIN_TOKEN_HTML_END), switch_button, ], layout=box_layout, ) display(login_token_widget) # Deprecated page for login input_widget = widgets.Text(description="Username:") password_widget = widgets.Password(description="Password:") password_finish_button = widgets.Button(description="Login") login_password_widget = widgets.VBox( [ widgets.HTML(value=NOTEBOOK_LOGIN_PASSWORD_HTML), widgets.HBox([input_widget, password_widget]), password_finish_button, ], layout=box_layout, ) # On click events token_finish_button.on_click(login_token_event) password_finish_button.on_click(login_password_event) switch_button.on_click(switch_event)
[ 2, 15069, 12131, 383, 12905, 2667, 32388, 4816, 13, 1439, 2489, 10395, 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, 11748, 850, 14681, 198, 6738, 1822, 29572, 1330, 45751, 46677, 198, 6738, 651, 6603, 1330, 651, 6603, 198, 6738, 19720, 1330, 7343, 11, 4479, 198, 198, 6738, 46292, 2550, 62, 40140, 13, 9503, 1746, 1330, 7308, 48098, 2667, 2550, 5097, 2149, 2002, 392, 198, 6738, 46292, 2550, 62, 40140, 13, 9979, 1187, 1330, 357, 198, 220, 220, 220, 4526, 16402, 62, 9936, 47, 1546, 11, 198, 220, 220, 220, 4526, 16402, 62, 9936, 47, 1546, 62, 21886, 62, 47, 31688, 10426, 1546, 11, 198, 220, 220, 220, 6226, 2246, 1546, 62, 10305, 42, 62, 9936, 47, 1546, 11, 198, 8, 198, 6738, 46292, 2550, 62, 40140, 13, 71, 69, 62, 15042, 1330, 367, 69, 32, 14415, 11, 367, 69, 41092, 198, 6738, 7007, 13, 1069, 11755, 1330, 14626, 12331, 628, 198, 198, 4871, 3537, 11584, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5053, 525, 329, 551, 13, 31266, 13, 2398, 14, 15466, 14, 1565, 11584, 62, 41915, 62, 8189, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 4808, 36575, 796, 37082, 84, 8298, 65, 58, 16, 76, 1, 198, 220, 220, 220, 4808, 445, 796, 37082, 84, 8298, 65, 58, 3132, 76, 1, 198, 220, 220, 220, 4808, 44605, 796, 37082, 84, 8298, 65, 58, 3829, 76, 1, 198, 220, 220, 220, 4808, 42503, 796, 37082, 84, 8298, 65, 58, 15, 76, 1, 628, 220, 220, 220, 2488, 4871, 24396, 628, 220, 220, 220, 2488, 4871, 24396, 628, 220, 220, 220, 2488, 4871, 24396, 628, 198, 4299, 7400, 5039, 7, 8516, 25, 7343, 58, 8053, 58, 38176, 58, 2536, 11, 493, 11907, 4357, 24697, 25, 7343, 58, 2536, 12962, 4613, 965, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 45827, 416, 25, 628, 220, 220, 220, 532, 8931, 2502, 11125, 13, 785, 14, 64, 14, 23, 2327, 2791, 1238, 14, 3270, 1270, 2623, 198, 220, 220, 220, 532, 8931, 2502, 11125, 13, 785, 14, 6138, 507, 14, 3865, 2327, 48372, 14, 4798, 278, 12, 20713, 12, 292, 12, 8658, 934, 12, 7890, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 951, 62, 10394, 82, 796, 685, 9806, 7, 11925, 7, 2536, 7, 87, 4008, 329, 2124, 287, 951, 8, 329, 951, 287, 19974, 46491, 8516, 11, 24697, 15437, 198, 220, 220, 220, 5752, 62, 18982, 796, 5855, 27007, 29164, 42535, 366, 1635, 18896, 7, 50145, 29720, 18982, 46491, 4033, 62, 10394, 82, 8, 198, 220, 220, 220, 3951, 796, 17635, 198, 220, 220, 220, 3951, 13, 33295, 7, 808, 62, 18982, 13, 18982, 46491, 50145, 4008, 198, 220, 220, 220, 3951, 13, 33295, 7, 808, 62, 18982, 13, 18982, 46491, 14692, 21215, 1635, 266, 329, 266, 287, 951, 62, 10394, 82, 60, 4008, 198, 220, 220, 220, 329, 5752, 287, 15274, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3951, 13, 33295, 7, 808, 62, 18982, 13, 18982, 46491, 808, 4008, 198, 220, 220, 220, 1441, 37082, 77, 1911, 22179, 7, 6615, 8, 628, 628, 628, 628, 198, 16580, 39453, 62, 25294, 1268, 62, 47924, 54, 12532, 62, 28656, 796, 37227, 27, 16159, 29, 1279, 9600, 198, 10677, 28, 5450, 1378, 71, 1018, 2667, 2550, 13, 1073, 14, 8534, 14, 19668, 14, 71, 1018, 2667, 2550, 62, 6404, 78, 12, 34952, 2875, 13, 21370, 70, 198, 2501, 11639, 48098, 2667, 15399, 44167, 1279, 1671, 29, 34528, 3904, 17594, 706, 19720, 534, 9206, 393, 198, 270, 1244, 307, 8574, 287, 8631, 2420, 287, 428, 20922, 2393, 13, 7359, 16159, 29, 37811, 628, 198, 16580, 39453, 62, 25294, 1268, 62, 10468, 43959, 62, 28656, 62, 2257, 7227, 796, 37227, 27, 16159, 29, 1279, 9600, 198, 10677, 28, 5450, 1378, 71, 1018, 2667, 2550, 13, 1073, 14, 8534, 14, 19668, 14, 71, 1018, 2667, 2550, 62, 6404, 78, 12, 34952, 2875, 13, 21370, 70, 198, 2501, 11639, 48098, 2667, 15399, 44167, 1279, 1671, 29, 17393, 257, 11241, 422, 1279, 64, 198, 33257, 2625, 5450, 1378, 71, 1018, 2667, 2550, 13, 1073, 14, 33692, 14, 83, 482, 641, 1, 2496, 2625, 62, 27190, 5320, 14108, 12905, 2667, 15399, 198, 83, 482, 641, 2443, 3556, 64, 29, 290, 17008, 340, 2174, 13, 1279, 1671, 29, 34528, 3904, 17594, 706, 23345, 198, 14108, 11241, 393, 340, 1244, 307, 8574, 287, 8631, 2420, 287, 428, 20922, 2393, 13, 7359, 16159, 29, 37811, 628, 198, 16580, 39453, 62, 25294, 1268, 62, 10468, 43959, 62, 28656, 62, 10619, 796, 37227, 198, 27, 65, 29, 2964, 23095, 25, 3556, 65, 29, 1002, 345, 836, 470, 1541, 423, 530, 11, 345, 460, 2251, 257, 7256, 198, 6, 11295, 12106, 6, 11241, 351, 705, 13564, 6, 1895, 11, 326, 345, 460, 788, 3538, 32349, 329, 477, 198, 11295, 12106, 13, 1279, 1671, 29, 1279, 72, 29, 11187, 2667, 287, 351, 534, 20579, 290, 9206, 318, 39224, 290, 198, 26502, 470, 307, 1744, 7471, 287, 262, 1474, 2003, 13, 921, 460, 991, 779, 606, 329, 783, 416, 198, 565, 7958, 2174, 25970, 72, 29, 7359, 16159, 29, 37811, 628, 198, 4299, 20922, 62, 38235, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3167, 26024, 257, 26295, 284, 17594, 284, 262, 42253, 3052, 290, 3650, 262, 11241, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1330, 20966, 88, 28029, 11407, 13, 28029, 11407, 355, 40803, 198, 220, 220, 220, 220, 220, 220, 220, 422, 6101, 7535, 13, 13812, 1330, 1598, 62, 22915, 11, 3359, 198, 220, 220, 220, 2845, 17267, 12331, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 17267, 12331, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 464, 4600, 11295, 2070, 62, 38235, 63, 2163, 460, 691, 307, 973, 287, 257, 20922, 357, 41, 929, 88, 353, 393, 1623, 397, 8, 290, 345, 761, 262, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 63, 541, 88, 16993, 312, 11407, 63, 8265, 25, 4600, 79, 541, 2721, 20966, 88, 28029, 11407, 63, 526, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 3091, 62, 39786, 796, 40803, 13, 32517, 7, 198, 220, 220, 220, 220, 220, 220, 220, 3359, 2625, 32880, 1600, 7059, 62, 11125, 2625, 28665, 1600, 10548, 62, 23814, 2625, 16159, 1600, 9647, 2625, 1120, 39658, 198, 220, 220, 220, 1267, 628, 220, 220, 220, 11241, 62, 42655, 796, 40803, 13, 35215, 7, 11213, 2625, 30642, 25, 4943, 198, 220, 220, 220, 11241, 62, 15643, 680, 62, 16539, 796, 40803, 13, 21864, 7, 11213, 2625, 47790, 4943, 198, 220, 220, 220, 5078, 62, 16539, 796, 40803, 13, 21864, 7, 11213, 2625, 11041, 9206, 4943, 628, 220, 220, 220, 17594, 62, 30001, 62, 42655, 796, 40803, 13, 53, 14253, 7, 198, 220, 220, 220, 220, 220, 220, 220, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 40803, 13, 28656, 7, 16580, 39453, 62, 25294, 1268, 62, 10468, 43959, 62, 28656, 62, 2257, 7227, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11241, 62, 42655, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11241, 62, 15643, 680, 62, 16539, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 40803, 13, 28656, 7, 16580, 39453, 62, 25294, 1268, 62, 10468, 43959, 62, 28656, 62, 10619, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5078, 62, 16539, 11, 198, 220, 220, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 220, 220, 12461, 28, 3524, 62, 39786, 11, 198, 220, 220, 220, 1267, 198, 220, 220, 220, 3359, 7, 38235, 62, 30001, 62, 42655, 8, 628, 220, 220, 220, 1303, 2129, 31023, 2443, 329, 17594, 198, 220, 220, 220, 5128, 62, 42655, 796, 40803, 13, 8206, 7, 11213, 2625, 5842, 13292, 25, 4943, 198, 220, 220, 220, 9206, 62, 42655, 796, 40803, 13, 35215, 7, 11213, 2625, 35215, 25, 4943, 198, 220, 220, 220, 9206, 62, 15643, 680, 62, 16539, 796, 40803, 13, 21864, 7, 11213, 2625, 47790, 4943, 628, 220, 220, 220, 17594, 62, 28712, 62, 42655, 796, 40803, 13, 53, 14253, 7, 198, 220, 220, 220, 220, 220, 220, 220, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 40803, 13, 28656, 7, 8367, 28, 16580, 39453, 62, 25294, 1268, 62, 47924, 54, 12532, 62, 28656, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 40803, 13, 39, 14253, 26933, 15414, 62, 42655, 11, 9206, 62, 42655, 46570, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 9206, 62, 15643, 680, 62, 16539, 11, 198, 220, 220, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 220, 220, 12461, 28, 3524, 62, 39786, 11, 198, 220, 220, 220, 1267, 628, 220, 220, 220, 1303, 1550, 3904, 2995, 628, 220, 220, 220, 11241, 62, 15643, 680, 62, 16539, 13, 261, 62, 12976, 7, 38235, 62, 30001, 62, 15596, 8, 628, 220, 220, 220, 9206, 62, 15643, 680, 62, 16539, 13, 261, 62, 12976, 7, 38235, 62, 28712, 62, 15596, 8, 628, 220, 220, 220, 5078, 62, 16539, 13, 261, 62, 12976, 7, 31943, 62, 15596, 8, 628 ]
2.735068
1,691
# -*- coding: utf-8 -*- # # ramstk.logger.py is part of The RAMSTK Project # # All rights reserved. # Copyright 2019 Doyle Rowland doyle.rowland <AT> reliaqual <DOT> com """RAMSTK Logger Module.""" # Standard Library Imports import logging import sys from typing import Dict # Third Party Imports from pubsub import pub LOGFORMAT = logging.Formatter("%(asctime)s - %(name)s - %(lineno)s : %(message)s") class RAMSTKLogManager: """Class to manage logging of RAMSTK messages.""" loggers: Dict[str, logging.Logger] = {} def __init__(self, log_file: str) -> None: """Initialize an instance of the LogManager. :param log_file: the absolute path to the log file to use with this log manager. """ # Initialize private dictionary attributes. # Initialize private list attributes. # Initialize private scalar attributes. # Initialize public dictionary attributes. # Initialize public list attributes. # Initialize public scalar attributes. self.log_file = log_file # Subscribe to PyPubSub messages. pub.subscribe(self._do_log_fail_message, "fail_connect_program_database") pub.subscribe(self._do_log_fail_message, "fail_delete_environment") pub.subscribe(self._do_log_fail_message, "fail_delete_failure_definition") pub.subscribe(self._do_log_fail_message, "fail_delete_fmea") pub.subscribe(self._do_log_fail_message, "fail_delete_function") pub.subscribe(self._do_log_fail_message, "fail_delete_hazard") pub.subscribe(self._do_log_fail_message, "fail_delete_mission") pub.subscribe(self._do_log_fail_message, "fail_delete_mission_phase") pub.subscribe(self._do_log_fail_message, "fail_delete_revision") pub.subscribe(self._do_log_fail_message, "fail_import_module") pub.subscribe(self._do_log_fail_message, "fail_insert_action") pub.subscribe(self._do_log_fail_message, "fail_insert_cause") pub.subscribe(self._do_log_fail_message, "fail_insert_control") pub.subscribe(self._do_log_fail_message, "fail_insert_environment") pub.subscribe(self._do_log_fail_message, "fail_insert_failure_definition") pub.subscribe(self._do_log_fail_message, "fail_insert_mechanism") pub.subscribe(self._do_log_fail_message, "fail_insert_mission") pub.subscribe(self._do_log_fail_message, "fail_insert_mission_phase") pub.subscribe(self._do_log_fail_message, "fail_insert_mode") pub.subscribe(self._do_log_fail_message, "fail_insert_function") pub.subscribe(self._do_log_fail_message, "fail_insert_hazard") pub.subscribe(self._do_log_fail_message, "fail_insert_hardware") pub.subscribe(self._do_log_fail_message, "fail_insert_validation") pub.subscribe(self._do_log_fail_message, "fail_insert_stakeholder") pub.subscribe(self._do_log_fail_message, "fail_insert_revision") pub.subscribe(self._do_log_fail_message, "fail_insert_requirement") pub.subscribe(self._do_log_fail_message, "fail_insert_opload") pub.subscribe(self._do_log_fail_message, "fail_insert_opstress") pub.subscribe(self._do_log_fail_message, "fail_insert_record") pub.subscribe(self._do_log_fail_message, "fail_insert_test_method") pub.subscribe(self._do_log_fail_message, "fail_update_fmea") pub.subscribe(self._do_log_fail_message, "fail_update_function") pub.subscribe(self._do_log_fail_message, "fail_update_hardware") pub.subscribe(self._do_log_fail_message, "fail_update_record") pub.subscribe(self._do_log_fail_message, "fail_update_requirement") pub.subscribe(self._do_log_fail_message, "fail_update_revision") pub.subscribe(self.do_log_debug, "do_log_debug_msg") pub.subscribe(self.do_log_info, "do_log_info_msg") pub.subscribe(self.do_log_warning, "do_log_warning_msg") pub.subscribe(self.do_log_error, "do_log_error_msg") pub.subscribe(self.do_log_critical, "do_log_critical_msg") # Create a logger for the pypubsub fail_* messages. self.do_create_logger(__name__, "WARN") def _do_log_fail_message(self, error_message: str) -> None: """Log PyPubSub broadcast fail messages. :param error_message: the error message that was part of the broadcast package. :return: None :rtype: None """ self.loggers[__name__].warning(error_message) @staticmethod def _get_console_handler(log_level: str) -> logging.Handler: """Create the log handler for console output. :return: _c_handler :rtype: :class:`logging.Handler` """ _c_handler = logging.StreamHandler(sys.stdout) _c_handler.setLevel(log_level) _c_handler.setFormatter(LOGFORMAT) return _c_handler def _get_file_handler(self, log_level: str) -> logging.Handler: """Create the log handler for file output. :return: _f_handler :rtype: :class:`logging.Handler` """ _f_handler = logging.FileHandler(self.log_file) _f_handler.setLevel(log_level) _f_handler.setFormatter(LOGFORMAT) return _f_handler def do_create_logger( self, logger_name: str, log_level: str, to_tty: bool = False ) -> None: """Create a logger instance. :param logger_name: the name of the logger used in the application. :param log_level: the level of messages to log. :param to_tty: boolean indicating whether this logger will also dump messages to the terminal. :return: None :rtype: None """ _logger = logging.getLogger(logger_name) _logger.setLevel(log_level) _logger.addHandler(self._get_file_handler(log_level)) if to_tty: _logger.addHandler(self._get_console_handler(log_level)) self.loggers[logger_name] = _logger def do_log_debug(self, logger_name: str, message: str) -> None: """Log DEBUG level messages. :param logger_name: the name of the logger used in the application. :param message: the message to log. :return: None :rtype: None """ if self.loggers[logger_name].isEnabledFor(logging.DEBUG): self.loggers[logger_name].debug(message) def do_log_exception(self, logger_name: str, exception: object) -> None: """Log EXCEPTIONS. :param logger_name: the name of the logger used in the application. :param exception: the exception to log. :return: None :rtype: None """ if self.loggers[logger_name].isEnabledFor(logging.WARNING): self.loggers[logger_name].exception(exception) def do_log_info(self, logger_name: str, message: str) -> None: """Log INFO level messages. :param logger_name: the name of the logger used in the application. :param message: the message to log. :return: None :rtype: None """ if self.loggers[logger_name].isEnabledFor(logging.INFO): self.loggers[logger_name].info(message) def do_log_warning(self, logger_name: str, message: str) -> None: """Log WARN level messages. :param logger_name: the name of the logger used in the application. :param message: the message to log. :return: None :rtype: None """ if self.loggers[logger_name].isEnabledFor(logging.WARNING): self.loggers[logger_name].warning(message) def do_log_error(self, logger_name: str, message: str) -> None: """Log ERROR level messages. :param logger_name: the name of the logger used in the application. :param message: the message to log. :return: None :rtype: None """ if self.loggers[logger_name].isEnabledFor(logging.ERROR): self.loggers[logger_name].error(message) def do_log_critical(self, logger_name: str, message: str) -> None: """Log CRITICAL level messages. :param logger_name: the name of the logger used in the application. :param message: the message to log. :return: None :rtype: None """ self.loggers[logger_name].critical(message)
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 220, 220, 220, 220, 220, 220, 15770, 301, 74, 13, 6404, 1362, 13, 9078, 318, 636, 286, 383, 13931, 2257, 42, 4935, 198, 2, 198, 2, 1439, 2489, 10395, 13, 198, 2, 15069, 13130, 31233, 11314, 1044, 466, 2349, 13, 808, 1044, 1279, 1404, 29, 823, 544, 13255, 1279, 35, 2394, 29, 401, 198, 37811, 24115, 2257, 42, 5972, 1362, 19937, 526, 15931, 198, 198, 2, 8997, 10074, 1846, 3742, 198, 11748, 18931, 198, 11748, 25064, 198, 6738, 19720, 1330, 360, 713, 198, 198, 2, 10467, 3615, 1846, 3742, 198, 6738, 2240, 7266, 1330, 2240, 198, 198, 25294, 21389, 1404, 796, 18931, 13, 8479, 1436, 7203, 4, 7, 292, 310, 524, 8, 82, 532, 4064, 7, 3672, 8, 82, 532, 4064, 7, 2815, 23397, 8, 82, 1058, 4064, 7, 20500, 8, 82, 4943, 628, 198, 4871, 13931, 2257, 42, 11187, 13511, 25, 198, 220, 220, 220, 37227, 9487, 284, 6687, 18931, 286, 13931, 2257, 42, 6218, 526, 15931, 628, 220, 220, 220, 2604, 5355, 25, 360, 713, 58, 2536, 11, 18931, 13, 11187, 1362, 60, 796, 23884, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 2604, 62, 7753, 25, 965, 8, 4613, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 24243, 1096, 281, 4554, 286, 262, 5972, 13511, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 2604, 62, 7753, 25, 262, 4112, 3108, 284, 262, 2604, 2393, 284, 779, 351, 428, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2604, 4706, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 20768, 1096, 2839, 22155, 12608, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 20768, 1096, 2839, 1351, 12608, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 20768, 1096, 2839, 16578, 283, 12608, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 20768, 1096, 1171, 22155, 12608, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 20768, 1096, 1171, 1351, 12608, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 20768, 1096, 1171, 16578, 283, 12608, 13, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 62, 7753, 796, 2604, 62, 7753, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 19808, 284, 9485, 14876, 7004, 6218, 13, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 8443, 62, 23065, 62, 48806, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 33678, 62, 38986, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 33678, 62, 32165, 495, 62, 46758, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 33678, 62, 69, 1326, 64, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 33678, 62, 8818, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 33678, 62, 37598, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 33678, 62, 3411, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 33678, 62, 3411, 62, 40715, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 33678, 62, 260, 10178, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 11748, 62, 21412, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 2673, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 25587, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 13716, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 38986, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 32165, 495, 62, 46758, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 1326, 3147, 1042, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 3411, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 3411, 62, 40715, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 14171, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 8818, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 37598, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 10424, 1574, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 12102, 341, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 301, 539, 13829, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 260, 10178, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 8897, 24615, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 404, 2220, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 404, 41494, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 22105, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 28463, 62, 9288, 62, 24396, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 19119, 62, 69, 1326, 64, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 19119, 62, 8818, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 19119, 62, 10424, 1574, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 19119, 62, 22105, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 19119, 62, 8897, 24615, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13557, 4598, 62, 6404, 62, 32165, 62, 20500, 11, 366, 32165, 62, 19119, 62, 260, 10178, 4943, 628, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13, 4598, 62, 6404, 62, 24442, 11, 366, 4598, 62, 6404, 62, 24442, 62, 19662, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13, 4598, 62, 6404, 62, 10951, 11, 366, 4598, 62, 6404, 62, 10951, 62, 19662, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13, 4598, 62, 6404, 62, 43917, 11, 366, 4598, 62, 6404, 62, 43917, 62, 19662, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13, 4598, 62, 6404, 62, 18224, 11, 366, 4598, 62, 6404, 62, 18224, 62, 19662, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2240, 13, 7266, 12522, 7, 944, 13, 4598, 62, 6404, 62, 34666, 11, 366, 4598, 62, 6404, 62, 34666, 62, 19662, 4943, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 13610, 257, 49706, 329, 262, 279, 4464, 549, 7266, 2038, 62, 9, 6218, 13, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 4598, 62, 17953, 62, 6404, 1362, 7, 834, 3672, 834, 11, 366, 37771, 4943, 628, 220, 220, 220, 825, 4808, 4598, 62, 6404, 62, 32165, 62, 20500, 7, 944, 11, 4049, 62, 20500, 25, 965, 8, 4613, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 11187, 9485, 14876, 7004, 7025, 2038, 6218, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 4049, 62, 20500, 25, 262, 4049, 3275, 326, 373, 636, 286, 262, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7025, 5301, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 5355, 58, 834, 3672, 834, 4083, 43917, 7, 18224, 62, 20500, 8, 628, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 4808, 1136, 62, 41947, 62, 30281, 7, 6404, 62, 5715, 25, 965, 8, 4613, 18931, 13, 25060, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 16447, 262, 2604, 21360, 329, 8624, 5072, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 4808, 66, 62, 30281, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 1058, 4871, 25, 63, 6404, 2667, 13, 25060, 63, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 66, 62, 30281, 796, 18931, 13, 12124, 25060, 7, 17597, 13, 19282, 448, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 66, 62, 30281, 13, 2617, 4971, 7, 6404, 62, 5715, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 66, 62, 30281, 13, 2617, 8479, 1436, 7, 25294, 21389, 1404, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 4808, 66, 62, 30281, 628, 220, 220, 220, 825, 4808, 1136, 62, 7753, 62, 30281, 7, 944, 11, 2604, 62, 5715, 25, 965, 8, 4613, 18931, 13, 25060, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 16447, 262, 2604, 21360, 329, 2393, 5072, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 4808, 69, 62, 30281, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 1058, 4871, 25, 63, 6404, 2667, 13, 25060, 63, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 69, 62, 30281, 796, 18931, 13, 8979, 25060, 7, 944, 13, 6404, 62, 7753, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 69, 62, 30281, 13, 2617, 4971, 7, 6404, 62, 5715, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 69, 62, 30281, 13, 2617, 8479, 1436, 7, 25294, 21389, 1404, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 4808, 69, 62, 30281, 628, 220, 220, 220, 825, 466, 62, 17953, 62, 6404, 1362, 7, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 11, 49706, 62, 3672, 25, 965, 11, 2604, 62, 5715, 25, 965, 11, 284, 62, 42852, 25, 20512, 796, 10352, 198, 220, 220, 220, 1267, 4613, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 16447, 257, 49706, 4554, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 49706, 62, 3672, 25, 262, 1438, 286, 262, 49706, 973, 287, 262, 3586, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 2604, 62, 5715, 25, 262, 1241, 286, 6218, 284, 2604, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 284, 62, 42852, 25, 25131, 12739, 1771, 428, 49706, 481, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 635, 10285, 6218, 284, 262, 12094, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 6404, 1362, 62, 3672, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 13, 2617, 4971, 7, 6404, 62, 5715, 8, 628, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 13, 2860, 25060, 7, 944, 13557, 1136, 62, 7753, 62, 30281, 7, 6404, 62, 5715, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 611, 284, 62, 42852, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 13, 2860, 25060, 7, 944, 13557, 1136, 62, 41947, 62, 30281, 7, 6404, 62, 5715, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 60, 796, 4808, 6404, 1362, 628, 220, 220, 220, 825, 466, 62, 6404, 62, 24442, 7, 944, 11, 49706, 62, 3672, 25, 965, 11, 3275, 25, 965, 8, 4613, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 11187, 16959, 1241, 6218, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 49706, 62, 3672, 25, 262, 1438, 286, 262, 49706, 973, 287, 262, 3586, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 3275, 25, 262, 3275, 284, 2604, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 271, 20491, 1890, 7, 6404, 2667, 13, 30531, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 24442, 7, 20500, 8, 628, 220, 220, 220, 825, 466, 62, 6404, 62, 1069, 4516, 7, 944, 11, 49706, 62, 3672, 25, 965, 11, 6631, 25, 2134, 8, 4613, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 11187, 7788, 42006, 11053, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 49706, 62, 3672, 25, 262, 1438, 286, 262, 49706, 973, 287, 262, 3586, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 6631, 25, 262, 6631, 284, 2604, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 271, 20491, 1890, 7, 6404, 2667, 13, 31502, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 1069, 4516, 7, 1069, 4516, 8, 628, 220, 220, 220, 825, 466, 62, 6404, 62, 10951, 7, 944, 11, 49706, 62, 3672, 25, 965, 11, 3275, 25, 965, 8, 4613, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 11187, 24890, 1241, 6218, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 49706, 62, 3672, 25, 262, 1438, 286, 262, 49706, 973, 287, 262, 3586, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 3275, 25, 262, 3275, 284, 2604, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 271, 20491, 1890, 7, 6404, 2667, 13, 10778, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 10951, 7, 20500, 8, 628, 220, 220, 220, 825, 466, 62, 6404, 62, 43917, 7, 944, 11, 49706, 62, 3672, 25, 965, 11, 3275, 25, 965, 8, 4613, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 11187, 42660, 1241, 6218, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 49706, 62, 3672, 25, 262, 1438, 286, 262, 49706, 973, 287, 262, 3586, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 3275, 25, 262, 3275, 284, 2604, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 271, 20491, 1890, 7, 6404, 2667, 13, 31502, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 43917, 7, 20500, 8, 628, 220, 220, 220, 825, 466, 62, 6404, 62, 18224, 7, 944, 11, 49706, 62, 3672, 25, 965, 11, 3275, 25, 965, 8, 4613, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 11187, 33854, 1241, 6218, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 49706, 62, 3672, 25, 262, 1438, 286, 262, 49706, 973, 287, 262, 3586, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 3275, 25, 262, 3275, 284, 2604, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 271, 20491, 1890, 7, 6404, 2667, 13, 24908, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 18224, 7, 20500, 8, 628, 220, 220, 220, 825, 466, 62, 6404, 62, 34666, 7, 944, 11, 49706, 62, 3672, 25, 965, 11, 3275, 25, 965, 8, 4613, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 11187, 8740, 2043, 20151, 1241, 6218, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 49706, 62, 3672, 25, 262, 1438, 286, 262, 49706, 973, 287, 262, 3586, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 3275, 25, 262, 3275, 284, 2604, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 5355, 58, 6404, 1362, 62, 3672, 4083, 34666, 7, 20500, 8, 198 ]
2.397535
3,489
import numpy from chaco.api import Plot, ArrayPlotData from chaco.layers.api import ErrorLayer, WarningLayer, StatusLayer from enable.component_editor import ComponentEditor from traits.api import HasTraits, Instance, Button from traitsui.api import UItem, View, HGroup class MyPlot(HasTraits): """ Displays a plot with a few buttons to control which overlay to display """ plot = Instance(Plot) status_overlay = Instance(StatusLayer) error_button = Button('Error') warn_button = Button('Warning') no_problem_button = Button('No problem') traits_view = View( HGroup(UItem('error_button'), UItem('warn_button'), UItem('no_problem_button')), UItem('plot', editor=ComponentEditor()), width=700, height=600, resizable=True, ) def _error_button_fired(self, event): """ removes the old overlay and replaces it with an error overlay """ self.clear_status() self.status_overlay = ErrorLayer(component=self.plot, align='ul', scale_factor=0.25) self.plot.overlays.append(self.status_overlay) self.plot.request_redraw() def _warn_button_fired(self, event): """ removes the old overlay and replaces it with an warning overlay """ self.clear_status() self.status_overlay = WarningLayer(component=self.plot, align='ur', scale_factor=0.25) self.plot.overlays.append(self.status_overlay) self.plot.request_redraw() def _no_problem_button_fired(self, event): """ removes the old overlay """ self.clear_status() self.plot.request_redraw() index = numpy.array([1,2,3,4,5]) data_series = index**2 my_plot = MyPlot(index, data_series) my_plot.configure_traits()
[ 198, 11748, 299, 32152, 198, 198, 6738, 442, 10602, 13, 15042, 1330, 28114, 11, 15690, 43328, 6601, 198, 6738, 442, 10602, 13, 75, 6962, 13, 15042, 1330, 13047, 49925, 11, 15932, 49925, 11, 12678, 49925, 198, 6738, 7139, 13, 42895, 62, 35352, 1330, 35100, 17171, 198, 6738, 12796, 13, 15042, 1330, 7875, 15721, 896, 11, 2262, 590, 11, 20969, 198, 6738, 12796, 9019, 13, 15042, 1330, 471, 7449, 11, 3582, 11, 367, 13247, 198, 198, 4871, 2011, 43328, 7, 19242, 15721, 896, 2599, 198, 220, 220, 220, 37227, 3167, 26024, 257, 7110, 351, 257, 1178, 12163, 284, 1630, 543, 33345, 198, 220, 220, 220, 220, 220, 220, 220, 284, 3359, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 7110, 796, 2262, 590, 7, 43328, 8, 198, 220, 220, 220, 3722, 62, 2502, 10724, 796, 2262, 590, 7, 19580, 49925, 8, 628, 220, 220, 220, 4049, 62, 16539, 796, 20969, 10786, 12331, 11537, 198, 220, 220, 220, 9828, 62, 16539, 796, 20969, 10786, 20361, 11537, 198, 220, 220, 220, 645, 62, 45573, 62, 16539, 796, 20969, 10786, 2949, 1917, 11537, 628, 220, 220, 220, 12796, 62, 1177, 796, 3582, 7, 367, 13247, 7, 52, 7449, 10786, 18224, 62, 16539, 33809, 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, 471, 7449, 10786, 40539, 62, 16539, 33809, 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, 471, 7449, 10786, 3919, 62, 45573, 62, 16539, 11537, 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, 471, 7449, 10786, 29487, 3256, 5464, 28, 21950, 17171, 3419, 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, 9647, 28, 9879, 11, 6001, 28, 8054, 11, 581, 13821, 28, 17821, 11, 220, 220, 220, 220, 220, 220, 220, 220, 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, 825, 4808, 18224, 62, 16539, 62, 26803, 7, 944, 11, 1785, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 20694, 262, 1468, 33345, 290, 24020, 340, 351, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 281, 4049, 33345, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 20063, 62, 13376, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 13376, 62, 2502, 10724, 796, 13047, 49925, 7, 42895, 28, 944, 13, 29487, 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, 10548, 11639, 377, 3256, 5046, 62, 31412, 28, 15, 13, 1495, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 29487, 13, 2502, 75, 592, 13, 33295, 7, 944, 13, 13376, 62, 2502, 10724, 8, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 29487, 13, 25927, 62, 445, 1831, 3419, 628, 220, 220, 220, 825, 4808, 40539, 62, 16539, 62, 26803, 7, 944, 11, 1785, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 20694, 262, 1468, 33345, 290, 24020, 340, 351, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 281, 6509, 33345, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 20063, 62, 13376, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 13376, 62, 2502, 10724, 796, 15932, 49925, 7, 42895, 28, 944, 13, 29487, 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, 10548, 11639, 333, 3256, 5046, 62, 31412, 28, 15, 13, 1495, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 29487, 13, 2502, 75, 592, 13, 33295, 7, 944, 13, 13376, 62, 2502, 10724, 8, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 29487, 13, 25927, 62, 445, 1831, 3419, 628, 220, 220, 220, 825, 4808, 3919, 62, 45573, 62, 16539, 62, 26803, 7, 944, 11, 1785, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 20694, 262, 1468, 33345, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 20063, 62, 13376, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 29487, 13, 25927, 62, 445, 1831, 3419, 198, 198, 9630, 796, 299, 32152, 13, 18747, 26933, 16, 11, 17, 11, 18, 11, 19, 11, 20, 12962, 198, 7890, 62, 25076, 796, 6376, 1174, 17, 198, 198, 1820, 62, 29487, 796, 2011, 43328, 7, 9630, 11, 1366, 62, 25076, 8, 198, 1820, 62, 29487, 13, 11250, 495, 62, 9535, 896, 3419, 198 ]
2.222346
895
from concurrent.futures import ThreadPoolExecutor import time if __name__ == '__main__': main()
[ 6738, 24580, 13, 69, 315, 942, 1330, 14122, 27201, 23002, 38409, 198, 11748, 640, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419 ]
3.125
32
from pygame import * from enemies import * import random init() fontGeneral = font.Font('resources/fonts/Calibri.ttf', 30) fontHealth = font.Font('resources/fonts/Calibri Bold.ttf', 15) #draws itself and its health
[ 6738, 12972, 6057, 1330, 1635, 201, 198, 6738, 5775, 1330, 1635, 201, 198, 11748, 4738, 201, 198, 15003, 3419, 201, 198, 201, 198, 10331, 12218, 796, 10369, 13, 23252, 10786, 37540, 14, 10331, 82, 14, 9771, 571, 380, 13, 926, 69, 3256, 1542, 8, 201, 198, 10331, 18081, 796, 10369, 13, 23252, 10786, 37540, 14, 10331, 82, 14, 9771, 571, 380, 27059, 13, 926, 69, 3256, 1315, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 1303, 19334, 82, 2346, 290, 663, 1535, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220 ]
1.890244
164
# Copyright 2019 Nathan Jay and Noga Rotman # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import csv import heapq import os import random import sys import time import math import warnings warnings.simplefilter(action='ignore', category=UserWarning) import gym from gym import spaces from gym.envs.registration import register from gym.utils import seeding import numpy as np from common import sender_obs from common.utils import pcc_aurora_reward, read_json_file from simulator.trace import Trace import pandas as pd MAX_CWND = 5000 MIN_CWND = 4 MAX_RATE = 20000 MIN_RATE = 5 REWARD_SCALE = 0.001 EVENT_TYPE_SEND = 'S' EVENT_TYPE_ACK = 'A' BYTES_PER_PACKET = 1500 LATENCY_PENALTY = 1.0 LOSS_PENALTY = 1.0 USE_LATENCY_NOISE = True MAX_LATENCY_NOISE = 1.1 # DEBUG = True DEBUG = False MI_RTT_PROPORTION = 1.0 # PACKET_LOG_FLAG = False PACKET_LOG_FLAG = True register(id='PccNs-v0', entry_point='simulator.network:SimulatedNetworkEnv')
[ 2, 15069, 13130, 18106, 9180, 290, 399, 10949, 18481, 805, 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, 11748, 269, 21370, 198, 11748, 24575, 80, 198, 11748, 28686, 198, 11748, 4738, 198, 11748, 25064, 198, 11748, 640, 198, 11748, 10688, 198, 11748, 14601, 198, 40539, 654, 13, 36439, 24455, 7, 2673, 11639, 46430, 3256, 6536, 28, 12982, 20361, 8, 198, 198, 11748, 11550, 198, 6738, 11550, 1330, 9029, 198, 6738, 11550, 13, 268, 14259, 13, 2301, 33397, 1330, 7881, 198, 6738, 11550, 13, 26791, 1330, 384, 8228, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 2219, 1330, 29788, 62, 8158, 198, 6738, 2219, 13, 26791, 1330, 279, 535, 62, 2899, 5799, 62, 260, 904, 11, 1100, 62, 17752, 62, 7753, 198, 6738, 35375, 13, 40546, 1330, 34912, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 22921, 62, 43538, 8575, 796, 23336, 198, 23678, 62, 43538, 8575, 796, 604, 198, 198, 22921, 62, 49, 6158, 796, 939, 405, 198, 23678, 62, 49, 6158, 796, 642, 198, 198, 2200, 39743, 62, 6173, 21358, 796, 657, 13, 8298, 198, 198, 20114, 3525, 62, 25216, 62, 50, 10619, 796, 705, 50, 6, 198, 20114, 3525, 62, 25216, 62, 8120, 796, 705, 32, 6, 198, 198, 17513, 51, 1546, 62, 18973, 62, 47, 8120, 2767, 796, 20007, 198, 198, 43, 1404, 45155, 62, 47, 1677, 1847, 9936, 796, 352, 13, 15, 198, 43, 18420, 62, 47, 1677, 1847, 9936, 796, 352, 13, 15, 198, 198, 19108, 62, 43, 1404, 45155, 62, 15285, 24352, 796, 6407, 198, 22921, 62, 43, 1404, 45155, 62, 15285, 24352, 796, 352, 13, 16, 198, 198, 2, 16959, 796, 6407, 198, 30531, 796, 10352, 198, 198, 8895, 62, 14181, 51, 62, 4805, 3185, 9863, 2849, 796, 352, 13, 15, 198, 198, 2, 47035, 2767, 62, 25294, 62, 38948, 796, 10352, 198, 47, 8120, 2767, 62, 25294, 62, 38948, 796, 6407, 628, 628, 628, 628, 198, 30238, 7, 312, 11639, 47, 535, 47503, 12, 85, 15, 3256, 5726, 62, 4122, 11639, 14323, 8927, 13, 27349, 25, 8890, 4817, 26245, 4834, 85, 11537, 198 ]
3.039666
479
""" Django settings for cheddar_oauth_example project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '43cy=fmsak_xqkme&yi9@c^+-*0pvr%s+-of!yzx6rdiw*!bxt' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'social.apps.django_app.default', 'django.contrib.humanize', 'app', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ROOT_URLCONF = 'cheddar_oauth_example.urls' WSGI_APPLICATION = 'cheddar_oauth_example.wsgi.application' AUTHENTICATION_BACKENDS = ( 'oauth.cheddar.CheddarOAuth2', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'social.apps.django_app.context_processors.backends', 'social.apps.django_app.context_processors.login_redirect', ) # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Internationalization # https://docs.djangoproject.com/en/1.7/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ STATIC_URL = '/static/' # SOCIAL_AUTH_CHEDDAR_SCOPE = [] SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/' SOCIAL_AUTH_LOGIN_ERROR_URL = '/login_error' # Logging LOGGING = { 'version': 1, 'formatters': { 'verbose': { 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' }, 'simple': { 'format': '%(levelname)s %(message)s' }, }, 'handlers': { 'console': { 'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'simple' }, }, 'loggers': { 'django': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': True, }, } } # Import Local Settings try: from local_settings import * except ImportError as e: print "FAILED TO IMPORT LOCAL SETTINGS: %s" % e
[ 37811, 198, 35, 73, 14208, 6460, 329, 269, 44937, 62, 12162, 1071, 62, 20688, 1628, 13, 198, 198, 1890, 517, 1321, 319, 428, 2393, 11, 766, 198, 5450, 1378, 31628, 13, 28241, 648, 404, 305, 752, 13, 785, 14, 268, 14, 16, 13, 22, 14, 4852, 873, 14, 33692, 14, 198, 198, 1890, 262, 1336, 1351, 286, 6460, 290, 511, 3815, 11, 766, 198, 5450, 1378, 31628, 13, 28241, 648, 404, 305, 752, 13, 785, 14, 268, 14, 16, 13, 22, 14, 5420, 14, 33692, 14, 198, 37811, 198, 198, 2, 10934, 13532, 2641, 262, 1628, 588, 428, 25, 28686, 13, 6978, 13, 22179, 7, 33, 11159, 62, 34720, 11, 2644, 8, 198, 11748, 28686, 198, 33, 11159, 62, 34720, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 4008, 628, 198, 2, 12029, 12, 9688, 2478, 6460, 532, 48092, 4674, 329, 3227, 198, 2, 4091, 3740, 1378, 31628, 13, 28241, 648, 404, 305, 752, 13, 785, 14, 268, 14, 16, 13, 22, 14, 4919, 1462, 14, 2934, 1420, 434, 14, 9122, 4868, 14, 198, 198, 2, 10729, 4261, 9050, 39410, 25, 1394, 262, 3200, 1994, 973, 287, 3227, 3200, 0, 198, 23683, 26087, 62, 20373, 796, 705, 3559, 948, 28, 69, 907, 461, 62, 87, 80, 74, 1326, 5, 48111, 24, 31, 66, 61, 10, 12, 9, 15, 79, 37020, 4, 82, 10, 12, 1659, 0, 88, 42592, 21, 4372, 14246, 9, 0, 65, 742, 6, 198, 198, 2, 10729, 4261, 9050, 39410, 25, 836, 470, 1057, 351, 14257, 2900, 319, 287, 3227, 0, 198, 30531, 796, 6407, 198, 198, 51, 3620, 6489, 6158, 62, 30531, 796, 6407, 198, 198, 7036, 3913, 1961, 62, 39, 10892, 50, 796, 17635, 628, 198, 2, 15678, 6770, 198, 198, 38604, 7036, 1961, 62, 2969, 3705, 796, 357, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 28482, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 18439, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 11299, 19199, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 82, 6202, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 37348, 1095, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 12708, 16624, 3256, 198, 220, 220, 220, 705, 14557, 13, 18211, 13, 28241, 14208, 62, 1324, 13, 12286, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 10734, 1096, 3256, 198, 220, 220, 220, 705, 1324, 3256, 198, 8, 198, 198, 44, 2389, 35, 2538, 33746, 62, 31631, 1546, 796, 357, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 82, 6202, 13, 27171, 1574, 13, 36044, 34621, 1574, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 27171, 1574, 13, 11321, 13, 17227, 34621, 1574, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 27171, 1574, 13, 6359, 41871, 13, 34, 27891, 69, 7680, 34621, 1574, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 18439, 13, 27171, 1574, 13, 47649, 3299, 34621, 1574, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 18439, 13, 27171, 1574, 13, 36044, 47649, 3299, 34621, 1574, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 3642, 822, 13, 37348, 1095, 13, 27171, 1574, 13, 12837, 34621, 1574, 3256, 198, 220, 220, 220, 705, 28241, 14208, 13, 27171, 1574, 13, 12976, 73, 5430, 13, 55, 19778, 29046, 34621, 1574, 3256, 198, 8, 198, 198, 13252, 2394, 62, 4261, 5639, 1340, 37, 796, 705, 1740, 27455, 62, 12162, 1071, 62, 20688, 13, 6371, 82, 6, 198, 198, 19416, 18878, 62, 2969, 31484, 6234, 796, 705, 1740, 27455, 62, 12162, 1071, 62, 20688, 13, 18504, 12397, 13, 31438, 6, 198, 198, 32, 24318, 3525, 2149, 6234, 62, 31098, 1677, 5258, 796, 357, 198, 220, 705, 12162, 1071, 13, 1740, 27455, 13, 34, 44937, 23621, 1071, 17, 3256, 198, 8, 198, 198, 51, 3620, 6489, 6158, 62, 10943, 32541, 62, 4805, 4503, 7597, 20673, 796, 357, 198, 220, 220, 220, 705, 14557, 13, 18211, 13, 28241, 14208, 62, 1324, 13, 22866, 62, 14681, 669, 13, 1891, 2412, 3256, 198, 220, 220, 220, 705, 14557, 13, 18211, 13, 28241, 14208, 62, 1324, 13, 22866, 62, 14681, 669, 13, 38235, 62, 445, 1060, 3256, 198, 8, 198, 198, 2, 24047, 198, 2, 3740, 1378, 31628, 13, 28241, 648, 404, 305, 752, 13, 785, 14, 268, 14, 16, 13, 22, 14, 5420, 14, 33692, 31113, 19608, 18826, 198, 198, 35, 1404, 6242, 1921, 1546, 796, 1391, 198, 220, 220, 220, 705, 12286, 10354, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 705, 26808, 8881, 10354, 705, 28241, 14208, 13, 9945, 13, 1891, 2412, 13, 25410, 578, 18, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 705, 20608, 10354, 28686, 13, 6978, 13, 22179, 7, 33, 11159, 62, 34720, 11, 705, 9945, 13, 25410, 578, 18, 33809, 198, 220, 220, 220, 1782, 198, 92, 198, 198, 2, 4037, 1634, 198, 2, 3740, 1378, 31628, 13, 28241, 648, 404, 305, 752, 13, 785, 14, 268, 14, 16, 13, 22, 14, 4852, 873, 14, 72, 1507, 77, 14, 198, 198, 43, 15567, 52, 11879, 62, 34, 16820, 796, 705, 268, 12, 385, 6, 198, 198, 34694, 62, 57, 11651, 796, 705, 17429, 6, 198, 198, 19108, 62, 40, 1507, 45, 796, 6407, 198, 198, 19108, 62, 43, 940, 45, 796, 6407, 198, 198, 19108, 62, 51, 57, 796, 6407, 628, 198, 2, 36125, 3696, 357, 49155, 11, 11933, 11, 5382, 8, 198, 2, 3740, 1378, 31628, 13, 28241, 648, 404, 305, 752, 13, 785, 14, 268, 14, 16, 13, 22, 14, 4919, 1462, 14, 12708, 12, 16624, 14, 198, 198, 35744, 2149, 62, 21886, 796, 31051, 12708, 14, 6, 198, 198, 2, 31430, 12576, 62, 32, 24318, 62, 3398, 1961, 35, 1503, 62, 6173, 32135, 796, 17635, 198, 198, 50, 4503, 12576, 62, 32, 24318, 62, 25294, 1268, 62, 22083, 40, 23988, 62, 21886, 796, 31051, 6, 198, 50, 4503, 12576, 62, 32, 24318, 62, 25294, 1268, 62, 24908, 62, 21886, 796, 31051, 38235, 62, 18224, 6, 198, 198, 2, 5972, 2667, 198, 198, 25294, 38, 2751, 796, 1391, 198, 220, 705, 9641, 10354, 352, 11, 198, 220, 705, 18982, 1010, 10354, 1391, 198, 220, 220, 220, 705, 19011, 577, 10354, 1391, 198, 220, 220, 220, 220, 220, 705, 18982, 10354, 705, 4, 7, 5715, 3672, 8, 82, 4064, 7, 292, 310, 524, 8, 82, 4064, 7, 21412, 8, 82, 4064, 7, 14681, 8, 67, 4064, 7, 16663, 8, 67, 4064, 7, 20500, 8, 82, 6, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 705, 36439, 10354, 1391, 198, 220, 220, 220, 220, 220, 705, 18982, 10354, 705, 4, 7, 5715, 3672, 8, 82, 4064, 7, 20500, 8, 82, 6, 198, 220, 220, 220, 8964, 198, 220, 8964, 198, 220, 705, 4993, 8116, 10354, 1391, 198, 220, 220, 220, 705, 41947, 10354, 1391, 198, 220, 220, 220, 220, 220, 705, 5715, 10354, 705, 30531, 3256, 198, 220, 220, 220, 220, 220, 705, 4871, 10354, 705, 6404, 2667, 13, 12124, 25060, 3256, 198, 220, 220, 220, 220, 220, 705, 687, 1436, 10354, 705, 36439, 6, 198, 220, 220, 220, 8964, 198, 220, 8964, 198, 220, 705, 6404, 5355, 10354, 1391, 198, 220, 220, 220, 705, 28241, 14208, 10354, 1391, 198, 220, 220, 220, 220, 220, 705, 4993, 8116, 10354, 37250, 41947, 6, 4357, 198, 220, 220, 220, 220, 220, 705, 5715, 10354, 705, 30531, 3256, 198, 220, 220, 220, 220, 220, 705, 22930, 37861, 10354, 6407, 11, 198, 220, 220, 220, 8964, 198, 220, 1782, 198, 92, 198, 198, 2, 17267, 10714, 16163, 198, 198, 28311, 25, 198, 220, 220, 220, 422, 1957, 62, 33692, 1330, 1635, 198, 16341, 17267, 12331, 355, 304, 25, 198, 220, 220, 220, 3601, 366, 7708, 4146, 1961, 5390, 30023, 9863, 37347, 1847, 25823, 51, 20754, 25, 4064, 82, 1, 4064, 304, 198 ]
2.382753
1,322
from django.urls import path from django102.views import index as index_view, UsersListView, GamesListView, something, methods_demo, \ raises_exception, create_game urlpatterns = [ path('', index_view, name='index'), path('2/', UsersListView.as_view()), path('games/', GamesListView.as_view()), path('smth/', something), path('methods/', methods_demo), path('raises/', raises_exception), path('creategame/', create_game), ]
[ 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 201, 198, 201, 198, 6738, 42625, 14208, 15377, 13, 33571, 1330, 6376, 355, 6376, 62, 1177, 11, 18987, 8053, 7680, 11, 5776, 8053, 7680, 11, 1223, 11, 5050, 62, 9536, 78, 11, 3467, 201, 198, 220, 220, 220, 12073, 62, 1069, 4516, 11, 2251, 62, 6057, 201, 198, 201, 198, 6371, 33279, 82, 796, 685, 201, 198, 220, 220, 220, 3108, 10786, 3256, 6376, 62, 1177, 11, 1438, 11639, 9630, 33809, 201, 198, 220, 220, 220, 3108, 10786, 17, 14, 3256, 18987, 8053, 7680, 13, 292, 62, 1177, 3419, 828, 201, 198, 220, 220, 220, 3108, 10786, 19966, 14, 3256, 5776, 8053, 7680, 13, 292, 62, 1177, 3419, 828, 201, 198, 220, 220, 220, 3108, 10786, 5796, 400, 14, 3256, 1223, 828, 201, 198, 220, 220, 220, 3108, 10786, 24396, 82, 14, 3256, 5050, 62, 9536, 78, 828, 201, 198, 220, 220, 220, 3108, 10786, 430, 2696, 14, 3256, 12073, 62, 1069, 4516, 828, 201, 198, 220, 220, 220, 3108, 10786, 7513, 2397, 480, 14, 3256, 2251, 62, 6057, 828, 201, 198, 60 ]
2.596685
181
from google.colab import drive drive.mount('/content/drive') import librosa import os import pandas as pd from numpy import mean import warnings; warnings.filterwarnings('ignore'); folders_5s = { 'pop_5s':'/content/drive/My Drive/ML_Project/New_Data/pop_test_5s', 'rnb_5s':'/content/drive/My Drive/ML_Project/New_Data/rnb_test_5s', 'blues_5s':'/content/drive/My Drive/ML_Project/New_Data/blues_test_5s', 'hiphop_5s':'/content/drive/My Drive/ML_Project/New_Data/hiphop_test_5s', 'rock_5s':'/content/drive/My Drive/ML_Project/New_Data/rock_test_5s' } folders_10s = { 'pop_10s':'/content/drive/My Drive/ML_Project/New_Data/pop_test_10s', 'rnb_10s':'/content/drive/My Drive/ML_Project/New_Data/rnb_test_10s', 'blues_10s':'/content/drive/My Drive/ML_Project/New_Data/blues_test_10s', 'hiphop_10s':'/content/drive/My Drive/ML_Project/New_Data/hiphop_test_10s', 'rock_10s':'/content/drive/My Drive/ML_Project/New_Data/rock_test_10s' } folders_20s = { 'pop_20s':'/content/drive/My Drive/ML_Project/New_Data/pop_test_20s', 'rnb_20s':'/content/drive/My Drive/ML_Project/New_Data/rnb_test_20s', 'blues_20s':'/content/drive/My Drive/ML_Project/New_Data/blues_test_20s', 'hiphop_20s':'/content/drive/My Drive/ML_Project/New_Data/hiphop_test_20s', 'rock_20s':'/content/drive/My Drive/ML_Project/New_Data/rock_test_20s' } label = { 'pop_5s': 0, 'rnb_5s': 1, 'blues_5s': 2, 'hiphop_5s': 3, 'rock_5s': 4, 'pop_10s': 0, 'rnb_10s': 1, 'blues_10s': 2, 'hiphop_10s': 3, 'rock_10s': 4, 'pop_20s': 0, 'rnb_20s': 1, 'blues_20s': 2, 'hiphop_20s': 3, 'rock_20s': 4 } data_5s = [] data_10s = [] data_20s = [] for name, path in folders_5s.items(): #count_5s = 3000 for filename in os.listdir(path): # if(count_5s == 0): # break songData = [] songname = f'{path}/{filename}' y, sr = librosa.load(songname, mono=True) tempo, beats = librosa.beat.beat_track(y=y, sr=sr) songData.append(tempo) songData.append(mean(beats)) chroma_stft = librosa.feature.chroma_stft(y=y, sr=sr) songData.append(mean(chroma_stft)) rmse = librosa.feature.rmse(y=y) songData.append(mean(rmse)) spec_cent = librosa.feature.spectral_centroid(y=y, sr=sr) songData.append(mean(spec_cent)) spec_bw = librosa.feature.spectral_bandwidth(y=y, sr=sr) songData.append(mean(spec_bw)) rolloff = librosa.feature.spectral_rolloff(y=y, sr=sr) songData.append(mean(rolloff)) zcr = librosa.feature.zero_crossing_rate(y) songData.append(mean(zcr)) mfcc = librosa.feature.mfcc(y=y, sr=sr) for i in mfcc: songData.append(mean(i)) songData.append(label[name]) data_5s.append(songData) #count_5s -= 1 for name, path in folders_10s.items(): #count_10s = 1500 for filename in os.listdir(path): # if(count_10s == 0): # break songData = [] songname = f'{path}/{filename}' y, sr = librosa.load(songname, mono=True) tempo, beats = librosa.beat.beat_track(y=y, sr=sr) songData.append(tempo) songData.append(mean(beats)) chroma_stft = librosa.feature.chroma_stft(y=y, sr=sr) songData.append(mean(chroma_stft)) rmse = librosa.feature.rmse(y=y) songData.append(mean(rmse)) spec_cent = librosa.feature.spectral_centroid(y=y, sr=sr) songData.append(mean(spec_cent)) spec_bw = librosa.feature.spectral_bandwidth(y=y, sr=sr) songData.append(mean(spec_bw)) rolloff = librosa.feature.spectral_rolloff(y=y, sr=sr) songData.append(mean(rolloff)) zcr = librosa.feature.zero_crossing_rate(y) songData.append(mean(zcr)) mfcc = librosa.feature.mfcc(y=y, sr=sr) for i in mfcc: songData.append(mean(i)) songData.append(label[name]) data_10s.append(songData) #count_10s -= 1 for name, path in folders_20s.items(): #count_20s = 900 for filename in os.listdir(path): # if(count_20s == 0): # break songData = [] songname = f'{path}/{filename}' y, sr = librosa.load(songname, mono=True) tempo, beats = librosa.beat.beat_track(y=y, sr=sr) songData.append(tempo) songData.append(mean(beats)) chroma_stft = librosa.feature.chroma_stft(y=y, sr=sr) songData.append(mean(chroma_stft)) rmse = librosa.feature.rmse(y=y) songData.append(mean(rmse)) spec_cent = librosa.feature.spectral_centroid(y=y, sr=sr) songData.append(mean(spec_cent)) spec_bw = librosa.feature.spectral_bandwidth(y=y, sr=sr) songData.append(mean(spec_bw)) rolloff = librosa.feature.spectral_rolloff(y=y, sr=sr) songData.append(mean(rolloff)) zcr = librosa.feature.zero_crossing_rate(y) songData.append(mean(zcr)) mfcc = librosa.feature.mfcc(y=y, sr=sr) for i in mfcc: songData.append(mean(i)) songData.append(label[name]) data_20s.append(songData) #count_20s -= 1 data_5s = pd.DataFrame(data_5s) data_5s.to_csv('/content/drive/My Drive/ML_Project/data_5s_test_all_genres.csv') data_10s = pd.DataFrame(data_10s) data_10s.to_csv('/content/drive/My Drive/ML_Project/data_10s_test_all_genres.csv') data_20s = pd.DataFrame(data_20s) data_20s.to_csv('/content/drive/My Drive/ML_Project/data_20s_test_all_genres.csv') data_10s
[ 198, 6738, 23645, 13, 4033, 397, 1330, 3708, 198, 19472, 13, 14948, 10786, 14, 11299, 14, 19472, 11537, 198, 198, 11748, 9195, 4951, 64, 198, 11748, 28686, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 299, 32152, 1330, 1612, 198, 11748, 14601, 26, 198, 40539, 654, 13, 24455, 40539, 654, 10786, 46430, 24036, 198, 198, 11379, 364, 62, 20, 82, 796, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 12924, 62, 20, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 12924, 62, 9288, 62, 20, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 35906, 65, 62, 20, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 35906, 65, 62, 9288, 62, 20, 82, 3256, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2436, 947, 62, 20, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 2436, 947, 62, 9288, 62, 20, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 1056, 8548, 62, 20, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 1056, 8548, 62, 9288, 62, 20, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 10823, 62, 20, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 10823, 62, 9288, 62, 20, 82, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 198, 11379, 364, 62, 940, 82, 796, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 12924, 62, 940, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 12924, 62, 9288, 62, 940, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 35906, 65, 62, 940, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 35906, 65, 62, 9288, 62, 940, 82, 3256, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2436, 947, 62, 940, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 2436, 947, 62, 9288, 62, 940, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 1056, 8548, 62, 940, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 1056, 8548, 62, 9288, 62, 940, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 10823, 62, 940, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 10823, 62, 9288, 62, 940, 82, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 198, 11379, 364, 62, 1238, 82, 796, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 12924, 62, 1238, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 12924, 62, 9288, 62, 1238, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 35906, 65, 62, 1238, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 35906, 65, 62, 9288, 62, 1238, 82, 3256, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2436, 947, 62, 1238, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 2436, 947, 62, 9288, 62, 1238, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 1056, 8548, 62, 1238, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 1056, 8548, 62, 9288, 62, 1238, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 10823, 62, 1238, 82, 10354, 26488, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 3791, 62, 6601, 14, 10823, 62, 9288, 62, 1238, 82, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1782, 628, 198, 18242, 796, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 12924, 62, 20, 82, 10354, 657, 11, 705, 35906, 65, 62, 20, 82, 10354, 352, 11, 705, 2436, 947, 62, 20, 82, 10354, 362, 11, 705, 1056, 8548, 62, 20, 82, 10354, 513, 11, 705, 10823, 62, 20, 82, 10354, 604, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 12924, 62, 940, 82, 10354, 657, 11, 705, 35906, 65, 62, 940, 82, 10354, 352, 11, 705, 2436, 947, 62, 940, 82, 10354, 362, 11, 705, 1056, 8548, 62, 940, 82, 10354, 513, 11, 705, 10823, 62, 940, 82, 10354, 604, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 12924, 62, 1238, 82, 10354, 657, 11, 705, 35906, 65, 62, 1238, 82, 10354, 352, 11, 705, 2436, 947, 62, 1238, 82, 10354, 362, 11, 705, 1056, 8548, 62, 1238, 82, 10354, 513, 11, 705, 10823, 62, 1238, 82, 10354, 604, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 198, 7890, 62, 20, 82, 796, 17635, 198, 7890, 62, 940, 82, 796, 17635, 198, 7890, 62, 1238, 82, 796, 17635, 628, 198, 1640, 1438, 11, 3108, 287, 24512, 62, 20, 82, 13, 23814, 33529, 198, 220, 1303, 9127, 62, 20, 82, 796, 20343, 198, 220, 329, 29472, 287, 28686, 13, 4868, 15908, 7, 6978, 2599, 198, 220, 220, 220, 1303, 611, 7, 9127, 62, 20, 82, 6624, 657, 2599, 198, 220, 220, 220, 1303, 220, 220, 2270, 628, 220, 220, 220, 3496, 6601, 796, 17635, 198, 220, 220, 220, 3496, 3672, 796, 277, 6, 90, 6978, 92, 14, 90, 34345, 92, 6, 198, 220, 220, 220, 331, 11, 19677, 796, 9195, 4951, 64, 13, 2220, 7, 34050, 3672, 11, 33361, 28, 17821, 8, 628, 220, 220, 220, 28691, 11, 17825, 796, 9195, 4951, 64, 13, 12945, 13, 12945, 62, 11659, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 11498, 7501, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 1350, 1381, 4008, 628, 220, 220, 220, 15358, 64, 62, 301, 701, 796, 9195, 4951, 64, 13, 30053, 13, 28663, 64, 62, 301, 701, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 28663, 64, 62, 301, 701, 4008, 628, 220, 220, 220, 42721, 325, 796, 9195, 4951, 64, 13, 30053, 13, 26224, 325, 7, 88, 28, 88, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 26224, 325, 4008, 628, 220, 220, 220, 1020, 62, 1087, 796, 9195, 4951, 64, 13, 30053, 13, 4443, 1373, 62, 1087, 3882, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 16684, 62, 1087, 4008, 628, 220, 220, 220, 1020, 62, 65, 86, 796, 9195, 4951, 64, 13, 30053, 13, 4443, 1373, 62, 3903, 10394, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 16684, 62, 65, 86, 4008, 628, 220, 220, 220, 4836, 2364, 796, 9195, 4951, 64, 13, 30053, 13, 4443, 1373, 62, 2487, 2364, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 2487, 2364, 4008, 628, 220, 220, 220, 1976, 6098, 796, 9195, 4951, 64, 13, 30053, 13, 22570, 62, 19692, 278, 62, 4873, 7, 88, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 89, 6098, 4008, 628, 220, 220, 220, 285, 69, 535, 796, 9195, 4951, 64, 13, 30053, 13, 76, 69, 535, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 329, 1312, 287, 285, 69, 535, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 72, 4008, 198, 220, 220, 220, 220, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 18242, 58, 3672, 12962, 628, 220, 220, 220, 1366, 62, 20, 82, 13, 33295, 7, 34050, 6601, 8, 628, 220, 220, 220, 1303, 9127, 62, 20, 82, 48185, 352, 628, 198, 1640, 1438, 11, 3108, 287, 24512, 62, 940, 82, 13, 23814, 33529, 198, 220, 1303, 9127, 62, 940, 82, 796, 20007, 198, 220, 329, 29472, 287, 28686, 13, 4868, 15908, 7, 6978, 2599, 198, 220, 220, 220, 1303, 611, 7, 9127, 62, 940, 82, 6624, 657, 2599, 198, 220, 220, 220, 1303, 220, 220, 2270, 628, 220, 220, 220, 3496, 6601, 796, 17635, 198, 220, 220, 220, 3496, 3672, 796, 277, 6, 90, 6978, 92, 14, 90, 34345, 92, 6, 198, 220, 220, 220, 331, 11, 19677, 796, 9195, 4951, 64, 13, 2220, 7, 34050, 3672, 11, 33361, 28, 17821, 8, 628, 220, 220, 220, 28691, 11, 17825, 796, 9195, 4951, 64, 13, 12945, 13, 12945, 62, 11659, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 11498, 7501, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 1350, 1381, 4008, 628, 220, 220, 220, 15358, 64, 62, 301, 701, 796, 9195, 4951, 64, 13, 30053, 13, 28663, 64, 62, 301, 701, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 28663, 64, 62, 301, 701, 4008, 628, 220, 220, 220, 42721, 325, 796, 9195, 4951, 64, 13, 30053, 13, 26224, 325, 7, 88, 28, 88, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 26224, 325, 4008, 628, 220, 220, 220, 1020, 62, 1087, 796, 9195, 4951, 64, 13, 30053, 13, 4443, 1373, 62, 1087, 3882, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 16684, 62, 1087, 4008, 628, 220, 220, 220, 1020, 62, 65, 86, 796, 9195, 4951, 64, 13, 30053, 13, 4443, 1373, 62, 3903, 10394, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 16684, 62, 65, 86, 4008, 628, 220, 220, 220, 4836, 2364, 796, 9195, 4951, 64, 13, 30053, 13, 4443, 1373, 62, 2487, 2364, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 2487, 2364, 4008, 628, 220, 220, 220, 1976, 6098, 796, 9195, 4951, 64, 13, 30053, 13, 22570, 62, 19692, 278, 62, 4873, 7, 88, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 89, 6098, 4008, 628, 220, 220, 220, 285, 69, 535, 796, 9195, 4951, 64, 13, 30053, 13, 76, 69, 535, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 329, 1312, 287, 285, 69, 535, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 72, 4008, 198, 220, 220, 220, 220, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 18242, 58, 3672, 12962, 628, 220, 220, 220, 1366, 62, 940, 82, 13, 33295, 7, 34050, 6601, 8, 628, 220, 220, 220, 1303, 9127, 62, 940, 82, 48185, 352, 628, 198, 1640, 1438, 11, 3108, 287, 24512, 62, 1238, 82, 13, 23814, 33529, 198, 220, 1303, 9127, 62, 1238, 82, 796, 15897, 198, 220, 329, 29472, 287, 28686, 13, 4868, 15908, 7, 6978, 2599, 198, 220, 220, 220, 1303, 611, 7, 9127, 62, 1238, 82, 6624, 657, 2599, 198, 220, 220, 220, 1303, 220, 220, 2270, 628, 220, 220, 220, 3496, 6601, 796, 17635, 198, 220, 220, 220, 3496, 3672, 796, 277, 6, 90, 6978, 92, 14, 90, 34345, 92, 6, 198, 220, 220, 220, 331, 11, 19677, 796, 9195, 4951, 64, 13, 2220, 7, 34050, 3672, 11, 33361, 28, 17821, 8, 628, 220, 220, 220, 28691, 11, 17825, 796, 9195, 4951, 64, 13, 12945, 13, 12945, 62, 11659, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 11498, 7501, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 1350, 1381, 4008, 628, 220, 220, 220, 15358, 64, 62, 301, 701, 796, 9195, 4951, 64, 13, 30053, 13, 28663, 64, 62, 301, 701, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 28663, 64, 62, 301, 701, 4008, 628, 220, 220, 220, 42721, 325, 796, 9195, 4951, 64, 13, 30053, 13, 26224, 325, 7, 88, 28, 88, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 26224, 325, 4008, 628, 220, 220, 220, 1020, 62, 1087, 796, 9195, 4951, 64, 13, 30053, 13, 4443, 1373, 62, 1087, 3882, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 16684, 62, 1087, 4008, 628, 220, 220, 220, 1020, 62, 65, 86, 796, 9195, 4951, 64, 13, 30053, 13, 4443, 1373, 62, 3903, 10394, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 16684, 62, 65, 86, 4008, 628, 220, 220, 220, 4836, 2364, 796, 9195, 4951, 64, 13, 30053, 13, 4443, 1373, 62, 2487, 2364, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 2487, 2364, 4008, 628, 220, 220, 220, 1976, 6098, 796, 9195, 4951, 64, 13, 30053, 13, 22570, 62, 19692, 278, 62, 4873, 7, 88, 8, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 89, 6098, 4008, 628, 220, 220, 220, 285, 69, 535, 796, 9195, 4951, 64, 13, 30053, 13, 76, 69, 535, 7, 88, 28, 88, 11, 19677, 28, 27891, 8, 198, 220, 220, 220, 329, 1312, 287, 285, 69, 535, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3496, 6601, 13, 33295, 7, 32604, 7, 72, 4008, 198, 220, 220, 220, 220, 198, 220, 220, 220, 3496, 6601, 13, 33295, 7, 18242, 58, 3672, 12962, 628, 220, 220, 220, 1366, 62, 1238, 82, 13, 33295, 7, 34050, 6601, 8, 628, 220, 220, 220, 1303, 9127, 62, 1238, 82, 48185, 352, 628, 628, 198, 7890, 62, 20, 82, 796, 279, 67, 13, 6601, 19778, 7, 7890, 62, 20, 82, 8, 198, 7890, 62, 20, 82, 13, 1462, 62, 40664, 10786, 14, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 7890, 62, 20, 82, 62, 9288, 62, 439, 62, 5235, 411, 13, 40664, 11537, 220, 198, 198, 7890, 62, 940, 82, 796, 279, 67, 13, 6601, 19778, 7, 7890, 62, 940, 82, 8, 198, 7890, 62, 940, 82, 13, 1462, 62, 40664, 10786, 14, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 7890, 62, 940, 82, 62, 9288, 62, 439, 62, 5235, 411, 13, 40664, 11537, 220, 198, 198, 7890, 62, 1238, 82, 796, 279, 67, 13, 6601, 19778, 7, 7890, 62, 1238, 82, 8, 198, 7890, 62, 1238, 82, 13, 1462, 62, 40664, 10786, 14, 11299, 14, 19472, 14, 3666, 9974, 14, 5805, 62, 16775, 14, 7890, 62, 1238, 82, 62, 9288, 62, 439, 62, 5235, 411, 13, 40664, 11537, 198, 198, 7890, 62, 940, 82, 628 ]
2.069838
2,649
import os import argparse import random if __name__ == '__main__': parser = argparse.ArgumentParser(description='Split the data') parser.add_argument('--meta-all', type=str, help='The meta file generated by preprocess.py', required=True) parser.add_argument('--ratio-test', default=0.1, type=float, help='ratio of testing examples', required=False) args = parser.parse_args() split_and_save(args)
[ 11748, 28686, 198, 11748, 1822, 29572, 198, 11748, 4738, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 30751, 796, 1822, 29572, 13, 28100, 1713, 46677, 7, 11213, 11639, 41205, 262, 1366, 11537, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 438, 28961, 12, 439, 3256, 220, 2099, 28, 2536, 11, 1037, 11639, 464, 13634, 2393, 7560, 416, 662, 14681, 13, 9078, 3256, 2672, 28, 17821, 8, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 438, 10366, 952, 12, 9288, 3256, 4277, 28, 15, 13, 16, 11, 2099, 28, 22468, 11, 1037, 11639, 10366, 952, 286, 4856, 6096, 3256, 2672, 28, 25101, 8, 198, 220, 220, 220, 26498, 796, 30751, 13, 29572, 62, 22046, 3419, 198, 220, 220, 220, 6626, 62, 392, 62, 21928, 7, 22046, 8, 628 ]
3.028777
139
""" Frequent item discovery by PCY algorithm""" import operator import json import sys from pyspark import SparkContext, SparkConf import pyspark_cassandra from cassandra.cluster import Cluster cluster = None session = None class PCYFrequentItems: """ Find Frequent item list using PCY algorithm """ IS_DEBUGGING = False config_object = None def __init__(self, is_debug, config_file="config.json"): """ Sets the initial debiggin parameter :param is_debug: Print collect messages if set true """ self.IS_DEBUGGING = is_debug json_data = open(config_file).read() self.config_object = json.loads(json_data) @staticmethod def group_items(basket, group_size): """ Get item_groups from a basket Returns sorted items by their numerical number :param basket: Basket to search the item_group from (could be a single cart) :param group_size: Size of the item_group to form :return: """ assert (group_size >= 1 and isinstance(group_size, int)), \ "Please use group size as Integer and > 0" # In case of group size is one simply return each items if group_size == 1: return [(item,) for item in basket] item_groups = [] if len(basket) >= group_size: # Sort the basket basket = sorted(basket) # Loop through the basket for i in range(len(basket) - group_size + 1): # Gets the base and add all items for each group # until end # If base is [2,3] and basket is [2,3,4,5] # then creates [2,3,4], [2,3,5] base_item_count = i + (group_size - 1) base_items = basket[i:base_item_count] for item in basket[base_item_count:]: item_groups.append(tuple(base_items) + (item,)) return item_groups @staticmethod def map_nodes(line): """ Map line into graph node key = value as array """ key_values = line.split(":") # key = int(key_values[0]) values = [] if key_values[1].strip() != "": values = [int(node) for node in key_values[1].strip().split(' ')] return values @staticmethod def filter_pairs(pair, hosts, keyspace, hashfunction, item_table, bitmap_table): """ Filter pairs by querying from cassandra table :return: """ global cluster, session if cluster is None: cluster = Cluster(hosts) session = cluster.connect(keyspace) item1 = session.execute("select item from " + item_table + " where item = %d" % pair[0]) item2 = session.execute("select item from " + item_table + " where item = %d" % pair[1]) bitmap = session.execute("select hash from " + bitmap_table + " where hash = %d" % hashfunction(pair)) print("Pair checked " + str(pair[0])) return item1 and item2 and bitmap @staticmethod def filter_pairs_broadcast(pair, freq_pair, bitmap, hashfunction): """ Filter pairs from broadcast variables :return: """ return pair[0] in freq_pair and pair[1] in freq_pair and hashfunction(pair) in bitmap def pcy_freq_items(self, item_group_rdd, hash_function, support_count): """ Get Frequent items for a particular group of items :param item_group_rdd: :param passno: :param hash_function: :param support_count: :return: """ # Hash and Items mapping order_prod_hash = item_group_rdd \ .map(lambda x: (hash_function(x), 1)) # Group, filter and get unique item sets frequent_items = order_prod_hash.reduceByKey(operator.add) \ .filter(lambda x: x[1] > support_count) \ .map(lambda x: x[0]) return frequent_items def pcy_pass(self, order_prod, pass_no, support_count, hashn, hashnplus1, is_nplus1_cache=False): """ Calculates frequent items and bitmap after n th pass :param order_prod: :param pass_no: :param support_count: :param hashn: :param hashnplus1: :param is_nplus1_cache: :return: """ item_set_count = pass_no order_prod_single = order_prod. \ flatMap(lambda x: PCYFrequentItems. group_items(x, item_set_count)) frequent_items_n = self.pcy_freq_items(order_prod_single, hashn, support_count) item_set_count += 1 order_prod_pairs = order_prod. \ flatMap(lambda x: PCYFrequentItems.group_items(x, item_set_count)) if is_nplus1_cache: order_prod_pairs = order_prod_pairs.cache() bitmap_nplus1 = self.pcy_freq_items(order_prod_pairs, hashnplus1, support_count) return frequent_items_n, bitmap_nplus1, order_prod_pairs @staticmethod def pair_bitmap(items): """ Hash function for calculation for pairs :param items: :return: """ mul = 1 for item in items: mul *= ((2 * item) + 1) return mul % 999917 @staticmethod def single(items): """ Hash function for calculation :param items: :return: """ mul = 1 for item in items: mul *= item return mul % 100000000 def configure(self): """ Configure spark and cassandra objects :param is_local_host: :return: """ # Spark Configuration conf = SparkConf().setAppName('Frequent Item Sets'). \ set('spark.cassandra.connection.host', ','.join(self.config_object["CassandraHosts"])) return SparkContext(conf=conf) def frequent_items(self, inputs, output, support_count, is_broadcast=True): """Output correlation coefficient without mean formula Args: inputs:Input file location output:Output file location support_count: is_broadcast: Item pair will be found using broadcast or not """ spark_context = self.configure() # File loading text = spark_context.textFile(inputs) order_prod = text.map(PCYFrequentItems.map_nodes).cache() pass_no = 1 freq_items, bitmap, all_pairs = self.pcy_pass(order_prod, pass_no, support_count, PCYFrequentItems.single, PCYFrequentItems.pair_bitmap, is_nplus1_cache=True) if self.IS_DEBUGGING: print("Frequent " + str(pass_no) + "-group items after pass:" + str(pass_no)) print(freq_items.collect()) print("Bitmap for " + str(pass_no + 1) + "-group items after pass:" + str(pass_no)) print(bitmap.collect()) # System will use broadcast based on user input if is_broadcast: bitmap_set = set(bitmap.collect()) freq_items_set = set(freq_items.collect()) bitmap_broadast = spark_context.broadcast(bitmap_set) freq_items_set = spark_context.broadcast(freq_items_set) frequent_pairs = all_pairs.filter(lambda x: PCYFrequentItems. filter_pairs_broadcast(x, freq_items_set.value, bitmap_broadast.value, PCYFrequentItems.pair_bitmap )) else: # Making freq items Ready to save to cassandra freq_items = freq_items.map(lambda x: {'item': x}) freq_items.saveToCassandra(self.config_object["KeySpace"], self.config_object["Item1Table"]) # Making bitmap Ready to save to cassandra bitmap = bitmap.map(lambda x: {'hash': x}) bitmap.saveToCassandra(self.config_object["KeySpace"], self.config_object["Bitmap2Table"]) print(all_pairs.count()) frequent_pairs = all_pairs.filter(lambda x: PCYFrequentItems. filter_pairs(x, self.config_object["CassandraHosts"], self.config_object["KeySpace"], PCYFrequentItems.pair_bitmap, self.config_object["Item1Table"], self.config_object["Bitmap2Table"])) if self.IS_DEBUGGING: print(all_pairs.collect()) print(frequent_pairs.collect()) # Saves as text file frequent_pairs.saveAsTextFile(output) frequent_pairs = frequent_pairs.\ map(lambda x: {'productid1': x[0], 'productid2': x[1]}) # Save final output to cassandra frequent_pairs.saveToCassandra(self.config_object["KeySpace"], self.config_object["RecommendTable"]) all_pairs.unpersist() order_prod.unpersist() def main(): """ Handles parameters for the file to run :return: """ input_path = sys.argv[1] output_path = sys.argv[2] support_thresold = int(sys.argv[3]) broadcast = 1 if len(sys.argv) > 4: broadcast = int(sys.argv[4]) pcy = PCYFrequentItems(is_debug=True) if broadcast == 1: is_broadcast = True else: is_broadcast = False pcy.frequent_items(input_path, output_path, support_thresold, is_broadcast) if __name__ == "__main__": main()
[ 37811, 22192, 298, 2378, 9412, 416, 4217, 56, 11862, 37811, 198, 198, 11748, 10088, 198, 11748, 33918, 198, 11748, 25064, 198, 6738, 279, 893, 20928, 1330, 17732, 21947, 11, 17732, 18546, 198, 11748, 279, 893, 20928, 62, 66, 562, 15918, 198, 6738, 30606, 15918, 13, 565, 5819, 1330, 38279, 628, 198, 565, 5819, 796, 6045, 198, 29891, 796, 6045, 628, 198, 4871, 4217, 56, 37, 46018, 23022, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 9938, 22192, 298, 2378, 1351, 1262, 4217, 56, 11862, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 3180, 62, 30531, 38, 2751, 796, 10352, 198, 220, 220, 220, 4566, 62, 15252, 796, 6045, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 318, 62, 24442, 11, 4566, 62, 7753, 2625, 11250, 13, 17752, 1, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 21394, 262, 4238, 1915, 328, 1655, 11507, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 318, 62, 24442, 25, 12578, 2824, 6218, 611, 900, 2081, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 1797, 62, 30531, 38, 2751, 796, 318, 62, 24442, 198, 220, 220, 220, 220, 220, 220, 220, 33918, 62, 7890, 796, 1280, 7, 11250, 62, 7753, 737, 961, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 11250, 62, 15252, 796, 33918, 13, 46030, 7, 17752, 62, 7890, 8, 628, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 1448, 62, 23814, 7, 65, 11715, 11, 1448, 62, 7857, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3497, 2378, 62, 24432, 422, 257, 7988, 198, 220, 220, 220, 220, 220, 220, 220, 16409, 23243, 3709, 416, 511, 29052, 1271, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 7988, 25, 347, 11715, 284, 2989, 262, 2378, 62, 8094, 422, 357, 24089, 307, 257, 2060, 6383, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1448, 62, 7857, 25, 12849, 286, 262, 2378, 62, 8094, 284, 1296, 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, 6818, 357, 8094, 62, 7857, 18189, 352, 290, 318, 39098, 7, 8094, 62, 7857, 11, 493, 36911, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 5492, 779, 1448, 2546, 355, 34142, 290, 220, 1875, 657, 1, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 554, 1339, 286, 1448, 2546, 318, 530, 2391, 1441, 1123, 3709, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1448, 62, 7857, 6624, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 47527, 9186, 35751, 329, 2378, 287, 7988, 60, 628, 220, 220, 220, 220, 220, 220, 220, 2378, 62, 24432, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 65, 11715, 8, 18189, 1448, 62, 7857, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 33947, 262, 7988, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7988, 796, 23243, 7, 65, 11715, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 26304, 832, 262, 7988, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 11925, 7, 65, 11715, 8, 532, 1448, 62, 7857, 1343, 352, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 29620, 262, 2779, 290, 751, 477, 3709, 329, 1123, 1448, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1566, 886, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1002, 2779, 318, 685, 17, 11, 18, 60, 290, 7988, 318, 685, 17, 11, 18, 11, 19, 11, 20, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 788, 8075, 685, 17, 11, 18, 11, 19, 4357, 685, 17, 11, 18, 11, 20, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2779, 62, 9186, 62, 9127, 796, 1312, 1343, 357, 8094, 62, 7857, 532, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2779, 62, 23814, 796, 7988, 58, 72, 25, 8692, 62, 9186, 62, 9127, 60, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 2378, 287, 7988, 58, 8692, 62, 9186, 62, 9127, 25, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2378, 62, 24432, 13, 33295, 7, 83, 29291, 7, 8692, 62, 23814, 8, 1343, 357, 9186, 11, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2378, 62, 24432, 628, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 3975, 62, 77, 4147, 7, 1370, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 9347, 1627, 656, 4823, 10139, 1994, 796, 1988, 355, 7177, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1994, 62, 27160, 796, 1627, 13, 35312, 7, 2404, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 1994, 796, 493, 7, 2539, 62, 27160, 58, 15, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 3815, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1994, 62, 27160, 58, 16, 4083, 36311, 3419, 14512, 366, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3815, 796, 685, 600, 7, 17440, 8, 329, 10139, 287, 1994, 62, 27160, 58, 16, 4083, 36311, 22446, 35312, 10786, 705, 15437, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 3815, 628, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 8106, 62, 79, 3468, 7, 24874, 11, 11453, 11, 8251, 10223, 11, 12234, 8818, 11, 2378, 62, 11487, 11, 1643, 8899, 62, 11487, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 25853, 14729, 416, 42517, 1112, 422, 30606, 15918, 3084, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 3298, 13946, 11, 6246, 198, 220, 220, 220, 220, 220, 220, 220, 611, 13946, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13946, 796, 38279, 7, 4774, 82, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6246, 796, 13946, 13, 8443, 7, 13083, 10223, 8, 628, 220, 220, 220, 220, 220, 220, 220, 2378, 16, 796, 6246, 13, 41049, 7203, 19738, 2378, 422, 366, 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, 1343, 2378, 62, 11487, 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, 1343, 366, 810, 2378, 796, 4064, 67, 1, 4064, 5166, 58, 15, 12962, 628, 220, 220, 220, 220, 220, 220, 220, 2378, 17, 796, 6246, 13, 41049, 7203, 19738, 2378, 422, 366, 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, 1343, 2378, 62, 11487, 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, 1343, 366, 810, 2378, 796, 4064, 67, 1, 4064, 5166, 58, 16, 12962, 628, 220, 220, 220, 220, 220, 220, 220, 1643, 8899, 796, 6246, 13, 41049, 7203, 19738, 12234, 422, 366, 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, 1343, 1643, 8899, 62, 11487, 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, 1343, 366, 810, 12234, 796, 4064, 67, 1, 4064, 12234, 8818, 7, 24874, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 47, 958, 10667, 366, 1343, 965, 7, 24874, 58, 15, 60, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 2378, 16, 290, 2378, 17, 290, 1643, 8899, 628, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 8106, 62, 79, 3468, 62, 36654, 2701, 7, 24874, 11, 2030, 80, 62, 24874, 11, 1643, 8899, 11, 12234, 8818, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 25853, 14729, 422, 7025, 9633, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 5166, 58, 15, 60, 287, 2030, 80, 62, 24874, 290, 5166, 58, 16, 60, 287, 2030, 80, 62, 24874, 290, 12234, 8818, 7, 24874, 8, 287, 1643, 8899, 628, 220, 220, 220, 825, 279, 948, 62, 19503, 80, 62, 23814, 7, 944, 11, 2378, 62, 8094, 62, 81, 1860, 11, 12234, 62, 8818, 11, 1104, 62, 9127, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3497, 22192, 298, 3709, 329, 257, 1948, 1448, 286, 3709, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 2378, 62, 8094, 62, 81, 1860, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1208, 3919, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 12234, 62, 8818, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1104, 62, 9127, 25, 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, 21059, 290, 17230, 16855, 198, 220, 220, 220, 220, 220, 220, 220, 1502, 62, 1676, 67, 62, 17831, 796, 2378, 62, 8094, 62, 81, 1860, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 764, 8899, 7, 50033, 2124, 25, 357, 17831, 62, 8818, 7, 87, 828, 352, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4912, 11, 8106, 290, 651, 3748, 2378, 5621, 198, 220, 220, 220, 220, 220, 220, 220, 10792, 62, 23814, 796, 1502, 62, 1676, 67, 62, 17831, 13, 445, 7234, 3886, 9218, 7, 46616, 13, 2860, 8, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 764, 24455, 7, 50033, 2124, 25, 2124, 58, 16, 60, 1875, 1104, 62, 9127, 8, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 764, 8899, 7, 50033, 2124, 25, 2124, 58, 15, 12962, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 10792, 62, 23814, 628, 220, 220, 220, 825, 279, 948, 62, 6603, 7, 944, 11, 1502, 62, 1676, 67, 11, 1208, 62, 3919, 11, 1104, 62, 9127, 11, 12234, 77, 11, 12234, 77, 9541, 16, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 77, 9541, 16, 62, 23870, 28, 25101, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 27131, 689, 10792, 3709, 290, 1643, 8899, 706, 299, 294, 1208, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1502, 62, 1676, 67, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1208, 62, 3919, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1104, 62, 9127, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 12234, 77, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 12234, 77, 9541, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 318, 62, 77, 9541, 16, 62, 23870, 25, 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, 2378, 62, 2617, 62, 9127, 796, 1208, 62, 3919, 198, 220, 220, 220, 220, 220, 220, 220, 1502, 62, 1676, 67, 62, 29762, 796, 1502, 62, 1676, 67, 13, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6228, 13912, 7, 50033, 2124, 25, 4217, 56, 37, 46018, 23022, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1448, 62, 23814, 7, 87, 11, 2378, 62, 2617, 62, 9127, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 10792, 62, 23814, 62, 77, 796, 2116, 13, 79, 948, 62, 19503, 80, 62, 23814, 7, 2875, 62, 1676, 67, 62, 29762, 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, 12234, 77, 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, 1104, 62, 9127, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2378, 62, 2617, 62, 9127, 15853, 352, 628, 220, 220, 220, 220, 220, 220, 220, 1502, 62, 1676, 67, 62, 79, 3468, 796, 1502, 62, 1676, 67, 13, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6228, 13912, 7, 50033, 2124, 25, 4217, 56, 37, 46018, 23022, 13, 8094, 62, 23814, 7, 87, 11, 2378, 62, 2617, 62, 9127, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 611, 318, 62, 77, 9541, 16, 62, 23870, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1502, 62, 1676, 67, 62, 79, 3468, 796, 1502, 62, 1676, 67, 62, 79, 3468, 13, 23870, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1643, 8899, 62, 77, 9541, 16, 796, 2116, 13, 79, 948, 62, 19503, 80, 62, 23814, 7, 2875, 62, 1676, 67, 62, 79, 3468, 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, 12234, 77, 9541, 16, 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, 1104, 62, 9127, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 10792, 62, 23814, 62, 77, 11, 1643, 8899, 62, 77, 9541, 16, 11, 1502, 62, 1676, 67, 62, 79, 3468, 628, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 5166, 62, 2545, 8899, 7, 23814, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 21059, 2163, 329, 17952, 329, 14729, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 3709, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 35971, 796, 352, 198, 220, 220, 220, 220, 220, 220, 220, 329, 2378, 287, 3709, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35971, 1635, 28, 14808, 17, 1635, 2378, 8, 1343, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 35971, 4064, 860, 17032, 1558, 628, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 2060, 7, 23814, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 21059, 2163, 329, 17952, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 3709, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 35971, 796, 352, 198, 220, 220, 220, 220, 220, 220, 220, 329, 2378, 287, 3709, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35971, 1635, 28, 2378, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 35971, 4064, 1802, 10535, 628, 220, 220, 220, 825, 17425, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 17056, 495, 9009, 290, 30606, 15918, 5563, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 318, 62, 12001, 62, 4774, 25, 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, 17732, 28373, 198, 220, 220, 220, 220, 220, 220, 220, 1013, 796, 17732, 18546, 22446, 2617, 4677, 5376, 10786, 37, 46018, 9097, 21394, 27691, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 900, 10786, 2777, 668, 13, 66, 562, 15918, 13, 38659, 13, 4774, 3256, 705, 4032, 13, 22179, 7, 944, 13, 11250, 62, 15252, 14692, 43529, 15918, 17932, 82, 8973, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 17732, 21947, 7, 10414, 28, 10414, 8, 628, 220, 220, 220, 825, 10792, 62, 23814, 7, 944, 11, 17311, 11, 5072, 11, 1104, 62, 9127, 11, 318, 62, 36654, 2701, 28, 17821, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 26410, 16096, 35381, 1231, 1612, 10451, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17311, 25, 20560, 2393, 4067, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5072, 25, 26410, 2393, 4067, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1104, 62, 9127, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 36654, 2701, 25, 9097, 5166, 481, 307, 1043, 1262, 7025, 393, 407, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 9009, 62, 22866, 796, 2116, 13, 11250, 495, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 9220, 11046, 198, 220, 220, 220, 220, 220, 220, 220, 2420, 796, 9009, 62, 22866, 13, 5239, 8979, 7, 15414, 82, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1502, 62, 1676, 67, 796, 2420, 13, 8899, 7, 5662, 56, 37, 46018, 23022, 13, 8899, 62, 77, 4147, 737, 23870, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1208, 62, 3919, 796, 352, 198, 220, 220, 220, 220, 220, 220, 220, 2030, 80, 62, 23814, 11, 1643, 8899, 11, 477, 62, 79, 3468, 796, 2116, 13, 79, 948, 62, 6603, 7, 2875, 62, 1676, 67, 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, 1208, 62, 3919, 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, 1104, 62, 9127, 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, 4217, 56, 37, 46018, 23022, 13, 29762, 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, 4217, 56, 37, 46018, 23022, 13, 24874, 62, 2545, 8899, 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, 318, 62, 77, 9541, 16, 62, 23870, 28, 17821, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 1797, 62, 30531, 38, 2751, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 37, 46018, 366, 1343, 965, 7, 6603, 62, 3919, 8, 1343, 27444, 8094, 3709, 706, 1208, 11097, 1343, 965, 7, 6603, 62, 3919, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 19503, 80, 62, 23814, 13, 33327, 28955, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 13128, 8899, 329, 366, 1343, 965, 7, 6603, 62, 3919, 1343, 352, 8, 1343, 27444, 8094, 3709, 706, 1208, 11097, 1343, 965, 7, 6603, 62, 3919, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 2545, 8899, 13, 33327, 28955, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4482, 481, 779, 7025, 1912, 319, 2836, 5128, 198, 220, 220, 220, 220, 220, 220, 220, 611, 318, 62, 36654, 2701, 25, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1643, 8899, 62, 2617, 796, 900, 7, 2545, 8899, 13, 33327, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2030, 80, 62, 23814, 62, 2617, 796, 900, 7, 19503, 80, 62, 23814, 13, 33327, 28955, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1643, 8899, 62, 36654, 459, 796, 9009, 62, 22866, 13, 36654, 2701, 7, 2545, 8899, 62, 2617, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2030, 80, 62, 23814, 62, 2617, 796, 9009, 62, 22866, 13, 36654, 2701, 7, 19503, 80, 62, 23814, 62, 2617, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10792, 62, 79, 3468, 796, 477, 62, 79, 3468, 13, 24455, 7, 50033, 2124, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4217, 56, 37, 46018, 23022, 13, 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, 8106, 62, 79, 3468, 62, 36654, 2701, 7, 87, 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, 220, 220, 220, 220, 220, 220, 220, 2030, 80, 62, 23814, 62, 2617, 13, 8367, 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, 220, 220, 220, 220, 220, 220, 220, 1643, 8899, 62, 36654, 459, 13, 8367, 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, 220, 220, 220, 220, 220, 220, 220, 4217, 56, 37, 46018, 23022, 13, 24874, 62, 2545, 8899, 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, 220, 220, 220, 220, 220, 220, 220, 15306, 628, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 16427, 2030, 80, 3709, 23432, 284, 3613, 284, 30606, 15918, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2030, 80, 62, 23814, 796, 2030, 80, 62, 23814, 13, 8899, 7, 50033, 2124, 25, 1391, 6, 9186, 10354, 2124, 30072, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2030, 80, 62, 23814, 13, 21928, 2514, 43529, 15918, 7, 944, 13, 11250, 62, 15252, 14692, 9218, 14106, 33116, 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, 2116, 13, 11250, 62, 15252, 14692, 7449, 16, 10962, 8973, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 16427, 1643, 8899, 23432, 284, 3613, 284, 30606, 15918, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1643, 8899, 796, 1643, 8899, 13, 8899, 7, 50033, 2124, 25, 1391, 6, 17831, 10354, 2124, 30072, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1643, 8899, 13, 21928, 2514, 43529, 15918, 7, 944, 13, 11250, 62, 15252, 14692, 9218, 14106, 33116, 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, 2116, 13, 11250, 62, 15252, 14692, 13128, 8899, 17, 10962, 8973, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 439, 62, 79, 3468, 13, 9127, 28955, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10792, 62, 79, 3468, 796, 477, 62, 79, 3468, 13, 24455, 7, 50033, 2124, 25, 4217, 56, 37, 46018, 23022, 13, 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, 8106, 62, 79, 3468, 7, 87, 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, 2116, 13, 11250, 62, 15252, 14692, 43529, 15918, 17932, 82, 33116, 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, 2116, 13, 11250, 62, 15252, 14692, 9218, 14106, 33116, 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, 4217, 56, 37, 46018, 23022, 13, 24874, 62, 2545, 8899, 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, 2116, 13, 11250, 62, 15252, 14692, 7449, 16, 10962, 33116, 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, 2116, 13, 11250, 62, 15252, 14692, 13128, 8899, 17, 10962, 8973, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 1797, 62, 30531, 38, 2751, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 439, 62, 79, 3468, 13, 33327, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 69, 46018, 62, 79, 3468, 13, 33327, 28955, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 311, 3080, 355, 2420, 2393, 198, 220, 220, 220, 220, 220, 220, 220, 10792, 62, 79, 3468, 13, 21928, 1722, 8206, 8979, 7, 22915, 8, 628, 220, 220, 220, 220, 220, 220, 220, 10792, 62, 79, 3468, 796, 10792, 62, 79, 3468, 13, 59, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3975, 7, 50033, 2124, 25, 1391, 6, 11167, 312, 16, 10354, 2124, 58, 15, 4357, 705, 11167, 312, 17, 10354, 2124, 58, 16, 60, 30072, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 12793, 2457, 5072, 284, 30606, 15918, 198, 220, 220, 220, 220, 220, 220, 220, 10792, 62, 79, 3468, 13, 21928, 2514, 43529, 15918, 7, 944, 13, 11250, 62, 15252, 14692, 9218, 14106, 33116, 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, 2116, 13, 11250, 62, 15252, 14692, 41248, 10962, 8973, 8, 628, 220, 220, 220, 220, 220, 220, 220, 477, 62, 79, 3468, 13, 403, 19276, 396, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1502, 62, 1676, 67, 13, 403, 19276, 396, 3419, 628, 198, 4299, 1388, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 7157, 829, 10007, 329, 262, 2393, 284, 1057, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5128, 62, 6978, 796, 25064, 13, 853, 85, 58, 16, 60, 198, 220, 220, 220, 5072, 62, 6978, 796, 25064, 13, 853, 85, 58, 17, 60, 198, 220, 220, 220, 1104, 62, 400, 411, 727, 796, 493, 7, 17597, 13, 853, 85, 58, 18, 12962, 628, 220, 220, 220, 7025, 796, 352, 198, 220, 220, 220, 611, 18896, 7, 17597, 13, 853, 85, 8, 1875, 604, 25, 198, 220, 220, 220, 220, 220, 220, 220, 7025, 796, 493, 7, 17597, 13, 853, 85, 58, 19, 12962, 628, 220, 220, 220, 279, 948, 796, 4217, 56, 37, 46018, 23022, 7, 271, 62, 24442, 28, 17821, 8, 198, 220, 220, 220, 611, 7025, 6624, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 318, 62, 36654, 2701, 796, 6407, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 318, 62, 36654, 2701, 796, 10352, 628, 220, 220, 220, 279, 948, 13, 69, 46018, 62, 23814, 7, 15414, 62, 6978, 11, 5072, 62, 6978, 11, 1104, 62, 400, 411, 727, 11, 318, 62, 36654, 2701, 8, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ]
1.911996
5,602
""" A wrapper around my pnc.py module """ import os.path import wx import wx.lib.filebrowsebutton as filebrowse import pnc class MyFrame(wx.Frame): """ This is MyFrame. It just shows a few controls on a wxPanel, and has a simple menu. Use this file inFileBtn Write this root name TextEntry and starting number TextEntry To here outDirRootButton Optional subdirectory TextEntry Move the input file there, too CheckBox """ def evh_close(self, evt): #pylint: disable=unused-argument """Event handler for the button click.""" self.Close() def evh_doit(self, evt): #pylint: disable=unused-argument """Event handler for the button click.""" self.SetStatusText('working...') print '' out_dir = self.file_browse_root.GetValue() out_new_dir = self.tc_out_dir.GetValue() out_dir = os.path.join(out_dir, out_new_dir) b_success = pnc.get_photos(self.btn_infile.GetValue(), out_dir, self.tc_out_fname.GetValue(), self.cb_move_file.GetValue()) if b_success: self.SetStatusText('Done!') else: self.SetStatusText('Failed') def cback_infile(self, evt): #pylint: disable=unused-argument """ dummy callback """ pass def cback_file_root(self, evt): #pylint: disable=unused-argument """ dummy callback """ pass class MyApp(wx.App): """ a simple GUI """ def OnInit(self): #pylint: disable=invalid-name """ let's get this party started """ frame = MyFrame(None, "Panasonic .PNC to .JPG converter") self.SetTopWindow(frame) frame.Show(True) return True # app = MyApp(redirect=True) app = MyApp() #pylint: disable=invalid-name app.MainLoop()
[ 37811, 198, 32, 29908, 1088, 616, 279, 10782, 13, 9078, 8265, 198, 37811, 198, 198, 11748, 28686, 13, 6978, 198, 198, 11748, 266, 87, 198, 11748, 266, 87, 13, 8019, 13, 7753, 25367, 325, 16539, 355, 2393, 25367, 325, 198, 198, 11748, 279, 10782, 198, 198, 4871, 2011, 19778, 7, 49345, 13, 19778, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 318, 2011, 19778, 13, 220, 632, 655, 2523, 257, 1178, 6973, 319, 257, 266, 87, 26639, 11, 198, 220, 220, 220, 290, 468, 257, 2829, 6859, 13, 628, 220, 220, 220, 5765, 428, 2393, 287, 8979, 33, 34106, 198, 220, 220, 220, 19430, 428, 6808, 1438, 8255, 30150, 198, 220, 220, 220, 290, 3599, 1271, 8255, 30150, 198, 220, 220, 220, 1675, 994, 503, 35277, 30016, 21864, 198, 220, 220, 220, 32233, 850, 34945, 8255, 30150, 198, 220, 220, 220, 10028, 262, 5128, 2393, 612, 11, 1165, 6822, 14253, 198, 220, 220, 220, 37227, 628, 198, 220, 220, 220, 825, 819, 71, 62, 19836, 7, 944, 11, 819, 83, 2599, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 79, 2645, 600, 25, 15560, 28, 403, 1484, 12, 49140, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 9237, 21360, 329, 262, 4936, 3904, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 26125, 3419, 628, 220, 220, 220, 825, 819, 71, 62, 4598, 270, 7, 944, 11, 819, 83, 2599, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 79, 2645, 600, 25, 15560, 28, 403, 1484, 12, 49140, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 9237, 21360, 329, 262, 4936, 3904, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 7248, 19580, 8206, 10786, 16090, 986, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 10148, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 15908, 796, 2116, 13, 7753, 62, 25367, 325, 62, 15763, 13, 3855, 11395, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 3605, 62, 15908, 796, 2116, 13, 23047, 62, 448, 62, 15908, 13, 3855, 11395, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 15908, 796, 28686, 13, 6978, 13, 22179, 7, 448, 62, 15908, 11, 503, 62, 3605, 62, 15908, 8, 198, 220, 220, 220, 220, 220, 220, 220, 275, 62, 13138, 796, 279, 10782, 13, 1136, 62, 24729, 7, 944, 13, 46118, 62, 259, 7753, 13, 3855, 11395, 22784, 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, 503, 62, 15908, 11, 2116, 13, 23047, 62, 448, 62, 69, 3672, 13, 3855, 11395, 22784, 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, 2116, 13, 21101, 62, 21084, 62, 7753, 13, 3855, 11395, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 611, 275, 62, 13138, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 7248, 19580, 8206, 10786, 45677, 0, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 7248, 19580, 8206, 10786, 37, 6255, 11537, 628, 220, 220, 220, 825, 269, 1891, 62, 259, 7753, 7, 944, 11, 819, 83, 2599, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 79, 2645, 600, 25, 15560, 28, 403, 1484, 12, 49140, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 31548, 23838, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1208, 628, 220, 220, 220, 825, 269, 1891, 62, 7753, 62, 15763, 7, 944, 11, 819, 83, 2599, 220, 1303, 79, 2645, 600, 25, 15560, 28, 403, 1484, 12, 49140, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 31548, 23838, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1208, 198, 198, 4871, 2011, 4677, 7, 49345, 13, 4677, 2599, 198, 220, 220, 220, 37227, 257, 2829, 25757, 37227, 198, 220, 220, 220, 825, 1550, 31768, 7, 944, 2599, 220, 220, 220, 220, 220, 1303, 79, 2645, 600, 25, 15560, 28, 259, 12102, 12, 3672, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 1309, 338, 651, 428, 2151, 2067, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 5739, 796, 2011, 19778, 7, 14202, 11, 366, 15730, 30189, 764, 47, 7792, 284, 764, 41, 6968, 38394, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 7248, 9126, 27703, 7, 14535, 8, 198, 220, 220, 220, 220, 220, 220, 220, 5739, 13, 15307, 7, 17821, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 198, 198, 2, 598, 796, 2011, 4677, 7, 445, 1060, 28, 17821, 8, 198, 1324, 796, 2011, 4677, 3419, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 79, 2645, 600, 25, 15560, 28, 259, 12102, 12, 3672, 198, 1324, 13, 13383, 39516, 3419, 198 ]
2.190367
872
import sys from src.Exchange import Exchange if __name__ == "__main__": exchange = None if len(sys.argv) == 2: if sys.argv[1] == "debug": # Exchange outputs using debug mode. exchange = Exchange(debug="dump") elif sys.argv[1] == "none": # Exchange won't output anything. exchange = Exchange(debug="none") else: raise Exception("Command line argument should be either 'dump' or 'none'") else: exchange = Exchange() exchange.open_exchange() input() # Pressing the enter key will cause the server process to terminate. exchange.close_exchange()
[ 11748, 25064, 198, 198, 6738, 12351, 13, 3109, 3803, 1330, 12516, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 5163, 796, 6045, 198, 220, 220, 220, 611, 18896, 7, 17597, 13, 853, 85, 8, 6624, 362, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 25064, 13, 853, 85, 58, 16, 60, 6624, 366, 24442, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 12516, 23862, 1262, 14257, 4235, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5163, 796, 12516, 7, 24442, 2625, 39455, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 25064, 13, 853, 85, 58, 16, 60, 6624, 366, 23108, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 12516, 1839, 470, 5072, 1997, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5163, 796, 12516, 7, 24442, 2625, 23108, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 35528, 7203, 21575, 1627, 4578, 815, 307, 2035, 705, 39455, 6, 393, 705, 23108, 6, 4943, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5163, 796, 12516, 3419, 198, 220, 220, 220, 5163, 13, 9654, 62, 1069, 3803, 3419, 198, 220, 220, 220, 5128, 3419, 1303, 4332, 278, 262, 3802, 1994, 481, 2728, 262, 4382, 1429, 284, 23654, 13, 198, 220, 220, 220, 5163, 13, 19836, 62, 1069, 3803, 3419 ]
2.505703
263
from .signal import ExtrinsicRewardSignal
[ 6738, 764, 12683, 282, 1330, 5683, 81, 1040, 291, 48123, 11712, 282, 198 ]
3.230769
13
import server if __name__ == "__main__": server.app.run(host='0.0.0.0',port=5000,debug=False)
[ 11748, 4382, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 4382, 13, 1324, 13, 5143, 7, 4774, 11639, 15, 13, 15, 13, 15, 13, 15, 3256, 634, 28, 27641, 11, 24442, 28, 25101, 8, 198 ]
2.302326
43
import tempfile from logging import getLogger import mailparser from django.conf import settings from django.core.exceptions import ImproperlyConfigured from datahub.documents import utils as documents from datahub.interaction.email_processors.processors import CalendarInteractionEmailProcessor logger = getLogger(__name__) BUCKET_ID = 'mailbox' def get_mail_docs_in_bucket(): """ Gets all mail documents in the bucket. """ if BUCKET_ID not in settings.DOCUMENT_BUCKETS: raise ImproperlyConfigured(f'Bucket "{BUCKET_ID}" is missing in settings') config = settings.DOCUMENT_BUCKETS[BUCKET_ID] if 'bucket' not in config: raise ImproperlyConfigured(f'Bucket "{BUCKET_ID}" not configured properly in settings') name = config['bucket'] if not name: raise ImproperlyConfigured( f'Bucket "{BUCKET_ID}" bucket value not configured properly in settings', ) client = documents.get_s3_client_for_bucket(bucket_id=BUCKET_ID) paginator = client.get_paginator('list_objects') for page in paginator.paginate(Bucket=name): for doc in page.get('Contents') or []: key = doc['Key'] with tempfile.TemporaryFile(mode='w+b') as f: client.download_fileobj(Bucket=name, Key=key, Fileobj=f) f.seek(0) content = f.read() yield {'source': key, 'content': content} def process_ingestion_emails(): """ Gets all new mail documents in the bucket and process each message. """ processor = CalendarInteractionEmailProcessor() for message in get_mail_docs_in_bucket(): source = message['source'] try: documents.delete_document(bucket_id=BUCKET_ID, document_key=message['source']) except Exception as e: logger.exception('Error deleting message: "%s", error: "%s"', source, e) continue try: email = mailparser.parse_from_bytes(message['content']) processed, reason = processor.process_email(message=email) if not processed: logger.error('Error parsing message: "%s", error: "%s"', source, reason) else: logger.info(reason) except Exception as e: logger.exception('Error processing message: "%s", error: "%s"', source, e) logger.info( 'Successfully processed message "%s" and deleted document from bucket "%s"', source, BUCKET_ID, )
[ 11748, 20218, 7753, 198, 6738, 18931, 1330, 651, 11187, 1362, 198, 198, 11748, 6920, 48610, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 7295, 13, 1069, 11755, 1330, 12205, 525, 306, 16934, 1522, 198, 198, 6738, 4818, 993, 549, 13, 15390, 2886, 1330, 3384, 4487, 355, 4963, 198, 6738, 4818, 993, 549, 13, 3849, 2673, 13, 12888, 62, 14681, 669, 13, 14681, 669, 1330, 26506, 9492, 2673, 15333, 18709, 273, 198, 198, 6404, 1362, 796, 651, 11187, 1362, 7, 834, 3672, 834, 8, 198, 198, 33, 16696, 2767, 62, 2389, 796, 705, 4529, 3524, 6, 628, 198, 4299, 651, 62, 4529, 62, 31628, 62, 259, 62, 27041, 316, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 29620, 477, 6920, 4963, 287, 262, 19236, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 347, 16696, 2767, 62, 2389, 407, 287, 6460, 13, 38715, 5883, 3525, 62, 33, 16696, 32716, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 12205, 525, 306, 16934, 1522, 7, 69, 6, 33, 38811, 45144, 33, 16696, 2767, 62, 2389, 36786, 318, 4814, 287, 6460, 11537, 628, 220, 220, 220, 4566, 796, 6460, 13, 38715, 5883, 3525, 62, 33, 16696, 32716, 58, 33, 16696, 2767, 62, 2389, 60, 198, 220, 220, 220, 611, 705, 27041, 316, 6, 407, 287, 4566, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 12205, 525, 306, 16934, 1522, 7, 69, 6, 33, 38811, 45144, 33, 16696, 2767, 62, 2389, 36786, 407, 17839, 6105, 287, 6460, 11537, 628, 220, 220, 220, 1438, 796, 4566, 17816, 27041, 316, 20520, 198, 220, 220, 220, 611, 407, 1438, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 12205, 525, 306, 16934, 1522, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 6, 33, 38811, 45144, 33, 16696, 2767, 62, 2389, 36786, 19236, 1988, 407, 17839, 6105, 287, 6460, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 5456, 796, 4963, 13, 1136, 62, 82, 18, 62, 16366, 62, 1640, 62, 27041, 316, 7, 27041, 316, 62, 312, 28, 33, 16696, 2767, 62, 2389, 8, 628, 220, 220, 220, 42208, 20900, 796, 5456, 13, 1136, 62, 79, 363, 20900, 10786, 4868, 62, 48205, 11537, 198, 220, 220, 220, 329, 2443, 287, 42208, 20900, 13, 79, 363, 4559, 7, 33, 38811, 28, 3672, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 329, 2205, 287, 2443, 13, 1136, 10786, 15842, 11537, 393, 685, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1994, 796, 2205, 17816, 9218, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 351, 20218, 7753, 13, 12966, 5551, 8979, 7, 14171, 11639, 86, 10, 65, 11537, 355, 277, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5456, 13, 15002, 62, 7753, 26801, 7, 33, 38811, 28, 3672, 11, 7383, 28, 2539, 11, 9220, 26801, 28, 69, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 13, 36163, 7, 15, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2695, 796, 277, 13, 961, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7800, 1391, 6, 10459, 10354, 1994, 11, 705, 11299, 10354, 2695, 92, 628, 198, 4299, 1429, 62, 278, 395, 295, 62, 368, 1768, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 29620, 477, 649, 6920, 4963, 287, 262, 19236, 290, 1429, 1123, 3275, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 12649, 796, 26506, 9492, 2673, 15333, 18709, 273, 3419, 628, 220, 220, 220, 329, 3275, 287, 651, 62, 4529, 62, 31628, 62, 259, 62, 27041, 316, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 2723, 796, 3275, 17816, 10459, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4963, 13, 33678, 62, 22897, 7, 27041, 316, 62, 312, 28, 33, 16696, 2767, 62, 2389, 11, 3188, 62, 2539, 28, 20500, 17816, 10459, 6, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 35528, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 1069, 4516, 10786, 12331, 34817, 3275, 25, 36521, 82, 1600, 4049, 25, 36521, 82, 1, 3256, 2723, 11, 304, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2555, 628, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3053, 796, 6920, 48610, 13, 29572, 62, 6738, 62, 33661, 7, 20500, 17816, 11299, 6, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13686, 11, 1738, 796, 12649, 13, 14681, 62, 12888, 7, 20500, 28, 12888, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 407, 13686, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 18224, 10786, 12331, 32096, 3275, 25, 36521, 82, 1600, 4049, 25, 36521, 82, 1, 3256, 2723, 11, 1738, 8, 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, 49706, 13, 10951, 7, 41181, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 35528, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 1069, 4516, 10786, 12331, 7587, 3275, 25, 36521, 82, 1600, 4049, 25, 36521, 82, 1, 3256, 2723, 11, 304, 8, 628, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 10951, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 33244, 2759, 13686, 3275, 36521, 82, 1, 290, 13140, 3188, 422, 19236, 36521, 82, 1, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2723, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 347, 16696, 2767, 62, 2389, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198 ]
2.421606
1,046
import random as r offBoundsMsgs = ["Der er ikkje noko i den retninga.", "Du møtte ein vegg.", "Du kjem deg ikkje vidare i den retninga."] roomSizeX, roomSizeY = 2, 1 # Dette er baseklassa til allle romma
[ 11748, 4738, 355, 374, 628, 198, 2364, 33, 3733, 10128, 14542, 796, 14631, 28532, 1931, 220, 36073, 18015, 299, 16044, 1312, 2853, 1005, 768, 64, 33283, 366, 35660, 285, 24172, 83, 660, 304, 259, 1569, 1130, 33283, 366, 35660, 479, 73, 368, 3396, 220, 36073, 18015, 410, 312, 533, 1312, 2853, 1005, 768, 64, 526, 60, 628, 198, 3823, 10699, 55, 11, 2119, 10699, 56, 796, 362, 11, 352, 198, 220, 220, 220, 1303, 4614, 660, 1931, 2779, 74, 31172, 64, 21502, 477, 293, 374, 2002, 64, 198 ]
2.420455
88
#!/usr/bin/env python # _*_ coding: utf-8 _*_ import os import argparse from pymatflow.vasp.dfpt import dfpt_run """ usage: """ params = {} if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("-d", "--directory", type=str, default="tmp-vasp-static", help="directory of the static running") parser.add_argument("-f", "--file", type=str, help="the xyz file name") parser.add_argument("--runopt", type=str, default="gen", help="gen, run, or genrun") parser.add_argument("--auto", type=int, default=3, help="auto:0 nothing, 1: copying files to server, 2: copying and executing in remote server, 3: pymatflow used in server with direct submit, in order use auto=1, 2, you must make sure there is a working ~/.pymatflow/server_[pbs|yh].conf") parser.add_argument("--mode", type=int, default=0, choices=[0, 1], help="run mode for dfpt. 0: brand new with a new directory; 1: continue in the existing directory") # -------------------------------------------------------- # INCAR PARAMETERS # -------------------------------------------------------- parser.add_argument("--prec", type=str, default="Normal", choices=["Normal", "Accurate", "A", "N"], help="PREC, default value: Normal") parser.add_argument("--encut", type=int, default=300, help="ENCUT, default value: 300 eV") parser.add_argument("--ediff", type=float, default=1.0e-4, help="EDIFF, default value: 1.0e-4") parser.add_argument("--kpoints-mp", type=int, nargs="+", default=[1, 1, 1, 0, 0, 0], help="set kpoints like -k 1 1 1 0 0 0") parser.add_argument("--ismear", type=int, default=0, help="smearing type(methfessel-paxton(>0), gaussian(0), fermi-dirac(-1), tetra(-4), tetra-bloch-dorrected(-5)), default: 0") parser.add_argument("--sigma", type=float, default=0.01, help="determines the width of the smearing in eV.") # ----------------------------------------------------------------- # ---------------------- # properties parametes # --------------------- #parser.add_argument("--lorbit", help="", type=int, default=None) #parser.add_argument("--loptics", help="", type=str, default="FALSE") # ----------------------------------------------------------------- # run params # ----------------------------------------------------------------- parser.add_argument("--mpi", type=str, default="", help="MPI command") parser.add_argument("--server", type=str, default="pbs", choices=["pbs", "yh", "lsf_sz"], help="type of remote server, can be pbs or yh or lsf_sz") parser.add_argument("--jobname", type=str, default="vasp-dfpt", help="jobname on the pbs server") parser.add_argument("--nodes", type=int, default=1, help="Nodes used in server") parser.add_argument("--ppn", type=int, default=32, help="ppn of the server") # ========================================================== # transfer parameters from the arg parser to static_run setting # ========================================================== args = parser.parse_args() params["PREC"] = args.prec params["ENCUT"] = args.encut params["EDIFF"] = args.ediff params["ISMEAR"] = args.ismear params["SIGMA"] = args.sigma task = dfpt_run() task.get_xyz(args.file) task.set_params(params=params) task.set_kpoints(kpoints_mp=args.kpoints_mp) task.set_run(mpi=args.mpi, server=args.server, jobname=args.jobname, nodes=args.nodes, ppn=args.ppn) task.dfpt(directory=args.directory, runopt=args.runopt, auto=args.auto, mode=args.mode)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 201, 198, 2, 4808, 9, 62, 19617, 25, 3384, 69, 12, 23, 4808, 9, 62, 201, 198, 201, 198, 11748, 28686, 201, 198, 11748, 1822, 29572, 201, 198, 201, 198, 201, 198, 201, 198, 6738, 279, 4948, 265, 11125, 13, 85, 5126, 13, 7568, 457, 1330, 47764, 457, 62, 5143, 201, 198, 201, 198, 37811, 201, 198, 26060, 25, 201, 198, 37811, 201, 198, 201, 198, 201, 198, 37266, 796, 23884, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 201, 198, 220, 220, 220, 30751, 796, 1822, 29572, 13, 28100, 1713, 46677, 3419, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 12, 67, 1600, 366, 438, 34945, 1600, 2099, 28, 2536, 11, 4277, 2625, 22065, 12, 85, 5126, 12, 12708, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 34945, 286, 262, 9037, 2491, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 12, 69, 1600, 366, 438, 7753, 1600, 2099, 28, 2536, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 1169, 2124, 45579, 2393, 1438, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 5143, 8738, 1600, 2099, 28, 2536, 11, 4277, 2625, 5235, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 5235, 11, 1057, 11, 393, 2429, 5143, 4943, 201, 198, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 23736, 1600, 2099, 28, 600, 11, 4277, 28, 18, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 23736, 25, 15, 2147, 11, 352, 25, 23345, 3696, 284, 4382, 11, 362, 25, 23345, 290, 23710, 287, 6569, 4382, 11, 513, 25, 279, 4948, 265, 11125, 973, 287, 4382, 351, 1277, 9199, 11, 287, 1502, 779, 8295, 28, 16, 11, 362, 11, 345, 1276, 787, 1654, 612, 318, 257, 1762, 39763, 79, 4948, 265, 11125, 14, 15388, 62, 58, 79, 1443, 91, 88, 71, 4083, 10414, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 14171, 1600, 2099, 28, 600, 11, 4277, 28, 15, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7747, 41888, 15, 11, 352, 4357, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 5143, 4235, 329, 47764, 457, 13, 657, 25, 4508, 649, 351, 257, 649, 8619, 26, 352, 25, 2555, 287, 262, 4683, 8619, 4943, 201, 198, 201, 198, 220, 220, 220, 1303, 20368, 22369, 201, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19387, 1503, 29463, 2390, 2767, 4877, 201, 198, 220, 220, 220, 1303, 20368, 22369, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 3866, 66, 1600, 2099, 28, 2536, 11, 4277, 2625, 26447, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7747, 28, 14692, 26447, 1600, 366, 17320, 15537, 1600, 366, 32, 1600, 366, 45, 33116, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 47, 38827, 11, 4277, 1988, 25, 14435, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 268, 8968, 1600, 2099, 28, 600, 11, 4277, 28, 6200, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 24181, 3843, 11, 4277, 1988, 25, 5867, 304, 53, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 276, 733, 1600, 2099, 28, 22468, 11, 4277, 28, 16, 13, 15, 68, 12, 19, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 1961, 29267, 11, 4277, 1988, 25, 352, 13, 15, 68, 12, 19, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 74, 13033, 12, 3149, 1600, 2099, 28, 600, 11, 299, 22046, 2625, 10, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 41888, 16, 11, 352, 11, 352, 11, 657, 11, 657, 11, 657, 4357, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 2617, 479, 13033, 588, 532, 74, 352, 352, 352, 657, 657, 657, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 1042, 451, 1600, 2099, 28, 600, 11, 4277, 28, 15, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 5796, 6648, 2099, 7, 76, 2788, 69, 7878, 12, 8957, 22874, 7, 29, 15, 828, 31986, 31562, 7, 15, 828, 277, 7780, 72, 12, 15908, 330, 32590, 16, 828, 28408, 430, 32590, 19, 828, 28408, 430, 12, 2436, 5374, 12, 40180, 2554, 276, 32590, 20, 36911, 4277, 25, 657, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 82, 13495, 1600, 2099, 28, 22468, 11, 4277, 28, 15, 13, 486, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 67, 13221, 274, 262, 9647, 286, 262, 895, 6648, 287, 304, 53, 19570, 201, 198, 201, 198, 220, 220, 220, 1303, 16529, 12, 201, 198, 201, 198, 201, 198, 220, 220, 220, 1303, 41436, 438, 201, 198, 220, 220, 220, 1303, 6608, 5772, 316, 274, 201, 198, 220, 220, 220, 1303, 41436, 12, 201, 198, 220, 220, 220, 1303, 48610, 13, 2860, 62, 49140, 7203, 438, 4685, 2545, 1600, 1037, 2625, 1600, 2099, 28, 600, 11, 4277, 28, 14202, 8, 201, 198, 220, 220, 220, 1303, 48610, 13, 2860, 62, 49140, 7203, 438, 75, 8738, 873, 1600, 1037, 2625, 1600, 2099, 28, 2536, 11, 4277, 2625, 37, 23719, 4943, 201, 198, 201, 198, 201, 198, 201, 198, 220, 220, 220, 1303, 16529, 12, 201, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1057, 42287, 201, 198, 220, 220, 220, 1303, 16529, 12, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 3149, 72, 1600, 2099, 28, 2536, 11, 4277, 2625, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 7378, 40, 3141, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 15388, 1600, 2099, 28, 2536, 11, 4277, 2625, 79, 1443, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7747, 28, 14692, 79, 1443, 1600, 366, 88, 71, 1600, 366, 7278, 69, 62, 82, 89, 33116, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 4906, 286, 6569, 4382, 11, 460, 307, 279, 1443, 393, 331, 71, 393, 300, 28202, 62, 82, 89, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 21858, 3672, 1600, 2099, 28, 2536, 11, 4277, 2625, 85, 5126, 12, 7568, 457, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 21858, 3672, 319, 262, 279, 1443, 4382, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 77, 4147, 1600, 2099, 28, 600, 11, 4277, 28, 16, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 45, 4147, 973, 287, 4382, 4943, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 381, 77, 1600, 2099, 28, 600, 11, 4277, 28, 2624, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 381, 77, 286, 262, 4382, 4943, 201, 198, 201, 198, 201, 198, 220, 220, 220, 1303, 46111, 4770, 2559, 28, 201, 198, 220, 220, 220, 1303, 4351, 10007, 422, 262, 1822, 30751, 284, 9037, 62, 5143, 4634, 201, 198, 220, 220, 220, 1303, 46111, 4770, 2559, 28, 201, 198, 220, 220, 220, 26498, 796, 30751, 13, 29572, 62, 22046, 3419, 201, 198, 201, 198, 220, 220, 220, 42287, 14692, 47, 38827, 8973, 796, 26498, 13, 3866, 66, 201, 198, 220, 220, 220, 42287, 14692, 24181, 3843, 8973, 796, 26498, 13, 268, 8968, 201, 198, 220, 220, 220, 42287, 14692, 1961, 29267, 8973, 796, 26498, 13, 276, 733, 201, 198, 220, 220, 220, 42287, 14692, 1797, 11682, 1503, 8973, 796, 26498, 13, 1042, 451, 201, 198, 220, 220, 220, 42287, 14692, 50, 3528, 5673, 8973, 796, 26498, 13, 82, 13495, 201, 198, 201, 198, 220, 220, 220, 4876, 796, 47764, 457, 62, 5143, 3419, 201, 198, 220, 220, 220, 4876, 13, 1136, 62, 5431, 89, 7, 22046, 13, 7753, 8, 201, 198, 220, 220, 220, 4876, 13, 2617, 62, 37266, 7, 37266, 28, 37266, 8, 201, 198, 220, 220, 220, 4876, 13, 2617, 62, 74, 13033, 7, 74, 13033, 62, 3149, 28, 22046, 13, 74, 13033, 62, 3149, 8, 201, 198, 220, 220, 220, 4876, 13, 2617, 62, 5143, 7, 3149, 72, 28, 22046, 13, 3149, 72, 11, 4382, 28, 22046, 13, 15388, 11, 1693, 3672, 28, 22046, 13, 21858, 3672, 11, 13760, 28, 22046, 13, 77, 4147, 11, 9788, 77, 28, 22046, 13, 381, 77, 8, 201, 198, 220, 220, 220, 4876, 13, 7568, 457, 7, 34945, 28, 22046, 13, 34945, 11, 1057, 8738, 28, 22046, 13, 5143, 8738, 11, 8295, 28, 22046, 13, 23736, 11, 4235, 28, 22046, 13, 14171, 8, 201, 198 ]
2.461252
1,613
from python5_unixSocket import interComs myInterComs = interComs() myInterComs.run() import sys from time import sleep while True: print("MESSAGES FROM PYTHON 5") sys.stdout.flush() myInterComs.send( {"wordDawg": "from python5"} ) sleep(0.500)
[ 6738, 21015, 20, 62, 403, 844, 39105, 1330, 987, 34, 3150, 198, 1820, 9492, 34, 3150, 796, 987, 34, 3150, 3419, 198, 1820, 9492, 34, 3150, 13, 5143, 3419, 198, 11748, 25064, 198, 6738, 640, 1330, 3993, 198, 198, 4514, 6407, 25, 198, 220, 220, 220, 3601, 7203, 44, 1546, 4090, 48075, 16034, 350, 56, 4221, 1340, 642, 4943, 198, 220, 220, 220, 25064, 13, 19282, 448, 13, 25925, 3419, 198, 220, 220, 220, 616, 9492, 34, 3150, 13, 21280, 7, 19779, 4775, 35, 707, 70, 1298, 366, 6738, 21015, 20, 20662, 1267, 198, 220, 220, 220, 3993, 7, 15, 13, 4059, 8 ]
2.524272
103
# -*- coding: utf-8 -*- """ Define extensions to be used with this Revit model. Defined extensions can be installed by using the "Install Extensions" button. """ import revitron import System.Windows from pyrevit import script from rpw.ui.forms import FlexForm, TextBox, Button, Label if not revitron.Document().isFamily(): config = revitron.DocumentConfigStorage().get('rpm.extensions') components = [ Label('You can define a list of pyRevit extensions to be used with the currently active model.\n' 'That list will be stored in the project information and therefore can be easily distributed\n' 'among other team members to easly create a common work environment.\n' 'To install or switch to the extension saved with your project just hit the "Install Extensions" button.\n\n' 'Enter one extension per line providing the type of the extension ("ui" or "lib")\n' 'and the repository URL separated by a TAB as follows:', FontSize=14, Height=140, Width=650), Label('ui https://ui-extension-repository.git\r\nlib https://lib-extension-repository.git', FontFamily=System.Windows.Media.FontFamily('Consolas'), FontSize=14, Height=50, Width=650), TextBox('extensions', Text=config, TextWrapping=System.Windows.TextWrapping.Wrap, AcceptsTab=True, AcceptsReturn=True, Multiline=True, Height=200, Width=650, FontFamily=System.Windows.Media.FontFamily('Consolas'), FontSize=14), Button('Open Documentation', on_click=openHelp, Width=650), Button('Save', Width=650) ] form = FlexForm('Project Extensions', components) form.show() if 'extensions' in form.values: revitron.DocumentConfigStorage().set('rpm.extensions', form.values.get('extensions'))
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 7469, 500, 18366, 284, 307, 973, 351, 428, 5416, 270, 2746, 13, 2896, 1389, 18366, 460, 307, 6589, 416, 1262, 262, 366, 15798, 49751, 1, 4936, 13, 220, 198, 37811, 198, 11748, 2710, 270, 1313, 198, 11748, 4482, 13, 11209, 198, 6738, 12972, 18218, 270, 1330, 4226, 198, 6738, 374, 79, 86, 13, 9019, 13, 23914, 1330, 26719, 8479, 11, 8255, 14253, 11, 20969, 11, 36052, 198, 198, 361, 407, 2710, 270, 1313, 13, 24941, 22446, 271, 24094, 33529, 628, 197, 11250, 796, 2710, 270, 1313, 13, 24941, 16934, 31425, 22446, 1136, 10786, 48235, 13, 2302, 5736, 11537, 198, 197, 198, 197, 5589, 3906, 796, 685, 198, 197, 197, 197, 33986, 10786, 1639, 460, 8160, 257, 1351, 286, 12972, 18009, 270, 18366, 284, 307, 973, 351, 262, 3058, 4075, 2746, 13, 59, 77, 6, 198, 197, 197, 197, 197, 220, 705, 2504, 1351, 481, 307, 8574, 287, 262, 1628, 1321, 290, 4361, 460, 307, 3538, 9387, 59, 77, 6, 198, 197, 197, 197, 197, 220, 705, 35131, 584, 1074, 1866, 284, 1396, 306, 2251, 257, 2219, 670, 2858, 13, 59, 77, 6, 198, 197, 197, 197, 197, 220, 705, 2514, 2721, 393, 5078, 284, 262, 7552, 7448, 351, 534, 1628, 655, 2277, 262, 366, 15798, 49751, 1, 4936, 13, 59, 77, 59, 77, 6, 198, 197, 197, 197, 197, 220, 705, 17469, 530, 7552, 583, 1627, 4955, 262, 2099, 286, 262, 7552, 5855, 9019, 1, 393, 366, 8019, 4943, 59, 77, 6, 198, 197, 197, 197, 197, 220, 705, 392, 262, 16099, 10289, 11266, 416, 257, 309, 6242, 355, 5679, 25, 3256, 220, 198, 197, 197, 197, 197, 220, 24060, 10699, 28, 1415, 11, 198, 197, 197, 197, 197, 220, 27280, 28, 15187, 11, 198, 197, 197, 197, 197, 220, 38807, 28, 17544, 828, 198, 197, 197, 197, 33986, 10786, 9019, 197, 5450, 1378, 9019, 12, 2302, 3004, 12, 260, 1930, 37765, 13, 18300, 59, 81, 59, 77, 8019, 197, 5450, 1378, 8019, 12, 2302, 3004, 12, 260, 1930, 37765, 13, 18300, 3256, 220, 198, 197, 197, 197, 197, 220, 24060, 24094, 28, 11964, 13, 11209, 13, 13152, 13, 23252, 24094, 10786, 9444, 12456, 33809, 220, 198, 197, 197, 197, 197, 220, 24060, 10699, 28, 1415, 11, 198, 197, 197, 197, 197, 220, 27280, 28, 1120, 11, 220, 198, 197, 197, 197, 197, 220, 38807, 28, 17544, 828, 198, 197, 197, 197, 8206, 14253, 10786, 2302, 5736, 3256, 220, 198, 197, 197, 197, 197, 197, 8206, 28, 11250, 11, 220, 198, 197, 197, 197, 197, 197, 8206, 36918, 2105, 28, 11964, 13, 11209, 13, 8206, 36918, 2105, 13, 54, 2416, 11, 220, 198, 197, 197, 197, 197, 197, 38855, 82, 33349, 28, 17821, 11, 220, 198, 197, 197, 197, 197, 197, 38855, 82, 13615, 28, 17821, 11, 220, 198, 197, 197, 197, 197, 197, 15205, 346, 500, 28, 17821, 11, 220, 198, 197, 197, 197, 197, 197, 23106, 28, 2167, 11, 220, 198, 197, 197, 197, 197, 197, 30916, 28, 17544, 11, 220, 198, 197, 197, 197, 197, 197, 23252, 24094, 28, 11964, 13, 11209, 13, 13152, 13, 23252, 24094, 10786, 9444, 12456, 33809, 220, 198, 197, 197, 197, 197, 197, 38160, 28, 1415, 828, 198, 197, 197, 197, 21864, 10786, 11505, 43925, 3256, 319, 62, 12976, 28, 9654, 22087, 11, 38807, 28, 17544, 828, 198, 197, 197, 197, 21864, 10786, 16928, 3256, 38807, 28, 17544, 8, 198, 197, 60, 198, 197, 198, 197, 687, 796, 26719, 8479, 10786, 16775, 49751, 3256, 6805, 8, 198, 197, 687, 13, 12860, 3419, 198, 197, 197, 198, 197, 361, 705, 2302, 5736, 6, 287, 1296, 13, 27160, 25, 198, 197, 197, 18218, 270, 1313, 13, 24941, 16934, 31425, 22446, 2617, 10786, 48235, 13, 2302, 5736, 3256, 1296, 13, 27160, 13, 1136, 10786, 2302, 5736, 6, 4008, 198, 197, 197 ]
2.808411
642
#!/usr/bin/env python import logging import numpy as np import librosa import scipy from random import randint from src.utils.math_utils import nextpow2 logger = logging.getLogger(__name__)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 18931, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 9195, 4951, 64, 198, 11748, 629, 541, 88, 198, 6738, 4738, 1330, 43720, 600, 198, 6738, 12351, 13, 26791, 13, 11018, 62, 26791, 1330, 1306, 79, 322, 17, 628, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628 ]
3.063492
63
import numpy as np import pickle @np.vectorize
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2298, 293, 628, 198, 31, 37659, 13, 31364, 1096, 628 ]
2.941176
17
# Generated by Django 2.1.2 on 2018-10-25 09:36 import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone import uuid
[ 2, 2980, 515, 416, 37770, 362, 13, 16, 13, 17, 319, 2864, 12, 940, 12, 1495, 7769, 25, 2623, 198, 198, 11748, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 198, 11748, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 12102, 2024, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 42625, 14208, 13, 26791, 13, 2435, 11340, 198, 11748, 334, 27112, 628 ]
3
68
import pandas as pd # Crear diccionario donde key sera columna a crear # y su valuela informacion de cada columna data = {'paises': ['Mexico', 'España', 'Estados Unidos'], 'Ciudades': ['Monterrey,' 'Madrid', 'Nueva York'], 'Casos': [4291, 3829, 10283]} # Crear un DataFrame pasando el diccioario y # señalizar las columnas creadas df = pd.DataFrame(data, columns=['paises', 'Ciudades', 'Casos']) # Imprimir la info print(df) # Almacenar en archivo CSV df.to_csv('myDataFrame.csv')
[ 11748, 19798, 292, 355, 279, 67, 220, 198, 198, 2, 5844, 283, 288, 44240, 295, 4982, 288, 14378, 1994, 1055, 64, 951, 388, 2616, 257, 1126, 283, 220, 198, 2, 331, 424, 1188, 2731, 64, 4175, 49443, 390, 269, 4763, 951, 388, 2616, 220, 198, 198, 7890, 796, 1391, 6, 8957, 2696, 10354, 37250, 33006, 3256, 705, 36, 2777, 64, 30644, 3256, 705, 22362, 22484, 791, 312, 418, 6, 4357, 198, 197, 197, 6, 34, 72, 463, 2367, 10354, 37250, 9069, 353, 4364, 4032, 705, 18454, 6058, 3256, 705, 45, 518, 6862, 1971, 6, 4357, 198, 197, 197, 6, 35155, 418, 10354, 685, 11785, 16, 11, 4353, 1959, 11, 838, 30290, 48999, 198, 198, 2, 5844, 283, 555, 6060, 19778, 38836, 25440, 1288, 288, 44240, 952, 4982, 331, 198, 2, 384, 12654, 282, 528, 283, 39990, 5721, 292, 269, 961, 292, 220, 198, 7568, 796, 279, 67, 13, 6601, 19778, 7, 7890, 11, 15180, 28, 17816, 8957, 2696, 3256, 705, 34, 72, 463, 2367, 3256, 705, 35155, 418, 6, 12962, 198, 198, 2, 1846, 1050, 13057, 8591, 7508, 198, 4798, 7, 7568, 8, 198, 198, 2, 978, 20285, 268, 283, 551, 3934, 23593, 44189, 220, 198, 7568, 13, 1462, 62, 40664, 10786, 1820, 6601, 19778, 13, 40664, 11537 ]
2.375
208
#!/pxrpythonsubst # # Copyright 2017 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # # 6. Trademarks. This License does not grant permission to use the trade # names, trademarks, service marks, or product names of the Licensor # and its affiliates, except as required to comply with Section 4(c) of # the License and to reproduce the content of the NOTICE file. # # You may obtain a copy of the Apache License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Apache License with the above modification is # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the Apache License for the specific # language governing permissions and limitations under the Apache License. from __future__ import print_function from pxr import Gf, Sdf, Sdr, Tf, Usd, UsdGeom, UsdLux, UsdShade, Plug import unittest, math if __name__ == '__main__': unittest.main()
[ 2, 48443, 8416, 81, 79, 5272, 684, 549, 301, 198, 2, 198, 2, 15069, 2177, 46706, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 25189, 4891, 13789, 4943, 198, 2, 351, 262, 1708, 17613, 26, 345, 743, 407, 779, 428, 2393, 2845, 287, 198, 2, 11846, 351, 262, 24843, 13789, 290, 262, 1708, 17613, 284, 340, 25, 198, 2, 7275, 718, 13, 8397, 368, 5558, 13, 318, 13140, 290, 6928, 351, 25, 198, 2, 198, 2, 718, 13, 8397, 368, 5558, 13, 770, 13789, 857, 407, 7264, 7170, 284, 779, 262, 3292, 198, 2, 220, 220, 220, 3891, 11, 27346, 11, 2139, 8849, 11, 393, 1720, 3891, 286, 262, 10483, 22854, 198, 2, 220, 220, 220, 290, 663, 29116, 11, 2845, 355, 2672, 284, 11997, 351, 7275, 604, 7, 66, 8, 286, 198, 2, 220, 220, 220, 262, 13789, 290, 284, 22919, 262, 2695, 286, 262, 28536, 2393, 13, 198, 2, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 24843, 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, 24843, 13789, 351, 262, 2029, 17613, 318, 198, 2, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 198, 2, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 4091, 262, 24843, 13789, 329, 262, 2176, 198, 2, 3303, 15030, 21627, 290, 11247, 739, 262, 24843, 13789, 13, 198, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 6738, 279, 87, 81, 1330, 402, 69, 11, 311, 7568, 11, 311, 7109, 11, 309, 69, 11, 4021, 67, 11, 4021, 67, 10082, 296, 11, 4021, 45582, 2821, 11, 4021, 67, 2484, 671, 11, 22689, 198, 11748, 555, 715, 395, 11, 10688, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
3.560907
353
#!/usr/bin/env python3 # This script fixes some problems the RTTM file # including invalid time boundaries and others import os import sys import numpy as np import argparse if __name__ == "__main__": main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 770, 4226, 13040, 617, 2761, 262, 11923, 15972, 2393, 198, 2, 1390, 12515, 640, 13215, 290, 1854, 198, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 1822, 29572, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ]
3.34375
64
import math r = Rect(2, 5) c = Circle(3) shapes: list[Shape] = [ r, c, ] [print_area(s) for s in shapes] print(isinstance(r, Rect)) print(isinstance(r, Circle)) print(isinstance(r, Shape)) # print_area(2) print(Rect.mro()) Person().say_hello()
[ 11748, 10688, 628, 628, 628, 198, 81, 796, 48599, 7, 17, 11, 642, 8, 198, 66, 796, 16291, 7, 18, 8, 198, 1477, 7916, 25, 1351, 58, 33383, 60, 796, 685, 198, 220, 220, 220, 374, 11, 198, 220, 220, 220, 269, 11, 198, 60, 198, 198, 58, 4798, 62, 20337, 7, 82, 8, 329, 264, 287, 15268, 60, 198, 198, 4798, 7, 271, 39098, 7, 81, 11, 48599, 4008, 198, 4798, 7, 271, 39098, 7, 81, 11, 16291, 4008, 198, 4798, 7, 271, 39098, 7, 81, 11, 25959, 4008, 198, 2, 3601, 62, 20337, 7, 17, 8, 198, 4798, 7, 45474, 13, 76, 305, 28955, 628, 198, 198, 15439, 22446, 16706, 62, 31373, 3419, 198 ]
2.267241
116