blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
281
content_id
stringlengths
40
40
detected_licenses
listlengths
0
57
license_type
stringclasses
2 values
repo_name
stringlengths
6
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
313 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
18.2k
668M
star_events_count
int64
0
102k
fork_events_count
int64
0
38.2k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
107 values
src_encoding
stringclasses
20 values
language
stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
4
6.02M
extension
stringclasses
78 values
content
stringlengths
2
6.02M
authors
listlengths
1
1
author
stringlengths
0
175
25454d11e4902e3ee96778aa068c6150e7eb95d9
ee10de6ce6a56c3ba8670144490c61ff7ecaface
/json_to_csv.py
c6eb6a65a8864162d2eab96fb9ce3dbe9dcc350a
[]
no_license
thegsi/appstore-api
91bdc2f8cdf32703981dc8a34c6679e11e3a2adb
4c1e3a92d67a741a9f481f31d4303e45a0dab483
refs/heads/master
2020-03-19T20:52:33.445477
2018-09-27T10:53:04
2018-09-27T10:53:04
136,920,345
0
0
null
null
null
null
UTF-8
Python
false
false
530
py
import pandas as pd from pandas import DataFrame import json with open('appstore_books150.json') as f: appContent = json.load(f) keys = appContent['results'][0].keys() print(keys) df = pd.DataFrame(columns=keys) for i in range(len(appContent['results'])): for k in keys: if k in appContent['results'][i]: appContent['results'][i][k] = str(appContent['results'][i][k]) df = df.append(appContent['results'][i], ignore_index=True) df.to_csv('appstore_books150.csv', sep=',', encoding='utf-8')
[ "dr.gethin.rees@gmail.com" ]
dr.gethin.rees@gmail.com
a75789c16f0297f9a5da3ef0759607a3352284a8
161f0edac3720b488b3ba6e7f21083409bb841bc
/problem093.py
ed25ce7a8f68c6600c319b335ab97256bebb9124
[]
no_license
chadheyne/project-euler
cd28589c12a092faf2c3f6f52df16b30bba2bf2d
20155d0987754685a89d11b45a58580f7d1528de
refs/heads/master
2021-01-09T20:14:00.659905
2013-11-10T06:41:59
2013-11-10T06:41:59
61,950,422
0
0
null
null
null
null
UTF-8
Python
false
false
1,514
py
#!/usr/bin/env python from itertools import ( combinations, permutations, chain, product) def partitions(iterable): n, s = len(iterable), iterable first, middle, last = [0], range(1, n), [n] return ['{}'.join(map(lambda i, j: '(' + '{}'.join(s[i:j]) + ')', chain(first, div), chain(div, last))) for i in range(n) for div in combinations(middle, i)] OPERATIONS = [(op1, op2, op3) for op1, op2, op3 in product(('+', '-', '/', '*'), repeat=3)] def compute(numbers): for operation in OPERATIONS: try: yield eval(numbers.format(*operation)) except ZeroDivisionError: yield 0 def compute_permuted(number_string): for perm in permutations(number_string): for partition in partitions(perm): yield from compute(partition) def compute_combined(digits='0123456789'): numbers = {} for combo in combinations(digits, 4): number = ''.join(combo) numbers[number] = set() for result in compute_permuted(number): if result < 0: continue if isinstance(result, int) or result.is_integer(): numbers[number].add(int(result)) for number, results in numbers.items(): first_missing = min([i for i in results if i+1 not in results]) numbers[number] = first_missing return numbers def main(): results = compute_combined() print(max(results, key=results.get)) if __name__ == "__main__": main()
[ "chadheyne@gmail.com" ]
chadheyne@gmail.com
a72ddaff756e17ca53489a0964db37665a6783d2
ded7716aaf8b0d118759bbb0f8f68e21ad1b2bf0
/tasks.py
68c4ed354fc47a747264b87ed2187e8492c70259
[]
no_license
wmeaney/national-oceanographic-data-centre
1617f0f398b9dfb8c2cf3b255da18678aa6258e7
83d9bd1627aa4f67217186019f9b4f686e4b7e88
refs/heads/master
2020-07-30T17:11:35.737649
2019-09-09T15:58:15
2019-09-09T15:58:15
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,107
py
from invoke import task import os import xml.etree.ElementTree import flask app = flask.Flask('flaskInInvoke') def enum(): return {'baseUrl': 'https://irishmarineinstitute.github.io/national-oceanographic-data-centre/'} def getXmlNamespaces(): return {'gmd': 'http://www.isotc211.org/2005/gmd', 'gco': 'http://www.isotc211.org/2005/gco'} def getNewFileName(oldFileName,switch): e = xml.etree.ElementTree.parse(oldFileName).getroot() if switch == "dataset": for p in e.findall('./gmd:fileIdentifier/gco:CharacterString', getXmlNamespaces()): return str.replace(str.replace(p.text,'.','_'),':','__') @task def rename(c, dataset=False, sensor=False): if dataset: for f in (os.listdir("./iso-xml")): if(getNewFileName("./iso-xml/" + f,'dataset') == None): raise Exception('No metadata identifier found... File {}'. format(f)) else: os.rename("./iso-xml/" + f, "./iso-xml/" + getNewFileName("./iso-xml/" + f,'dataset') + ".xml") @task def applytransforms(c, dataset = False, sensor=False): if dataset: for f in (os.listdir("./iso-xml")): print("Applying transformation to HTML...") print("Applying transformation to RDF...") @task def buildsitemap(c): Enum = enum() urls = [] for f in (os.listdir("./html")): with open('./html/'+f, 'r') as content_file: content = content_file.read() content = content[content.find('div id="lastModified"'):] content = content[content.find('div class="blockValue"'):] content = content[content.find('>') + 1:] content = content[:content.find('<')] urls.append({'url': 'html/' + f, 'lastModified': content}) with app.app_context(): rendered = flask.render_template('sitemap.xml',Enum = Enum, urls=urls) with open('sitemap.xml', 'w+') as sitemap: sitemap.write(rendered)
[ "aleadbetter9@gmail.com" ]
aleadbetter9@gmail.com
2d81eefaf47a0eaeb84f24fa28661b2e22ca929b
d67b4d6907b31ac2d9c07b73305e25a20d3a827b
/repro_packs/ellis/repro_exec_files/scripts/cext_wave_iso_pillar_AR3.py
5e45796944c98b73f432fb3c66af6f6b4e675634
[ "BSD-3-Clause", "CC-BY-4.0", "CC-BY-3.0" ]
permissive
stjordanis/pygbe_validation_paper
13de7b06ebdb792146abdd8fb775d6e7361f4709
ef826a8e956a817f919c4357a08aa8f675a910a4
refs/heads/master
2023-03-19T05:13:51.961685
2021-03-03T15:38:39
2021-03-03T15:38:39
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,200
py
import numpy import time import sys import os from argparse import ArgumentParser import pygbe from pygbe.util.read_data import read_fields from pygbe.main import main from cext_wavelength_scanning import create_diel_list, Cext_wave_scan, Cext_analytical def read_inputs(args): """ Parse command-line arguments to read arguments in main. """ parser = ArgumentParser(description='Read path where input files are located') parser.add_argument('-if', '--infiles', type=str, help="Absolute path where input files are located (downloaded from zenodo)") return parser.parse_args(args) def main(argv=sys.argv): argv=sys.argv args = read_inputs(argv[1:]) in_files_path = args.infiles #Import surface data wave_s, diel_rs, diel_is = numpy.loadtxt('../dielectric_data/4H-SIC_Angs_permittivity_800-1000cm-1.csv', skiprows=1, unpack=True) air_diel = [1. + 1j*0.] * len(wave_s) #Creating dielectric list first dielectric outside, then inside diel_list = [list(eps) for eps in zip(air_diel, diel_rs + 1j*diel_is)] #Set enviornment variable for PyGBe folder_path = in_files_path + 'AR_3' full_path = os.path.abspath(folder_path)+'/' os.environ['PYGBE_PROBLEM_FOLDER'] = full_path #Creating dictionary field. We will modify the 'E' key in the for loop. field_dict_pillars = read_fields(full_path + 'iso_pillar.config') #Calculate Cext(lambda) for pillars' surface tic_ss = time.time() e_field = -1. wave, Cext_pillars = Cext_wave_scan(e_field, wave_s, diel_list, field_dict_pillars, full_path) toc_ss = time.time() numpy.savetxt('../results_data/iso_pillar_AR/'+'iso_pillar_AR_3'+'_800-1000cm-1_in_ang.txt', list(zip(wave, Cext_pillars)), fmt = '%.5f %.5f', header = 'lambda [Ang], Cext [nm^2]') time_simulation = (toc_ss - tic_ss) with open('../results_data/iso_pillar_AR/Time_'+'iso_pillar_AR_3'+'_800-1000cm-1.txt', 'w') as f: print('time_total: {} s'.format(time_simulation), file=f) if __name__ == "__main__": main(sys.argv)
[ "natyclementi@gmail.com" ]
natyclementi@gmail.com
bc125099241b8ffd9f1ccc9d93c01b6f7eaf5f23
a05550df7d8385ac8cfe2f1ac30aa438e706dd59
/src/eval/create_ranking_3models.py
18e28432ac756acbb80fa5497ee808f946b56465
[]
no_license
raosudha89/clarification_question_generation
9a537e4410d649519e662c8ddd1d776d5a891deb
f8ed75cc25622fc82c753e8f73e9c25d5e2df344
refs/heads/master
2020-03-08T10:34:33.771492
2018-06-27T18:27:54
2018-06-27T18:27:54
128,076,744
0
0
null
null
null
null
UTF-8
Python
false
false
4,741
py
import argparse import gzip import nltk import pdb import sys, os from collections import defaultdict import csv import random def parse(path): g = gzip.open(path, 'r') for l in g: yield eval(l) def read_ids(fname): return [line.strip('\n') for line in open(fname, 'r').readlines()] def read_model_outputs(model_fname, model_test_ids_fname): model_test_ids = read_ids(model_test_ids_fname) with open(model_fname, 'r') as model_file: model_outputs = [line.strip('\n') for line in model_file.readlines()] model_output_dict = defaultdict(list) for i, test_id in enumerate(model_test_ids): asin = test_id.split('_')[0] model_output_dict[asin].append(model_outputs[i]) return model_output_dict def get_subset(candidates): print len(candidates) new_candidates = [] for cand in candidates: if len(cand.split()) <= 50: new_candidates.append(cand) print len(new_candidates) if len(new_candidates) == 0: pdb.set_trace() return new_candidates def main(args): titles = {} descriptions = {} test_ids = read_ids(args.test_ids) lucene_model_outs = read_model_outputs(args.lucene_model, args.lucene_model_test_ids) context_model_outs = read_model_outputs(args.context_model, args.context_model_test_ids) candqs_model_outs = read_model_outputs(args.candqs_model, args.candqs_model_test_ids) candqs_template_model_outs = read_model_outputs(args.candqs_template_model, \ args.candqs_template_model_test_ids) for v in parse(args.metadata_fname): asin = v['asin'] if asin not in test_ids: continue if asin not in lucene_model_outs or \ asin not in context_model_outs or \ asin not in candqs_model_outs or \ asin not in candqs_template_model_outs: continue description = v['description'] length = len(description.split()) title = v['title'] if length >= 100 or length < 10 or len(title.split()) == length: continue titles[asin] = title descriptions[asin] = description if len(descriptions) >= 100: break print len(descriptions) questions = defaultdict(list) for v in parse(args.qa_data_fname): asin = v['asin'] if asin not in descriptions: continue questions[asin].append(v['question']) csv_file = open(args.csv_file, 'w') writer = csv.writer(csv_file, delimiter=',') writer.writerow(['asin', 'title', 'description', \ 'q1_model', 'q1', 'q2_model', 'q2', \ 'q3_model', 'q3', 'q4_model', 'q4', \ 'q5_model', 'q5']) all_rows = [] for asin in descriptions: title = titles[asin] description = descriptions[asin] #ques_candidates = [] #for ques in questions[asin]: # if len(ques.split()) > 30: # continue # ques_candidates.append(ques) gold_question = random.choice(questions[asin]) lucene_question = random.choice(lucene_model_outs[asin]) context_question = random.choice(context_model_outs[asin]) candqs_question = random.choice(candqs_model_outs[asin]) candqs_template_question = random.choice(candqs_template_model_outs[asin]) pairs = [('gold', gold_question), ('lucene', lucene_question), \ ('context', context_question), ('candqs', candqs_question), \ ('candqs_template', candqs_template_question)] random.shuffle(pairs) writer.writerow([asin, title, description, \ pairs[0][0], pairs[0][1], pairs[1][0], pairs[1][1], \ pairs[2][0], pairs[2][1], pairs[3][0], pairs[3][1], \ pairs[4][0], pairs[4][1]]) csv_file.close() if __name__ == "__main__": argparser = argparse.ArgumentParser(sys.argv[0]) argparser.add_argument("--qa_data_fname", type = str) argparser.add_argument("--metadata_fname", type = str) argparser.add_argument("--test_ids", type=str) argparser.add_argument("--csv_file", type=str) argparser.add_argument("--lucene_model", type=str) argparser.add_argument("--lucene_model_test_ids", type=str) argparser.add_argument("--context_model", type=str) argparser.add_argument("--context_model_test_ids", type=str) argparser.add_argument("--candqs_model", type=str) argparser.add_argument("--candqs_model_test_ids", type=str) argparser.add_argument("--candqs_template_model", type=str) argparser.add_argument("--candqs_template_model_test_ids", type=str) args = argparser.parse_args() print args print "" main(args)
[ "raosudha@umiacs.umd.edu" ]
raosudha@umiacs.umd.edu
34a3c2e383db34435bf9f7f6871b4759c697745c
30f15a184450d6e914ac16375e674cc2f993b9ce
/game/engine/scummvm/actions.py
753eacd9cdf63940e2303b46b603fc71086fe5a4
[]
no_license
Erick-Pardus/2013
9d0dd48e19400965476480a8e6826beb865bdb2e
80943b26dbb4474f6e99f81752a0d963af565234
refs/heads/master
2021-01-18T16:57:58.233209
2012-10-30T20:35:42
2012-10-30T20:35:42
6,467,098
2
0
null
null
null
null
UTF-8
Python
false
false
1,046
py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Licensed under the GNU General Public License, version 2. # See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt from pisi.actionsapi import autotools from pisi.actionsapi import pisitools from pisi.actionsapi import shelltools from pisi.actionsapi import get shelltools.export("HOME", get.workDIR()) def setup(): autotools.rawConfigure("--prefix=/usr \ --enable-verbose-build \ --backend=sdl \ --enable-alsa \ --enable-flac \ --enable-mad \ --with-nasm-prefix=/usr/bin/nasm \ --enable-vorbis \ --enable-zlib") def build(): autotools.make() def install(): autotools.rawInstall("DESTDIR=%s" % get.installDIR()) pisitools.dohtml("doc/he/*.html") pisitools.dodoc("AUTHORS", "COPYING", "COPYRIGHT", "NEWS", "README", "TODO", "doc/he/*.txt")
[ "yusuf.aydemir@istanbul.com" ]
yusuf.aydemir@istanbul.com
3ae3022f4d02fd4850ca632a44e0205b7d1fa653
c93080264201fe6d0c84a79ae435022981d8ccf6
/panoptic/panoptic/doctype/frt_link/frt_link.py
67e8a4394dda3a574c7eb1b126c1d9f854e6c6c7
[ "MIT" ]
permissive
wisharya/panoptic
100e733e9aad33d087851fc4ea9bd064e81954f2
7c9a0eeb6bd5d9032087ccb7c805a3e65a357ba8
refs/heads/master
2023-07-09T14:20:45.377441
2021-08-25T06:58:45
2021-08-25T06:58:45
null
0
0
null
null
null
null
UTF-8
Python
false
false
273
py
# -*- coding: utf-8 -*- # Copyright (c) 2020, Internet Freedom Foundation and contributors # For license information, please see license.txt from __future__ import unicode_literals # import frappe from frappe.model.document import Document class FRTLink(Document): pass
[ "scm.mymail@gmail.com" ]
scm.mymail@gmail.com
938be44e36a1a72ed095f30a41dfeae540855d1a
c9ecaf4c376f7a4617588f382ee70fb3b4142bf0
/weight/main_window.py
f3558dfdb195e521e543436566d94c614d53f91a
[]
no_license
Snowfly11531/api_get
d69a0629bc16d3dc3218163999e680ce18d9b9bb
9668c563fb19cf5fe8a27b9a0ea082a763fb6797
refs/heads/master
2020-09-22T18:42:35.260445
2019-12-10T14:31:21
2019-12-10T14:31:21
225,300,450
0
0
null
null
null
null
UTF-8
Python
false
false
901
py
import sys from PyQt5 import * from weight.main_window_ui import * from weight.parameter_frame import * class Main_Window(QtWidgets.QWidget,Ui_Form): def __init__(self): super(QtWidgets.QWidget,self).__init__() self.frameHeight=0 self.frameCount=0 self.setupUi(self) def addframe(self): test_frame = Parameter_Frame(self.scrollAreaWidgetContents) self.frameHeight = test_frame.geometry().height() top=self.frameHeight*self.frameCount test_frame.setGeometry(QtCore.QRect(0, top, test_frame.geometry().width(), test_frame.geometry().height())) self.scrollAreaWidgetContents.setMinimumHeight(top+self.frameHeight+10) test_frame.show() self.frameCount += 1 if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) main_window = Main_Window() main_window.show() sys.exit(app.exec_())
[ "245134041@qq.com" ]
245134041@qq.com
f4ef2defc06bdd2a35f26acedd9b7bac282e0460
4e54d2199f7c601f6efc58d88447eeeb3594a637
/riselive/python_courses/datatype.3.py
f917572804f2b27081ab90ec6371e9caf2148654
[ "MIT" ]
permissive
Z3Prover/doc
4e23e40cef32cf8102bd0dda7fb76d01051f9210
f79ba59ce06e855d783508d9b6f47a8947480d12
refs/heads/master
2023-09-05T19:45:26.160516
2023-08-01T17:01:16
2023-08-01T17:01:16
151,014,945
34
20
MIT
2023-06-30T03:29:19
2018-09-30T23:09:21
HTML
UTF-8
Python
false
false
393
py
Color = Datatype('Color') Color.declare('red') Color.declare('green') Color.declare('blue') Color = Color.create() print is_expr(Color.green) print Color.green == Color.blue print simplify(Color.green == Color.blue) # Let c be a constant of sort Color c = Const('c', Color) # Then, c must be red, green or blue prove(Or(c == Color.green, c == Color.blue, c == Color.red))
[ "nbjorner@microsoft.com" ]
nbjorner@microsoft.com
63d075ebba8d418a5abd61db3765aec5ea7064c8
57ae9f6e97851930616739893493c335d04f6520
/wings_sanic/utils.py
515a95b58ee2d700a6b29faf48909962acc1669c
[]
no_license
songtao-git/wings-sanic
25c9c5b4d75949b4872f1e32cb6d0368d877e2b2
f273759360021aafdcf83ae30786e98af1b5df3d
refs/heads/master
2021-06-11T23:27:45.604572
2021-03-29T08:11:58
2021-03-29T10:43:34
161,740,871
10
4
null
2021-03-29T10:43:35
2018-12-14T06:21:53
Python
UTF-8
Python
false
false
5,059
py
# -*- coding: utf-8 -*- import datetime import decimal import inspect import json import os from typing import Sequence, Mapping from wings_sanic import datetime_helper def instance_to_dict(instance): """ Convert instance to dict """ if not hasattr(instance, '__dict__'): return None data = {} for k, v in instance.__dict__.items(): if k.startswith('__'): continue if k.startswith('_'): continue if callable(v): continue data[k] = v return data def instance_from_json(data, cls=None): """ 如果cls有值, 则将data_string转化成对应的instance(s) 否则,转化成python内置类型 转化失败时: 如果cls是None, 则返回原字符串 否则,返回None :param data: json结构的字符串 :param cls: type of class :return: """ if isinstance(data, str): try: data = json.loads(data) except: pass data = to_native(data) if not cls: return data if isinstance(data, Mapping): try: return cls(**data) except: return None if isinstance(data, Sequence) and not isinstance(data, str): result = [] for i in data: item_result = instance_from_json(i) if item_result: result.append(item_result) return result or None return None def to_native(obj): """Convert obj to a richer Python construct. The obj can be anything """ if obj is None: return None if isinstance(obj, (int, float, bool, datetime.datetime, datetime.date, decimal.Decimal)): return obj elif isinstance(obj, str): value = datetime_helper.parse_datetime(obj) if not value: value = datetime_helper.parse_date(obj) return value or obj if hasattr(obj, 'to_native') and callable(obj.to_native) \ and len(inspect.signature(obj.to_native).parameters) == 1: return obj.to_native() if hasattr(obj, '__dict__'): obj = instance_to_dict(obj) if isinstance(obj, Sequence): return [to_native(item) for item in obj] if isinstance(obj, Mapping): return dict( (k, to_native(v)) for k, v in obj.items() ) return obj def to_primitive(obj): """Convert obj to a value safe to serialize. """ if obj is None: return None if hasattr(obj, 'to_primitive') and callable(obj.to_primitive) \ and len(inspect.signature(obj.to_primitive).parameters) == 1: return obj.to_primitive() data = to_native(obj) if isinstance(data, (int, float, bool, str)): return data if isinstance(data, datetime.datetime): return datetime_helper.get_time_str(obj) if isinstance(data, datetime.date): return datetime_helper.get_date_str(obj) if isinstance(data, Sequence): return [to_primitive(e) for e in data] elif isinstance(data, Mapping): return dict( (k, to_primitive(v)) for k, v in data.items() ) return str(data) def get_value(instance_or_dict, name, default=None): if isinstance(instance_or_dict, Mapping): return instance_or_dict.get(name, default) return getattr(instance_or_dict, name, default) def cls_str_of_meth(meth, separator='.'): if meth is None: return None mod = inspect.getmodule(meth) cls = meth.__qualname__.split('.<locals>', 1)[0].rsplit('.', 1)[0] return f'{mod.__name__}.{cls}'.replace('.', separator) def cls_str_of_obj(obj, separator='.'): if obj is None: return None return f'{obj.__class__.__module__}.{obj.__class__.__name__}'.replace('.', separator) def cls_str_of_cls(cls, separator='.'): if cls is None: return None return f'{cls.__module__}.{cls.__name__}'.replace('.', separator) def meth_str(meth, separator='.'): if meth is None: return None return f'{meth.__module__}.{meth.__qualname__}'.replace('.', separator) def import_from_str(obj_path): module_name, obj_name = obj_path.rsplit('.', 1) module_meta = __import__(module_name, globals(), locals(), [obj_name]) obj_meta = getattr(module_meta, obj_name) return obj_meta # Removes all null values from a dictionary def remove_nulls(dictionary, deep=True): return { k: remove_nulls(v, deep) if deep and type(v) is dict else v for k, v in dictionary.items() if v not in [None, dict(), list(), tuple(), set(), ''] } def __load(path): for item in os.listdir(path): item_path = '%s/%s' % (path, item) if item.endswith('.py'): __import__('{pkg}.{mdl}'.format(pkg=path.replace('/', '.'), mdl=item[:-3])) elif os.path.isdir(item_path): load_path(item_path) def load_path(*path): """加载某目录下所有的.py文件,可用于加载某目录下所有的event handlers时""" for p in path: __load(p)
[ "songtao@kicen.com" ]
songtao@kicen.com
5b5698735c4bd1e1ec8573b99abd07c76cd9c04b
b5c6599d206ff282e9aa7539024d320bbafc99d2
/dmtools/dmt_content/urls.py
1877a2d967859034ad9c567ec20c2cdb5b58f142
[]
no_license
BlitzKraft/DigitalMediaTools
e58c3a53fce5fb145d0e8f11e0780ec7e0b775bb
86b7fd90dcf80c6cde7263864feee5691f6736d6
refs/heads/master
2021-01-22T11:29:18.500685
2017-05-29T05:59:17
2017-05-29T05:59:17
92,703,898
1
0
null
2017-05-29T03:38:07
2017-05-29T03:38:07
null
UTF-8
Python
false
false
851
py
"""dmtools URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include from django.contrib import admin from django.conf import settings from django.conf.urls.static import static urlpatterns = [ #url(r'^admin/', admin.site.urls), ]
[ "andie.yancey@icloud.com" ]
andie.yancey@icloud.com
3d1563c262a258c965c363b560ee8504998737bb
f214053ac4ea47da1c1ed1757625834c4251d79d
/utils/Yaml_Factory.py
27d2e1473a4ffdfd5fa182f6d7266c9097c2222b
[]
no_license
gaozhao1989/mobile_uiautomation
fb031ccb6161c73b4aca92852891d4f0dc947ceb
554edcaeb0164d3ac3e7fb1c99933b58e46d4a2d
refs/heads/master
2020-12-03T00:09:25.556194
2017-07-02T00:59:42
2017-07-02T00:59:42
95,994,842
0
0
null
null
null
null
UTF-8
Python
false
false
1,508
py
import os, yaml current_path = os.getcwd() workspace_name = 'mobile_uiautomation' workspace_path = current_path[:current_path.index(workspace_name) + len(workspace_name)] def get_yaml_data(file_path): stream = open(file_path, 'r', encoding='utf-8') yaml_data = yaml.load(stream) stream.close() return yaml_data def get_android_caps(): android_caps = get_yaml_data(workspace_path + '\\config\\android.yaml')['capabilities'] app_rel_path = android_caps['app'] android_caps['app'] = get_app_rel_path(app_rel_path) return android_caps def get_ios_caps(): ios_caps = get_yaml_data(workspace_path + '\\config\\ios.yaml')['capabilities'] app_rel_path = ios_caps['app'] ios_caps['app'] = get_app_rel_path(app_rel_path) return ios_caps def get_appium_config(): return get_yaml_data(workspace_path + '\\config\\server.yaml')['appium'] def get_test_platform(): return get_yaml_data(workspace_path + '\\config\\server.yaml')['platform'] def get_page_locators(locator_file): return get_yaml_data(workspace_path + '\\pages\\locator\\' + locator_file + '.yaml') def get_locator_properties(locator_file, locator_name, test_platform): yaml_data = get_page_locators(locator_file) return yaml_data[locator_file]['elements'][locator_name][test_platform]['find_by'], \ yaml_data[locator_file]['elements'][locator_name][test_platform]['value'] def get_app_rel_path(app_name): return os.path.join(workspace_path, 'apps', app_name)
[ "zhaogao@ZhaodeMacBook-Pro.local" ]
zhaogao@ZhaodeMacBook-Pro.local
2cd19af823e90d2a4f99f3ee7ad155f837d1bb6c
f708a01bdfd1133883ec43dc9f7fc1dd8efd655c
/backend/home/migrations/0002_load_initial_data.py
cd9ce165d6eece5be8715f7fd500ce6e879c1ef5
[]
no_license
crowdbotics-apps/cws-v2-24857
d289f5011c0c122079399365b040ccde1731282c
2bd623d18e207ddf7f048ca117eaf3f864edae7e
refs/heads/master
2023-03-12T10:33:38.218689
2021-03-05T02:19:14
2021-03-05T02:19:14
344,669,015
0
0
null
null
null
null
UTF-8
Python
false
false
1,278
py
from django.db import migrations def create_customtext(apps, schema_editor): CustomText = apps.get_model("home", "CustomText") customtext_title = "CWS v2" CustomText.objects.create(title=customtext_title) def create_homepage(apps, schema_editor): HomePage = apps.get_model("home", "HomePage") homepage_body = """ <h1 class="display-4 text-center">CWS v2</h1> <p class="lead"> This is the sample application created and deployed from the Crowdbotics app. You can view list of packages selected for this application below. </p>""" HomePage.objects.create(body=homepage_body) def create_site(apps, schema_editor): Site = apps.get_model("sites", "Site") custom_domain = "cws-v2-24857.botics.co" site_params = { "name": "CWS v2", } if custom_domain: site_params["domain"] = custom_domain Site.objects.update_or_create(defaults=site_params, id=1) class Migration(migrations.Migration): dependencies = [ ("home", "0001_initial"), ("sites", "0002_alter_domain_unique"), ] operations = [ migrations.RunPython(create_customtext), migrations.RunPython(create_homepage), migrations.RunPython(create_site), ]
[ "team@crowdbotics.com" ]
team@crowdbotics.com
3298c87b6791939424088c9efb422d0f53e6f361
cb3d5a3cebfb1cc06f563bc36001d5f100cac97a
/fb/parser.py
18cb6d4cbc44d9b1eb4a10778b4ecf0c74e35fbc
[]
no_license
ax-sh/facebook-saved-saver
8f6f3a3795a7f631710c93ea17e49cea920ff0aa
34f453a9e9d7ecb26684b32093ed1d8652aa1817
refs/heads/master
2022-11-28T15:55:57.815165
2020-08-07T17:42:04
2020-08-07T17:42:04
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,822
py
import re from urllib import parse import json class ParseError(Exception): pass class TokensParseException(ParseError): pass def url(url): parsed = parse.urlparse(url) result = {'query_json': dict(parse.parse_qsl(parsed.query))} result.update(parsed._asdict()) return result def rx_json_var(key): return re.compile(fr'{key}[\'"]\s*:\s*[\'"]([^"\']+)') find_csrf_token = rx_json_var('(async_get_token|token)').findall photos_count = re.compile(r'(\d+) Photos?').findall def post_item_if_photos(text): count = photos_count(text) if count: return int(count[0]) return 0 def extract_csrf(text): raw = find_csrf_token(text) return dict(raw) def extract_csrf_from_html(html): for i in html.find('script'): text = i.text.strip() if 'DTSGInitData' in text: return extract_csrf(text) def parse_error(data): error = data.get('error', 'ERROR') errorSummary = data.get('errorSummary', '') errorDescription = data.get('errorDescription', '') text = f'[{errorSummary}-{error}]=>{errorDescription}'.upper() return text def parse_saved_json_response_html(data): domops = data.get('domops', {}) if not domops: error = parse_error(data) raise ParseError(error) try: html = domops[0][3]['__html'] except Exception: raise ParseError(domops) return html def remove_params(url, params=('fbclid', 'eid', 'ref')): url = parse_link(url) u = parse.urlparse(url) q = dict(parse.parse_qsl(u.query)) for i in params: q.pop(i, '') q = parse.urlencode(q) return u._replace(query=q).geturl() def parse_link(link): _url = url(link) if _url['netloc'] == 'l.facebook.com': link = _url['query_json']['u'] return link
[ "ahwn@pm.me" ]
ahwn@pm.me
a05fd4236ca57745dbcdd8597f5735fa61ad3ca4
863a6e23a71bbddccd73b0891cd5e4f85a51c29f
/cesar_env/bin/python-config
1d6b23686401646f119adabbe21ba6e285a47602
[]
no_license
neonua/ceaser
e3b2d6e2f484b5b05a3aaa62e97151e9ed663194
0ad25bdb1ad16abeee7a54591b9d22162cb5a4e5
refs/heads/master
2021-01-11T23:16:17.670349
2017-01-11T08:50:11
2017-01-11T08:50:11
78,562,060
0
0
null
null
null
null
UTF-8
Python
false
false
2,347
#!/Users/igor/new_prj/cesar_env/bin/python import sys import getopt import sysconfig valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags', 'ldflags', 'help'] if sys.version_info >= (3, 2): valid_opts.insert(-1, 'extension-suffix') valid_opts.append('abiflags') if sys.version_info >= (3, 3): valid_opts.append('configdir') def exit_with_usage(code=1): sys.stderr.write("Usage: {0} [{1}]\n".format( sys.argv[0], '|'.join('--'+opt for opt in valid_opts))) sys.exit(code) try: opts, args = getopt.getopt(sys.argv[1:], '', valid_opts) except getopt.error: exit_with_usage() if not opts: exit_with_usage() pyver = sysconfig.get_config_var('VERSION') getvar = sysconfig.get_config_var opt_flags = [flag for (flag, val) in opts] if '--help' in opt_flags: exit_with_usage(code=0) for opt in opt_flags: if opt == '--prefix': print(sysconfig.get_config_var('prefix')) elif opt == '--exec-prefix': print(sysconfig.get_config_var('exec_prefix')) elif opt in ('--includes', '--cflags'): flags = ['-I' + sysconfig.get_path('include'), '-I' + sysconfig.get_path('platinclude')] if opt == '--cflags': flags.extend(getvar('CFLAGS').split()) print(' '.join(flags)) elif opt in ('--libs', '--ldflags'): abiflags = getattr(sys, 'abiflags', '') libs = ['-lpython' + pyver + abiflags] libs += getvar('LIBS').split() libs += getvar('SYSLIBS').split() # add the prefix/lib/pythonX.Y/config dir, but only if there is no # shared library in prefix/lib/. if opt == '--ldflags': if not getvar('Py_ENABLE_SHARED'): libs.insert(0, '-L' + getvar('LIBPL')) if not getvar('PYTHONFRAMEWORK'): libs.extend(getvar('LINKFORSHARED').split()) print(' '.join(libs)) elif opt == '--extension-suffix': ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') if ext_suffix is None: ext_suffix = sysconfig.get_config_var('SO') print(ext_suffix) elif opt == '--abiflags': if not getattr(sys, 'abiflags', None): exit_with_usage() print(sys.abiflags) elif opt == '--configdir': print(sysconfig.get_config_var('LIBPL'))
[ "neonua666@gmail.com" ]
neonua666@gmail.com
31f19286a7a027e1aa34217ed97ef9790a1d3f06
2d9762e34f80c169daa9b2f724cab3a83f90d5fb
/dao/Topic_QuestionDao.py
bdcebed9dc8ce957e79e35ad2cb25288412c17ba
[]
no_license
skomefen/ZhihuSpider
11ae293a294e4d2f18c4d58e602ffa087f96c3c5
735a32bcdee784a3c303befae35e23e7ed5aab25
refs/heads/master
2021-08-24T09:38:32.422571
2017-12-09T02:48:11
2017-12-09T02:48:11
108,355,021
2
0
null
null
null
null
UTF-8
Python
false
false
1,659
py
import logging from dao.ConnManager import ConnManager class Topic_QuestionDao: def __init__(self): logger = logging.getLogger(__name__) conn = ConnManager().get_conn() # 表不存在就创建表 tableIsOK = False try: if not tableIsOK: sql = 'create table topic_question (topic_id text not null,question_id text not null,primary key (topic_id,question_id))' c = conn.cursor() c.execute(sql) tableIsOK = True except Exception as e: logger.debug("topic_question表已存在") #print('表已存在') finally: ConnManager().conn_commit() def save_topic_question(self, topic_question): logger = logging.getLogger(__name__) conn = ConnManager().get_conn() c = conn.cursor() try: sql = 'select * from topic_question where topic_id = ? and question_id = ?' u = (topic_question['topic_id'], topic_question['question_id']) c.execute(sql, u) date = None for row in c: date = row if not date: sql = 'insert into topic_question (topic_id, question_id) values (?,?)' c.execute(sql, u) except Exception as e: logger.debug('保存失败,或者该数据已存在,错误:%s',e) #print('保存失败,或者该数据已存在,错误:' + e) finally: # conn.commit() ConnManager().conn_commit()
[ "1072760797@qq.com" ]
1072760797@qq.com
6bfd98d0acb97cfadfc17f5ebe4ecf36c7af746b
4ea92cda40dce3acec7016aaf65488a5c5286b36
/src/crumblebundle/input/windows_keycodes.py
10e46ca9876170d11ccb4cd7fc2231a94097efaa
[ "MIT" ]
permissive
Peilonrayz/crumblebundle
694137315617201a9797a7bc1f249121981c2bd9
cffb3b0b16e9bc6497e9ba43f9c7cc3fd008c3ee
refs/heads/master
2021-01-09T13:34:25.026340
2020-02-21T20:09:50
2020-02-21T20:09:50
242,320,620
0
0
null
null
null
null
UTF-8
Python
false
false
15,565
py
# Table headers # [name, ext, ext-shift, ext-ctrl, ext-alt] # [name, dec, char, dec, char, dec char, dec char] _keycodes = [ ["ESC", 1, 27, None, 27, None, 27, None, 1, 0], ["1!", 2, 49, "1", 33, "!", None, None, 120, 0], ["2@", 3, 50, "2", 64, "@", 3, 0, 121, 0], ["3#", 4, 51, "3", 35, "#", None, None, 122, 0], ["4$", 5, 52, "4", 36, "$", None, None, 123, 0], ["5%", 6, 53, "5", 37, "%", None, None, 124, 0], ["6^", 7, 54, "6", 94, "^", 30, "\x1e", 125, 0], ["7&", 8, 55, "7", 38, "&", None, None, 126, 0], ["8*", 9, 56, "8", 42, "*", None, None, 127, 0], ["9(", 10, 57, "9", 40, "(", None, None, 128, 0], ["0)", 11, 48, "0", 41, ")", None, None, 129, 0], ["-_", 12, 45, "-", 95, "_", 31, "\x1f", 130, 0], ["=+", 13, 61, "=", 43, "+", None, None, 131, 0], ["BKSP", 14, 8, None, 8, None, 127, None, 14, 0], ["TAB", 15, 9, None, 15, 0, 148, 0, 15, 0], ["Q", 16, 113, "q", 81, "Q", 17, "\x11", 16, 0], ["W", 17, 119, "w", 87, "W", 23, "\x17", 17, 0], ["E", 18, 101, "e", 69, "E", 5, "\x05", 18, 0], ["R", 19, 114, "r", 82, "R", 18, "\x12", 19, 0], ["T", 20, 116, "t", 84, "T", 20, "SO", 20, 0], ["Y", 21, 121, "y", 89, "Y", 25, "\x19", 21, 0], ["U", 22, 117, "u", 85, "U", 21, "\x15", 22, 0], ["I", 23, 105, "i", 73, "I", 9, "\t", 23, 0], ["O", 24, 111, "o", 79, "O", 15, "\x0f", 24, 0], ["P", 25, 112, "p", 80, "P", 16, "\x10", 25, 0], ["[{", 26, 91, "[", 123, "{", 27, "\x1b", 26, 0], ["]}", 27, 93, "]", 125, "}", 29, "\x1d", 27, 0], ["ENTER", 28, 13, "\r", 13, "\r", 10, "\x0a", 28, 0], ["ENTER£", 28, 13, "\r", 13, "\r", 10, "\x0a", 166, 0], ["LCTRL", 29, None, None, None, None, None, None, None, None], ["RCTRL£", 29, None, None, None, None, None, None, None, None], ["A", 30, 97, "a", 65, "A", 1, "\x01", 30, 0], ["S", 31, 115, "s", 83, "S", 19, "\x13", 31, 0], ["D", 32, 100, "d", 68, "D", 4, "\x04", 32, 0], ["F", 33, 102, "f", 70, "F", 6, "\x06", 33, 0], ["G", 34, 103, "g", 71, "G", 7, "\a", 34, 0], ["H", 35, 104, "h", 72, "H", 8, "\b", 35, 0], ["J", 36, 106, "j", 74, "J", 10, "\x0a", 36, 0], ["K", 37, 107, "k", 75, "K", 11, "\v", 37, 0], ["L", 38, 108, "l", 76, "L", 12, "\f", 38, 0], [";:", 39, 59, ";", 58, ":", None, None, 39, 0], ["'\"", 40, 39, "'", 34, '"', None, None, 40, 0], ["`~", 41, 96, "`", 126, "~", None, None, 41, 0], ["L SHIFT", 42, None, None, None, None, None, None, None, None], ["\\|", 43, 92, "\\", 124, "|", 28, "\x1c", None, None], ["Z", 44, 122, "z", 90, "Z", 26, "\x1a", 44, 0], ["X", 45, 120, "x", 88, "X", 24, "\x18", 45, 0], ["C", 46, 99, "c", 67, "C", 3, "\x03", 46, 0], ["V", 47, 118, "v", 86, "V", 22, "\x16", 47, 0], ["B", 48, 98, "b", 66, "B", 2, "\x02", 48, 0], ["N", 49, 110, "n", 78, "N", 14, "\x0e", 49, 0], ["M", 50, 109, "m", 77, "M", 13, "\x0d", 50, 0], [",<", 51, 44, ",", 60, "<", None, None, 51, 0], [".>", 52, 46, ".", 62, ">", None, None, 52, 0], ["/?", 53, 47, "/", 63, "?", None, None, 53, 0], ["GRAY/£", 53, 47, "/", 63, "?", 149, 0, 164, 0], ["R SHIFT", 54, None, None, None, None, None, None, None, None], ["PRISC", 55, 42, "*", "PRISC", "✝✝", 16, None, None, None], ["L ALT", 56, None, None, None, None, None, None, None, None], ["R ALT£", 57, None, None, None, None, None, None, None, None], ["SPACE", 57, 32, " ", 32, " ", 32, " ", 32, " "], ["CAPS", 58, None, None, None, None, None, None, None, None], ["F1", 59, 59, 0, 84, 0, 94, 0, 104, 0], ["F2", 60, 60, 0, 85, 0, 95, 0, 105, 0], ["F3", 61, 61, 0, 86, 0, 96, 0, 106, 0], ["F4", 62, 62, 0, 87, 0, 97, 0, 107, 0], ["F5", 63, 63, 0, 88, 0, 98, 0, 108, 0], ["F6", 64, 64, 0, 89, 0, 99, 0, 109, 0], ["F7", 65, 65, 0, 90, 0, 100, 0, 110, 0], ["F8", 66, 66, 0, 91, 0, 101, 0, 111, 0], ["F9", 67, 67, 0, 92, 0, 102, 0, 112, 0], ["F10", 68, 68, 0, 93, 0, 103, 0, 113, 0], ["F11£", 87, 133, 0xE0, 135, 0xE0, 137, 0xE0, 139, 0xE0], ["F12£", 88, 134, 0xE0, 136, 0xE0, 138, 0xE0, 140, 0xE0], ["NUM", 69, None, None, None, None, None, None, None, None], ["HOME", 71, 71, 0, 55, "7", 119, 0, None, None], [None, None, None, None, None, None, None, None, None, None], ["HOME£", 71, 71, 0xE0, 71, 0xE0, 119, 0xE0, 151, 0], ["UP", 72, 72, 0, 56, "8", 141, 0, None, None], [None, None, None, None, None, None, None, None, None, None], ["UP£", 72, 72, 0xE0, 72, 0xE0, 141, 0xE0, 152, 0], ["PGUP", 73, 73, 0, 57, "9", 132, 0, 153, 0], [None, None, None, None, None, None, None, None, None, None], ["PGUP£", 73, 73, 0xE0, 73, 0xE0, 132, 0xE0, 153, 0], ["GRAY-", 74, None, None, 45, "-", None, None, None, None], ["LEFT", 75, 75, 0, 52, "4", 115, 0, None, None], [None, None, None, None, None, None, None, None, None, None], ["LEFT£", 75, 75, 0xE0, 75, 0xE0, 115, 0xE0, 155, 0], ["CENTER", 76, None, None, 53, "5", None, None, None, None], [None, None, None, None, None, None, None, None, None, None], ["RIGHT", 77, 77, 0, 54, "6", 116, 0, None, None], [None, None, None, None, None, None, None, None, None, None], ["RIGHT£", 77, 77, 0xE0, 77, 0xE0, 116, 0xE0, 157, 0], ["GRAY+", 78, None, None, 43, "+", None, None, None, None], ["END", 79, 79, 0, 49, "1", 117, 0, None, None], [None, None, None, None, None, None, None, None, None, None], ["END£", 79, 79, 0xE0, 79, 0xE0, 117, 0xE0, 159, 0], ["DOWN", 80, 80, 0, 50, "2", 145, 0, None, None], [None, None, None, None, None, None, None, None, None, None], ["DOWN£", 80, 80, 0xE0, 80, 0xE0, 145, 0xE0, 160, 0], ["PGDN", 81, 81, 0, 51, "3", 118, 0, None, None], [None, None, None, None, None, None, None, None, None, None], ["PGDN£", 81, 81, 0xE0, 81, 0xE0, 118, 0xE0, 161, 0], ["INS", 82, 82, 0, 48, "0", 146, 0, None, None], [None, None, None, None, None, None, None, None, None, None], ["INS£", 82, 82, 0xE0, 82, 0xE0, 146, 0xE0, 162, 0], ["DEL", 83, 83, 0, 46, ".", 147, 0, None, None], [None, None, None, None, None, None, None, None, None, None], ["DEL£", 83, 83, 0xE0, 83, 0xE0, 147, 0xE0, 163, 0], ] keycodes = [ ["ESC", 1, 27, None, 27, None, None, None, None, None], ["1!", 2, 49, "1", 33, "!", None, None, 49, None], ["2@", 3, 50, "2", 64, "@", 3, 0, 50, None], ["3#", 4, 51, "3", 35, "#", None, None, 51, None], ["4$", 5, 52, "4", 36, "$", None, None, 52, None], ["5%", 6, 53, "5", 37, "%", None, None, 53, None], ["6^", 7, 54, "6", 94, "^", None, None, 54, None], ["7&", 8, 55, "7", 38, "&", None, None, 55, None], ["8*", 9, 56, "8", 42, "*", None, None, 56, None], ["9(", 10, 57, "9", 40, "(", None, None, 57, None], ["0)", 11, 48, "0", 41, ")", None, None, 48, None], ["-_", 12, 45, "-", 95, "_", None, None, 45, None], ["=+", 13, 61, "=", 43, "+", None, None, 61, None], ["BKSP", 14, 8, None, 8, None, 127, None, 8, None], ["TAB", 15, 9, None, 9, None, 148, 0, None, None], ["Q", 16, 113, "q", 81, "Q", 17, "\x11", 113, None], ["W", 17, 119, "w", 87, "W", 23, "\x17", 119, None], ["E", 18, 101, "e", 69, "E", 5, "\x05", 101, None], ["R", 19, 114, "r", 82, "R", 18, "\x12", 114, None], ["T", 20, 116, "t", 84, "T", 20, "SO", 116, None], ["Y", 21, 121, "y", 89, "Y", 25, "\x19", 121, None], ["U", 22, 117, "u", 85, "U", 21, "\x15", 117, None], ["I", 23, 105, "i", 73, "I", 9, "\t", 105, None], ["O", 24, 111, "o", 79, "O", 15, "\x0f", 111, None], ["P", 25, 112, "p", 80, "P", 16, "\x10", 112, None], ["[{", 26, 91, "[", 123, "{", 27, "\x1b", 91, None], ["]}", 27, 93, "]", 125, "}", 29, "\x1d", 93, None], ["ENTER", 28, 13, "\r", 13, "\r", 10, "\x0a", None, None], ["ENTER£", 28, 13, "\r", 13, "\r", 10, "\x0a", None, None], ["LCTRL", 29, None, None, None, None, None, None, None, None], ["RCTRL£", 29, None, None, None, None, None, None, None, None], ["A", 30, 97, "a", 65, "A", 1, "\x01", 97, None], ["S", 31, 115, "s", 83, "S", 19, "\x13", 115, None], ["D", 32, 100, "d", 68, "D", 4, "\x04", 100, None], ["F", 33, 102, "f", 70, "F", 6, "\x06", 102, None], ["G", 34, 103, "g", 71, "G", 7, "\a", 103, None], ["H", 35, 104, "h", 72, "H", 8, "\b", 104, None], ["J", 36, 106, "j", 74, "J", 10, "\x0a", 106, None], ["K", 37, 107, "k", 75, "K", 11, "\v", 107, None], ["L", 38, 108, "l", 76, "L", 12, "\f", 108, None], [";:", 39, 59, ";", 58, ":", None, None, 59, None], ["'\"", 40, 39, "'", 34, '"', None, None, 39, None], ["`~", 41, 96, "`", 126, "~", None, None, 96, None], ["L SHIFT", 42, None, None, None, None, None, None, None, None], ["\\|", 43, 92, "\\", 124, "|", 28, "\x1c", 92, None], ["Z", 44, 122, "z", 90, "Z", 26, "\x1a", 122, None], ["X", 45, 120, "x", 88, "X", 24, "\x18", 120, None], ["C", 46, 99, "c", 67, "C", 3, "\x03", 99, None], ["V", 47, 118, "v", 86, "V", 22, "\x16", 118, None], ["B", 48, 98, "b", 66, "B", 2, "\x02", 98, None], ["N", 49, 110, "n", 78, "N", 14, "\x0e", 110, None], ["M", 50, 109, "m", 77, "M", 13, "\x0d", 109, None], # Ctrl-m -> \r [",<", 51, 44, ",", 60, "<", None, None, 44, None], [".>", 52, 46, ".", 62, ">", None, None, 46, None], ["/?", 53, 47, "/", 63, "?", None, None, 47, None], ["GRAY/£", 53, 47, "/", 63, "?", 149, 0, 164, 0], ["R SHIFT", 54, None, None, None, None, None, None, None, None], ["PRISC", 55, 42, "*", "PRISC", "✝✝", 16, None, None, None], ["L ALT", 56, None, None, None, None, None, None, None, None], ["R ALT£", 57, None, None, None, None, None, None, None, None], ["SPACE", 57, 32, " ", 32, " ", 32, " ", None, None], ["CAPS", 58, None, None, None, None, None, None, None, None], ["F1", 59, 59, 0, 84, 0, 94, 0, 104, 0], ["F2", 60, 60, 0, 85, 0, 95, 0, 105, 0], ["F3", 61, 61, 0, 86, 0, 96, 0, 106, 0], ["F4", 62, 62, 0, 87, 0, 97, 0, 107, 0], ["F5", 63, 63, 0, 88, 0, 98, 0, 108, 0], ["F6", 64, 64, 0, 89, 0, 99, 0, 109, 0], ["F7", 65, 65, 0, 90, 0, 100, 0, 110, 0], ["F8", 66, 66, 0, 91, 0, 101, 0, 111, 0], ["F9", 67, 67, 0, 92, 0, 102, 0, 112, 0], ["F10", 68, 68, 0, 93, 0, 103, 0, 113, 0], ["F11£", 87, 133, 0xE0, 135, 0xE0, 137, 0xE0, 139, 0xE0], ["F12£", 88, 134, 0xE0, 136, 0xE0, 138, 0xE0, 140, 0xE0], ["NUM", 69, None, None, None, None, None, None, None, None], ["HOME", 71, 71, 0, None, None, 119, 0, None, None], [None, None, 55, "7", 71, 0, 119, 0, None, None], ["HOME£", 71, 71, 0xE0, 71, 0xE0, 119, 0xE0, 151, 0], ["UP", 72, 72, 0, None, None, 141, 0, None, None], [None, None, 56, "8", 72, 0, 141, 0, None, None], ["UP£", 72, 72, 0xE0, 72, 0xE0, 141, 0xE0, 152, 0], ["PGUP", 73, 73, 0, None, None, 132, 0, None, None], [None, None, 57, "9", 73, 0, 132, 0, None, None], ["PGUP£", 73, 73, 0xE0, 73, 0xE0, 134, 0xE0, 153, 0], ["GRAY-", 74, None, None, 45, "-", None, None, None, None], ["LEFT", 75, 75, 0, None, None, 115, 0, None, None], [None, None, 52, "4", 75, 0, 115, 0, None, None], ["LEFT£", 75, 75, 0xE0, 75, 0xE0, 115, 0xE0, 155, 0], ["CENTER", 76, None, None, None, None, None, None, None, None], [None, None, 53, "5", None, None, None, None, None, None], ["RIGHT", 77, 77, 0, None, None, 116, 0, None, None], [None, None, 54, "6", 77, 0, 116, 0, None, None], ["RIGHT£", 77, 77, 0xE0, 77, 0xE0, 116, 0xE0, 157, 0], ["GRAY+", 78, None, None, 43, "+", None, None, None, None], ["END", 79, 79, 0, None, None, 117, 0, None, None], [None, None, 49, "1", 79, 0, 117, 0, None, None], ["END£", 79, 79, 0xE0, 79, 0xE0, 117, 0xE0, 159, 0], ["DOWN", 80, 80, 0, None, None, 145, 0, None, None], [None, None, 50, "2", 80, 0, 145, 0, None, None], ["DOWN£", 80, 80, 0xE0, 80, 0xE0, 145, 0xE0, 160, 0], ["PGDN", 81, 81, 0, None, None, 118, 0, None, None], [None, None, 51, "3", 81, 0, 118, 0, None, None], ["PGDN£", 81, 81, 0xE0, 81, 0xE0, 118, 0xE0, 161, 0], ["INS", 82, 82, 0, None, None, 146, 0, None, None], [None, None, 48, "0", 82, 0, 146, 0, None, None], ["INS£", 82, 82, 0xE0, 82, 0xE0, 146, 0xE0, 162, 0], ["DEL", 83, 83, 0, None, None, 147, 0, None, None], [None, None, 46, ".", 83, 0, 147, 0, None, None], ["DEL£", 83, 83, 0xE0, 83, 0xE0, 147, 0xE0, 163, 0], ] noms = "base shift ctrl alt".split() if __name__ == "__main__": import textwrap text = r"\text{{{}}}".format error = r"\color{{red}}{{{}}}".format gray = r"\color{{gray}}{{{}}}".format green = r"\color{{green}}{{{}}}".format to = r"{} \to {}".format def repr_text(value): return text( repr(value)[1:-1] .replace("{", r"\{") .replace("}", r"\}") .replace("$", r"\$") .replace(r"\'", "'") ) def error_text(value): return error(repr_text(value)) class Wrapper: def __init__(self, new, old): self.new = new self.old = old def __str__(self): if isinstance(self.new, int) or isinstance(self.old, int): if self.new == self.old: return gray(text(self.old)) else: return to(error_text(self.old), green(text(self.new))) elif self.new == self.old: if self.new is None: return "" else: return repr_text(self.old) elif self.new is None: return error_text(self.old) elif self.old is None: return green(repr_text(self.new)) else: return to(error_text(self.old), green(repr_text(self.new))) def read_table(table): for name, scan, *groups in table: codes = [] for code, other in zip(*[iter(groups)] * 2): if code is None: if other is None: codes.append(None) else: print("code: None other: ??? - {}".format(other)) codes.append(str(other)) elif isinstance(code, str): print("code: str - {} {}".format(code, other)) codes.append( "".join([str(i) for i in (other, code) if i is not None]) ) elif other is None or isinstance(other, str): codes.append(chr(code)) else: codes.append("".join(chr(i) for i in (other, code))) yield (name, scan, *codes) def read_tables(n, o): for n_values, o_values in zip(read_table(n), read_table(o)): yield [ Wrapper(n_value, o_value) for n_value, o_value in zip(n_values, o_values) ] fmt = r""" $$ \begin{{array}}{{l|r|l|l|l|l}} \textrm{{Name}} & \textrm{{Scan Code}} & \textrm{{Base}} & \textrm{{Shift}} & \textrm{{Ctrl}} & \textrm{{Alt}} \\ \hline {}\\ \end{{array}} $$ """ def format_(rows): values = "\\\\\n".join("&".join(map(str, row)) for row in rows) return textwrap.indent(fmt.format(textwrap.indent(values, " ")), " " * 4) def chunks(l, n): l = list(l) for i in range(0, len(l), n): yield l[i : i + n] for chunk in chunks(read_tables(keycodes, _keycodes), 40): print(format_(chunk))
[ "peilonrayz@gmail.com" ]
peilonrayz@gmail.com
df37a819293392094e379a0bab9ba5496f5eac55
a96f8bac6128c04a8df342c93767387a497baac4
/__init__.py
270588e7f5d006e36163f42b0b07b2d5540b9db7
[ "MIT" ]
permissive
unhideschool/uhql
0587ba601885087f0f81b4988fe67c4f3da72ff9
b2194388ee73d7bb4d08ef73ced44c73ab598e6a
refs/heads/master
2020-09-26T01:35:39.923209
2019-12-09T15:09:22
2019-12-09T15:09:22
226,133,093
0
0
null
null
null
null
UTF-8
Python
false
false
23
py
from .main import UHQL
[ "cadu.coelho@gmail.com" ]
cadu.coelho@gmail.com
bcae55b9da79fb75de68d0bdce8f367853beb588
5439206885b4161a50491affa08b1983e5adb7ed
/scope_test.py
473c94095fe00ce95eabb4fbf38b135bc9bd9f89
[]
no_license
adamwatts112358/horn_fieldmap
50ec364c99e7f2eafff69ca4f6ca34df00a59209
e33cc001535966014a2000b189aee4d04c04d4f7
refs/heads/master
2022-12-16T09:03:31.966938
2020-08-25T23:52:31
2020-08-25T23:52:31
259,395,331
0
0
null
null
null
null
UTF-8
Python
false
false
1,246
py
from scope_communication import * import numpy as np from os import system import Adafruit_BBIO.GPIO as GPIO # Define and setup the horn trigger pin trigger = 'P8_7' GPIO.setup(trigger, GPIO.IN) stripline_scope_IP = '192.168.1.2' stripline_scope_type = 'Agilent' # Setup BBB ethernet connection print 'Setting up BeagleBone ethernet connection.' system('sudo ifconfig eth0 192.168.1.1 netmask 255.255.248.0') # Setup stripline scope print 'Initializing stripline scope.' stripline_scope = initialize(stripline_scope_type, stripline_scope_IP) # Define the number of data points to take npoints = 5 point = 1 time_data = [] voltage_data = [] while point != (npoints+1): # Wait for a horn trigger GPIO.wait_for_edge(trigger, GPIO.RISING) # Download the scope data (does this need a delay?) time, voltage = acquire(stripline_scope_type, stripline_scope, 1) print 'Data point %i acquired.'%(point) time_data.append(time) voltage_data.append(voltage) # Increment the point count point = point + 1 print 'Data acquisition complete' # Print out data to check it for n in range(len(time_data)): for i in range(len(time)): print '%i \t %f \t %f'%(n+1, time_data[n][i], voltage_data[n][i])
[ "39932368+adamwatts112358@users.noreply.github.com" ]
39932368+adamwatts112358@users.noreply.github.com
d7d0149d97c5d90e7a108933c72213f71f493c05
3e84ee44588ee906cf782a1719b96355987e2f45
/IMBD/Actors.py
f519b15a03d404ba842f447d147f40cf126aacfc
[ "MIT" ]
permissive
himansh-nagar/web_scraping
b66e1854d4c3d0046fb9c759cb56e1d8f6d3d33b
f63b7c879c70b88429d33b949784e1dcb2908f5b
refs/heads/master
2022-09-03T00:03:33.219753
2020-05-29T10:44:59
2020-05-29T10:44:59
255,666,008
0
0
null
null
null
null
UTF-8
Python
false
false
788
py
import json,pprint file=open('all_movie_cast.json','r') File=json.load(file) file.close() all_movie_cast=[] all_movie_cast2=[] for dic_list in File: one_cast_list=[] for dic in dic_list: cast_list=dic_list[dic] for j in range(2): one_cast_list.append(cast_list[j]) all_movie_cast.append(one_cast_list) for dic_list_2 in File: for dic2 in dic_list_2: all_movie_cast2.append(dic_list_2[dic2]) num_list=[] for i in all_movie_cast: num_dic={} num=0 inde=0 inde2=1 first_ele=i[inde] sec_ele=i[inde2] for dic_list in File: for dic in dic_list: if first_ele in dic_list[dic] and sec_ele in dic_list[dic]: num+=1 first_ele2=str(first_ele) sec_ele2=str(str(sec_ele)+" "+str(num)) num_dic[first_ele2]=sec_ele2 num_list.append(num_dic) pprint.pprint(num_list)
[ "noreply@github.com" ]
noreply@github.com
4762de0549dd0e5a2c55d037f49bed37dd3c8877
5e2fd1d42423cb1de218ce2b07696c98c14adb09
/extest/migrations/0002_auto_20200711_2145.py
89a65cda1206afbf0a35558e54fd058cfa3b9bae
[]
no_license
Yaanibaano/Todo-Web-App
ea72ac08703d9ce227e1c1de73a704ddbda48bcf
5fe929f9b3bcf57140bf8d5514f4525870d40a0d
refs/heads/master
2022-12-22T09:28:37.120036
2020-09-23T09:48:04
2020-09-23T09:48:04
297,924,635
0
0
null
null
null
null
UTF-8
Python
false
false
315
py
# Generated by Django 3.0 on 2020-07-11 16:15 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('extest', '0001_initial'), ] operations = [ migrations.RenameModel( old_name='Element', new_name='Task', ), ]
[ "chandru.vijayan101999@gmail.com" ]
chandru.vijayan101999@gmail.com
5c45e9998b505e3bdd5403e41fd8ec79d4127387
f43418339d85ab07ec369fd8f14df6f0b1d4bcd8
/ch3/barrier/python/barrier.py
86ed375668e3f0bb72ae10219c42461b09699ee9
[]
no_license
frankieliu/little-book-semaphores
732fbb1787d826666e750c4e8c8897877631921c
9017ddceeab30090af983100729649f0f29c7c99
refs/heads/master
2021-07-14T03:40:05.503689
2020-08-15T13:55:19
2020-08-15T13:55:19
195,286,896
1
4
null
null
null
null
UTF-8
Python
false
false
967
py
from threading import Thread, Semaphore import time from random import randint class Person(Thread): def __init__(self,i,m,s,count,numthreads): self.s = s self.m = m self.count = count self.count.i = 0 self.numthreads = numthreads super().__init__(name=i) def run(self): time.sleep(1e-3*randint(1,10)) print(f"{self.name} rendez") # barrier self.m.acquire() self.count.i += 1 if self.count.i == self.numthreads: self.s.release() self.m.release() self.s.acquire() self.s.release() print(f"{self.name} critical section") class Count(): pass def main(): nthreads = 10 m = Semaphore(1) s = Semaphore(0) count = Count() thr = [] for i in range(nthreads): thr.append(Person(i+1, m, s, count, nthreads)) for t in thr: t.start() for t in thr: t.join() main()
[ "frankie.y.liu@gmail.com" ]
frankie.y.liu@gmail.com
a9874ad67c55edcf3fa4110df2021f892397f8be
cc1118a5033fb13b68473fb6e7dc1fcbcbd955e1
/models/encoder.py
1ec642809f0b3d87deab3dbdeed022f0bbca7caf
[]
no_license
Tony-Xiang-Cao/3D-Reconstruction-Pix2Vox-LSTM
d961729510ea554a5e9b67343ea0c935144c268b
05cf1a76224217cb5b2a5a1b2c9b776aa143360a
refs/heads/main
2023-04-01T16:15:07.396181
2021-04-18T04:02:58
2021-04-18T04:02:58
358,793,458
1
0
null
null
null
null
UTF-8
Python
false
false
2,348
py
# -*- coding: utf-8 -*- # # # References: # - https://github.com/shawnxu1318/MVCNN-Multi-View-Convolutional-Neural-Networks/blob/master/mvcnn.py import torch import torchvision.models class Encoder(torch.nn.Module): def __init__(self, cfg): super(Encoder, self).__init__() self.cfg = cfg # Layer Definition vgg16_bn = torchvision.models.vgg16_bn(pretrained=True) self.vgg = torch.nn.Sequential(*list(vgg16_bn.features.children()))[:27] self.layer1 = torch.nn.Sequential( torch.nn.Conv2d(512, 512, kernel_size=3), torch.nn.BatchNorm2d(512), torch.nn.ELU(), ) self.layer2 = torch.nn.Sequential( torch.nn.Conv2d(512, 512, kernel_size=3), torch.nn.BatchNorm2d(512), torch.nn.ELU(), torch.nn.MaxPool2d(kernel_size=3) ) self.layer3 = torch.nn.Sequential( torch.nn.Conv2d(512, 256, kernel_size=1), torch.nn.BatchNorm2d(256), torch.nn.ELU() ) # Don't update params in VGG16 for param in vgg16_bn.parameters(): param.requires_grad = False def forward(self, rendering_images): # print(rendering_images.size()) # torch.Size([batch_size, n_views, img_c, img_h, img_w]) rendering_images = rendering_images.permute(1, 0, 2, 3, 4).contiguous() rendering_images = torch.split(rendering_images, 1, dim=0) image_features = [] for img in rendering_images: features = self.vgg(img.squeeze(dim=0)) # print(features.size()) # torch.Size([batch_size, 512, 28, 28]) features = self.layer1(features) # print(features.size()) # torch.Size([batch_size, 512, 26, 26]) features = self.layer2(features) # print(features.size()) # torch.Size([batch_size, 512, 24, 24]) features = self.layer3(features) # print(features.size()) # torch.Size([batch_size, 256, 8, 8]) image_features.append(features) image_features = torch.stack(image_features).permute(1, 0, 2, 3, 4).contiguous() # print(image_features.size()) # torch.Size([batch_size, n_views, 256, 8, 8]) return image_features
[ "noreply@github.com" ]
noreply@github.com
532c1fbc727c31ff6486882eee4a7280a77783c2
bb0efa84c5e3fdbb406a5cbbdcacabcdaf041a68
/venv/bin/easy_install-2.7
f6822712f8fb3243675c82786863af5ac8515e4d
[]
no_license
luzhaohong/Pyramide_myproject
ce85a22ec4c5fea34f6a5c8360f3e29a10ba0b3f
30b51981dfdeb9c3c53734579bf2274a4b010c18
refs/heads/master
2020-04-01T00:34:32.515469
2018-10-12T06:42:09
2018-10-12T06:42:09
152,702,914
0
0
null
null
null
null
UTF-8
Python
false
false
279
7
#!/home/luzhaohong/PycharmProjects/myproject/venv/bin/python2.7 # -*- coding: utf-8 -*- import re import sys from setuptools.command.easy_install import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(main())
[ "luzhaohong@yeah.net" ]
luzhaohong@yeah.net
30e2605d76c1c5ced65e21beb0f039317794a686
15fbe75198cc2646f843de9a795c1b3cb1b9bf21
/tools/optimization/candidate.py
e5b0c706f8353a729b047536ad353fa83b10c319
[ "BSD-3-Clause" ]
permissive
jlcox119/HOPP
8750b4a82bf97e8fc1d1794418f7c40650b22baf
e8faa5012cab8335c75f8d1e84270e3127ff64bb
refs/heads/master
2023-06-18T15:09:55.119235
2021-05-17T17:06:37
2021-05-17T17:06:37
368,262,087
0
0
BSD-3-Clause
2021-07-19T16:16:41
2021-05-17T17:03:13
PowerBuilder
UTF-8
Python
false
false
470
py
import pprint class Candidate: """ Simulation inputs to be optimized """ def __init__( self ) -> None: pass def __repr__(self) -> str: return pprint.pformat(vars(self)) def __str__(self) -> str: return self.__repr__() def __setitem__(self, key: str, value: object ) -> None: self.__setattr__(key, value)
[ "noreply@github.com" ]
noreply@github.com
79b42026725b7e117b7171373a8e3a7e7a7b72d5
227f6d603ed405ec6f82928102de3d00cd24837c
/python/start_algs.py
26d46349ec3a437fcaf9c827977e36e2a0109f01
[]
no_license
Egorich42/algs
946022389e13384a796918272fe088cb01e80862
65b02b7d818fc53ca3f90406e7a13ea444ad4b59
refs/heads/master
2020-07-30T02:14:02.106929
2019-09-21T20:53:23
2019-09-21T20:53:23
210,051,982
0
0
null
null
null
null
UTF-8
Python
false
false
4,161
py
#!/usr/bin/python # -*- coding: utf-8 -*- #бинарная #быстрая #Сортировка вставками / Insertion sort #Сортировка выбором / Selection sort #Сортировка слиянием / Merge sort test_arr = [8,0, 16, -3, 889, 19, 19, 0, 11, 6,4,56] def bubble_sort(arr): for i in range(len(arr)-1): # идет простая проходка по циклу. for x in range(len(arr)-1-i): """ а вот здесь уже идет процесс смены. каждый внутренний цикл проходится по всему списку. и каждую проходку ТОЛЬКО ПРОПИХИВАЕТ В КОНЕЦ БОЛЬШИЙ ЭЛЕМЕНТ. И все! ТОЛЬКО один элемент становится в конец. И каждый раз тебе нужно в конце поставть элемент ПЕРЕд самым последним. Бо в первую проходку в конце выдвинется самый толстый, за счет сравнения. В следующую - чуть меньший и т.д. """ #print("Arr on big iteration",arr) if arr[x] > arr[x+1]: arr[x], arr[x+1] = arr[x+1], arr[x] #print("####arr on inside iters", arr) return arr pass #bubble_sort(test_arr) def find_min(arr): mini = None for element in arr: if not mini: mini = element if element < mini: mini = element return mini pass def insert_sort(arr): #Важно помнить о большом и малм шаге. Внутренний цикл ВЕСЬ проходит на ОДНОМ большом шаге. #Соответственно на одном БОЛШОМ шаге мы концентрируемся на сортировке вокруг ОДНОГО большого элемента #И вот тут на каждом большом шаге мы берем один БОЛШОЙ элемент, и двигаем его в отсортированную зону. #А потом сменяем БОЬШОЙ на следующий, который так же пропихиваем. for position in range(1, len(arr)): current_value = arr[position] while position > 0 and current_value < arr[position - 1]: arr[position] = arr[position-1] position = position-1 arr[position] = current_value return arr pass def insert_sort_2(arr): sorted_arr = [] for i in range(len(arr)): min_el = find_min(arr) sorted_arr.append(arr.pop(arr.index(min_el))) return sorted_arr pass def insert_sort_3(arr): sorted_arr = [] for i in range(len(arr)): min_el = find_min(arr) sorted_arr.append(min_el) arr.remove(min_el) return sorted_arr pass def insert_sort_4(arr): for position in range(1, len(arr)): current_value = arr[position] for x in range(0, position): if current_value < arr[x]: current_value, arr[x] = arr[x], current_value arr[position] = current_value return arr pass def selection_sort(arr): for element in range(len(arr)): current_value = element print(current_value) for inner_element in range(element+1, len(arr)): if arr[inner_element] < arr[current_value]: #print(arr[inner_element], arr[current_value]) current_value = inner_element #print(arr) arr[current_value], arr[element] = arr[element], arr[current_value] print("Смена:", arr) return arr pass def qsort1(list): if list == []: return [] else: pivot = list[0] lesser = qsort1([x for x in list[1:] if x < pivot]) greater = qsort1([x for x in list[1:] if x >= pivot]) return lesser + [pivot] + greater def quick_sort(arr): if arr == []: return [] else: start_el = arr[0] middle = [] maxi = [] mini = [] for x in arr: if x > start_el: maxi += [x] if x < start_el: mini += [x] if x == start_el: middle.append(x) return quick_sort(mini) + middle + quick_sort(maxi) #print(qsort1(test_arr)) #print(quick_sort(test_arr)) #print(insert_sort(test_arr)) #print(insert_sort_4(test_arr)) #print(selection_sort(test_arr))
[ "e.g.hutter@gmail.com" ]
e.g.hutter@gmail.com
74a36c63655f9b9bee75b5c2fbfe2b5322ae3db4
9b1e600c3e1c521a82a782be6b26ec3634168843
/CLRS/1 排序/堆排序.py
25fcf4e01ca2821158a4b7cf9d3f99a7ecb4e52b
[]
no_license
lijingwei1995/Algorithm
b782732c4364c4eaa256ebec827b4241cb39ad45
5d8a228d75369e4d72e3d76608584e43e329d531
refs/heads/master
2021-01-03T18:47:42.165193
2020-02-28T09:57:16
2020-02-28T09:57:16
240,197,233
0
0
null
null
null
null
UTF-8
Python
false
false
1,326
py
# 最大堆的heapify # 这是一个递归函数,他可以调整 任意左右子树以满足性质,但父节点未知的树 def MAX_HEAPIFY(A, heap_size, i): # 下标i如果是父节点 left = 2 * i + 1 right = 2 * i + 2 # 找到最大节点 max = i if left < heap_size and A[left] > A[i] : max = left # 将数字比较写在左边可以避免超限问题 if right < heap_size and A[right] > A[max]: max = right # 如果最大不是i,则与最大的交换,并继续递归该分支 if max != i: temp = A[i] A[i] = A[max] A[max] = temp MAX_HEAPIFY(A, heap_size, max) # 建堆 def BUILD_MAX_HEAP(A): # 从最底下的一个父节点至顶,以此执行MAX_HEAPIFY first_parent = int(len(A)/2) - 1 for i in range(first_parent, -1, -1): MAX_HEAPIFY(A, len(A), i) # 堆排序 # 我们可以将最大的数拿出,将最后一个数字重新放回堆,然后执行HEAPIFY def HEAP_SORT(A): # 先建堆 BUILD_MAX_HEAP(A) # 依次执行交换、HEAPIFY heap_size = len(A) while heap_size > 0: temp = A[0] A[0] = A[heap_size-1] A[heap_size-1] = temp MAX_HEAPIFY(A, heap_size, 0) heap_size -= 1 A = [16, 3, 10, 8, 1, 9, 14, 2, 4, 7] HEAP_SORT(A) A
[ "lijingwei@outlook.com" ]
lijingwei@outlook.com
13564f1fa07291d92bd2edd1ade46fb1f410c888
e84020108a7037d8d4867d95fada1b72cbcbcd25
/django/nrega.libtech.info/src/nrega/migrations/0118_auto_20170621_1328.py
219d29cf057534d7b88f61db611446f66075c53b
[]
no_license
rajesh241/libtech
8384316051a2e8c2d4a925cd43216b855b82e4d9
0105e717357a3626106028adae9bf162a7f93fbf
refs/heads/master
2022-12-10T03:09:00.048841
2020-06-14T09:39:04
2020-06-14T09:39:04
24,629,538
1
1
null
2022-12-08T02:26:11
2014-09-30T07:57:45
Python
UTF-8
Python
false
false
3,064
py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-06-21 07:58 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('nrega', '0117_auto_20170621_1123'), ] operations = [ migrations.AlterField( model_name='applicant', name='panchayat', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.Panchayat'), ), migrations.AlterField( model_name='block', name='district', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.District'), ), migrations.AlterField( model_name='district', name='state', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.State'), ), migrations.AlterField( model_name='fpsshop', name='block', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.Block'), ), migrations.AlterField( model_name='fto', name='block', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.Block'), ), migrations.AlterField( model_name='muster', name='block', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.Block'), ), migrations.AlterField( model_name='muster', name='panchayat', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='nrega.Panchayat'), ), migrations.AlterField( model_name='nicblockreport', name='block', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.Block'), ), migrations.AlterField( model_name='panchayat', name='block', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.Block'), ), migrations.AlterField( model_name='panchayatreport', name='panchayat', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.Panchayat'), ), migrations.AlterField( model_name='panchayatstat', name='panchayat', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.Panchayat'), ), migrations.AlterField( model_name='village', name='panchayat', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='nrega.Panchayat'), ), migrations.AlterField( model_name='wagelist', name='block', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nrega.Block'), ), ]
[ "togoli@gmail.com" ]
togoli@gmail.com
75498a2f5f3b001a45ca4069131312af6328a494
7ad19e854135977ee5b789d7c9bdd39d67ec9ea4
/members/amit/f0_experiments/model.py
05a5e529b028aa62ab646eb7176aec7490be90a4
[ "MIT" ]
permissive
Leofltt/rg_sound_generation
1b4d522507bf06247247f3ef929c8d0b93015e61
8e79b4d9dce028def43284f80521a2ec61d0066c
refs/heads/main
2023-05-02T19:53:23.645982
2021-05-22T16:09:54
2021-05-22T16:09:54
369,842,561
0
0
MIT
2021-05-22T15:27:28
2021-05-22T15:27:27
null
UTF-8
Python
false
false
1,197
py
import tensorflow as tf from tensorflow.keras.layers import Input, concatenate, RepeatVector from tensorflow.keras.layers import Dense, GRU, Dropout def create_model(): _velocity = Input(shape=(5,), name='velocity') _instrument_source = Input(shape=(3,), name='instrument_source') _qualities = Input(shape=(10,), name='qualities') _z = Input(shape=(1000, 16), name='z') categorical_inputs = concatenate( [_velocity, _instrument_source, _qualities], name='categorical_inputs' ) _input = concatenate( [_z, RepeatVector(1000, name='repeat')(categorical_inputs)], name='total_inputs' ) x = GRU(256, return_sequences=True, name='gru_1')(_input) x = Dropout(0.5, name='dropout_1')(x) x = GRU(256, return_sequences=True, name='gru_2')(x) x = Dropout(0.5, name='dropout_2')(x) _f0_categorical = Dense(49, activation='softmax', name='f0_categorical')(x) model = tf.keras.models.Model( [_velocity, _instrument_source, _qualities, _z], _f0_categorical ) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) return model
[ "amit.yadav.iitr@gmail.com" ]
amit.yadav.iitr@gmail.com
d88f28ea450ca654dba6310cde31716208642a8a
e5c04d26f143fff684684139c59e4f5f9519cc1a
/simple_python_game.py
a6aa8e200f749cc8d2d98ea6669bfe97ac98432a
[]
no_license
nabilnegm/simple-python-game
c243c5724572293479ca4227c2b789bba5c9c076
03f02c0344a5b99dbb9b1bbb2c4b8638c467b886
refs/heads/master
2020-09-29T01:09:29.079760
2019-12-09T16:01:57
2019-12-09T16:01:57
149,772,056
0
0
null
null
null
null
UTF-8
Python
false
false
1,150
py
import random random_number = [] for x in range(3) : random_number.append(random.randint(0,10)) if x > 0 : for y in range(x) : if random_number[x] == random_number[y] : random_number[x] = random.randint(0,10) y=0 while 1 : input_from_user = [] for x in range(3) : input_from_user.append(input("enter a 1 digit number ",)) if len(input_from_user[x]) > 1 : print("input too big only first digit will be taken") input_from_user[x] = input_from_user[x][0] for x in range(3) : input_from_user[x] = int(input_from_user[x]) match = 0 statement = 'nope' for x in range(3) : for y in range(3) : if input_from_user[y] == random_number[x] : if x == y : statement = 'match' match += 1 break elif statement == 'match' : break else : statement = 'close' if match == 3 : print("horraaayyyyy ^^") break else : print(statement)
[ "n.negm321@gmail.com" ]
n.negm321@gmail.com
72f3f148ec829bafe29c6dfa81210b74988a3f3d
fd291e4d0291a96d1854f9b05e5b3628f953cfdc
/source/main/encryptor.py
659595a42945106f6f826adea93f1ad1efcf2402
[]
no_license
joegumke/csgy-6903_proj1
a7ec7aaf510865aa3633325f938cbf4a7e1296f3
de0a2f3c4ba9c093009b33dce004cd05266f62a9
refs/heads/main
2023-04-02T07:28:00.418883
2021-04-08T21:39:13
2021-04-08T21:39:13
356,054,027
0
0
null
null
null
null
UTF-8
Python
false
false
15,861
py
#! /usr/bin/python # NYU Cryptography Project 1 from random import * import decryptor as decryptor import time, os alphaLower = "abcdefghijklmnopqrstuvwxyz" fileToWriteTo = "../test.resources/testDecryptorResult.txt" selectedPlainTextFile = "../main.resources/selectedPlainText.txt" plaintextDict1File = "../main.resources/test1dict.txt" plaintextDict2File = "../main.resources/test2dict.txt" def test1_plaintext_gen(dictfile): # let's assume dictfile1 has 5 plaintext lines & dictfile2 has 40 english words # this function returns either a single plaintext line or a word selected randomly count = 0 for line in open(dictfile).readlines(): count += 1 # Take random word as input f = open(dictfile) lines = f.readlines() randomLineNum = randint(0, count-1) if randomLineNum % 2 == 0: randomLineNum += 1 randomLine = lines[randomLineNum].rstrip() stripped = lambda s: "".join(i for i in s if (96 < ord(i) < 123) or ord(i) == 32) randomLine = stripped(randomLine) # Output Results print("Test 1 : Plain text Length:", len(randomLine)) print("Test 1 : Randomly selected plain text '%s'"%randomLine) return randomLine def test2_plaintext_gen(dictfile, maxLen): # let's assume dictfile1 has 5 plaintext lines & dictfile2 has 40 english words # this function returns either a single plaintext line or a word selected randomly plaintext = "" count = 0 for line in open(dictfile).readlines(): count += 1 # Take random word as input f = open(dictfile) lines = f.readlines() while len(plaintext) < maxLen: randomLineNum = randint(0, count-1) randomWord = lines[randomLineNum] randomWord = randomWord.strip() plaintext += randomWord + " " plaintext = plaintext[:500] # Output Results # print("Test 2 : Concatenated plaintext (length):", len(plaintext)) # print("Test 2 : Concatenated plaintext '%s'"%plaintext) return plaintext def enc_key_gen(maxKeyLength): # Generate encryption key of random length from 1 to maxKeyLength made of numbers from 0 to 26 # !!!!Create a T length random number dictionary for 0-26 length of T numbers. alphaDict = {0: ' ', 1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'} # Initialize the encryptionKey array encryptKey = [] alphaKey = [] alphaStrKey = "" # select a random int from 0 to maxKeyLength as keyLength t for this instance keyLen = randint(7, maxKeyLength) # populate the encryptKey array of length keyLen with a random int from 0 to 26 for i in range(keyLen): encryptKey.append(randint(0, 26)) # Output Results for i in range(keyLen): alphaKey += [v for k, v in alphaDict.items() if k == encryptKey[i]] # print("Alpha Encryption Key: chars", alphaKey) print("Encryption Key: '%s'"%alphaStrKey.join(alphaKey)) print("Encryption Key: ", encryptKey) print("Encryption Key Length:", len(encryptKey)) return encryptKey def encryptor(maxKeyLength, randomizer, randomizer_action, testNum, maxMsgLength): alphaDict = {0: ' ', 1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'} ciphertext = [] ciphertext_flat = [] ciphertext_str = "" encryptKey = [] random_chars = 0 # generate random key encryptKey = enc_key_gen(maxKeyLength) t = len(encryptKey) if testNum == 1: plaintext_from_file = \ test1_plaintext_gen("../main.resources/test1dict.txt") else: plaintext_from_file = \ test2_plaintext_gen("../main.resources/test2dict_400.txt", maxMsgLength) plaintext = plaintext_from_file plaintext_len = len(plaintext) s_i = m_i = 0 while m_i < plaintext_len: if randomizer_action == "add": k_i = s_i % t + randomizer # randomizer is static for the entire encryption run - it's passed in # k_i = (2*s_i + 3) % t + randomizer # randomizer is static for the entire encryption run - it's passed in else: k_i = s_i % t - randomizer # randomizer is static for the entire encryption run - it's passed in if k_i >= t or k_i < 0: s_i += 1 randchar_k = randint(0, 26) ciphertext.insert(len(ciphertext), [v for k, v in alphaDict.items() if k == randchar_k]) #print("Inserted random char: ", ciphertext[len(ciphertext)-1], "At index: ", len(ciphertext)-1) random_chars += 1 continue else: plaintext_k = [k for k, v in alphaDict.items() if v == plaintext[m_i]] ciphertext_k = plaintext_k[0] - encryptKey[k_i] if ciphertext_k < 0: ciphertext_k += len(alphaDict) ciphertext.insert(len(ciphertext), [v for k, v in alphaDict.items() if k == ciphertext_k]) m_i += 1 s_i += 1 # print("Modified Plaintext (# indicates random char", plaintext) print("Plaintext Length:", len(plaintext_from_file), " Ciphertext length:", len(ciphertext), "Rand Chars: ", random_chars) rand_percent = round((random_chars/len(plaintext)) * 100, 2) print("random chars in cipher text: ", rand_percent, "%") for elem in ciphertext: ciphertext_flat.extend(elem) ciphertext_str = ''.join(ciphertext_flat) # print("Cipher text list: ", ciphertext_flat) if testNum == 2: print("Randomly Generated Plaintext (from dict2): '%s'" % plaintext) print("Cipher text str: '%s'"%ciphertext_str) start=time.time() decryptor.arrayPopulator(testNum, ciphertext_str) end=time.time() print(f"**************Runtime of the program is {end - start}") #return ciphertext_str def cipherText(fileName, maxKeyLength, randomizer, randomizer_action, testNum, maxMsgLength): alphaDict = {0: ' ', 1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'} ciphertext = [] ciphertext_flat = [] ciphertext_str = "" encryptKey = [] random_chars = 0 # generate random key encryptKey = enc_key_gen(maxKeyLength) t = len(encryptKey) dictNum = randint(1, 100) % 2 # dictNum = 1 if dictNum == 1: plaintext_from_file = \ test1_plaintext_gen(plaintextDict1File) #test1_plaintext_gen("../main.resources/test1dict.txt") else: plaintext_from_file = \ test2_plaintext_gen(plaintextDict2File, maxMsgLength) #test2_plaintext_gen("../main.resources/test2dict.txt", maxMsgLength) plaintext = plaintext_from_file plaintext_len = len(plaintext) s_i = m_i = 0 scheduler = randint(1, 5) if scheduler == 1: scheduler_str = "(i % t) + " + str(randomizer) elif scheduler == 2: scheduler_str = "(i % t) - " + str(randomizer) elif scheduler == 3: scheduler_str = "((2 * i + 3) % t) + " + str(randomizer) elif scheduler == 4: scheduler_str = "((3 * i - 4) % t) - " + str(randomizer) elif scheduler == 5: scheduler_str = "(2 * i + " + str(randomizer) + ") % t" while m_i < plaintext_len: if scheduler == 1: k_i = s_i % t + randomizer # randomizer is static for the entire encryption run - it's passed in elif scheduler == 2: k_i = s_i % t - randomizer # randomizer is static for the entire encryption run - it's passed in elif scheduler == 3: k_i = (2 * s_i + 3) % t + randomizer # randomizer is static for the entire encryption run - it's passed in elif scheduler == 4: k_i = (3 * s_i - 4) % t - randomizer # randomizer is static for the entire encryption run - it's passed in elif scheduler == 5: k_i = (2 * s_i + randomizer) % t # randomizer is static for the entire encryption run - it's passed in if k_i >= t or k_i < 0: s_i += 1 randchar_k = randint(0, 26) ciphertext.insert(len(ciphertext), [v for k, v in alphaDict.items() if k == randchar_k]) if len(ciphertext)-1 < 3*t: print("Inserted random char: ", ciphertext[len(ciphertext)-1], "At index: ", len(ciphertext)-1) random_chars += 1 continue else: plaintext_k = [k for k, v in alphaDict.items() if v == plaintext[m_i]] ciphertext_k = plaintext_k[0] - encryptKey[k_i] if ciphertext_k < 0: ciphertext_k += len(alphaDict) ciphertext.insert(len(ciphertext), [v for k, v in alphaDict.items() if k == ciphertext_k]) m_i += 1 s_i += 1 # print("Modified Plaintext (# indicates random char", plaintext) print(f'Randomly selected Scheduler: {scheduler_str}') print("Plaintext Length:", len(plaintext_from_file), " Ciphertext length:", len(ciphertext), "Rand Chars: ", random_chars) rand_percent = round((random_chars/len(plaintext)) * 100, 2) print("random chars in cipher text: ", rand_percent, "%") for elem in ciphertext: ciphertext_flat.extend(elem) ciphertext_str = ''.join(ciphertext_flat) # print("Cipher text list: ", ciphertext_flat) if dictNum == 1: print("Randomly Selected Plaintext (from dict1 strings): '%s'" % plaintext) else: print("Randomly Generated Plaintext (concatenated dict2 words): '%s'" % plaintext) print("Cipher text str: '%s'"%ciphertext_str) ptFile = open(selectedPlainTextFile, "w") ptFile.write(plaintext) ptFile.close() mode = 'a+' if os.path.exists(fileToWriteTo) else 'w+' with open(fileToWriteTo,mode) as f: f.write('Encryptor :: Randomly generated plain text\n') f.write(plaintext) f.write('\n') f.write('Encryptor :: Key Scheduler Function (i: plaintext index, t: key length = ' + str(t) + ')\n') f.write(scheduler_str) f.write('\n') f.write('Encryptor :: Cipher text\n') f.write(ciphertext_str) f.write('\n') f.write('\n**************************') f.close() return (ciphertext_str) def encryptor(fileName, maxKeyLength, randomizer, randomizer_action, testNum, maxMsgLength): ciphertext_str = cipherText(fileName, maxKeyLength, randomizer, randomizer_action, testNum, maxMsgLength) tot_runtime = decryptor.arrayPopulator(fileName, testNum, ciphertext_str) # print(f"**************Runtime of the Decryptor is {tot_runtime}") return (tot_runtime) def get_dict2_freq_distribution(num_strings, maxMsgLength): frequencies = {" ": 0.0000, "a": 0.08497,"b": 0.01492,"c": 0.02202,"d": 0.04253,"e": 0.11162,"f": 0.02228,"g": 0.02015, "h": 0.06094,"i": 0.07546,"j": 0.00153,"k": 0.01292,"l": 0.04025,"m": 0.02406,"n": 0.06749, "o": 0.07507,"p": 0.01929,"q": 0.00095,"r": 0.07587,"s": 0.06327,"t": 0.09356,"u": 0.02758, "v": 0.00978,"w": 0.02560,"x": 0.00150,"y": 0.01994,"z": 0.00077,} # Build Alphabet Map alphabet = [' '] + [chr(i + ord('a')) for i in range(26)] alphabet_distribution = {} alphabet_freq = {} for i in range(0, len(alphabet)): alphabet_distribution[alphabet[i]] = 0 alphabet_freq[alphabet[i]] = 0 test2_sample_str = "" total_chars = 0 # num_strings = 50000 for i in range(0, num_strings): test2_sample_str += test2_plaintext_gen("../main.resources/test2dict_400.txt", maxMsgLength) for c in test2_sample_str: alphabet_distribution[c] += 1 total_chars += 1 for i in range(len(alphabet)): alphabet_freq[alphabet[i]] = round(alphabet_distribution[alphabet[i]]/total_chars, 4) # print("Test 2 sample str: ",test2_sample_str) print("Total chars: ", len(test2_sample_str)) print("Test 2 alpha distribution: ",alphabet_distribution) print("Test 2 alpha frequency: ", alphabet_freq) print("==============================") print("English Lang Std Freq:", frequencies) print("==============================") return alphabet_freq def get_dict2_freq_distribution(filename, num_strings, maxMsgLength): frequencies = {" ": 0.0000, "a": 0.08497,"b": 0.01492,"c": 0.02202,"d": 0.04253,"e": 0.11162,"f": 0.02228,"g": 0.02015, "h": 0.06094,"i": 0.07546,"j": 0.00153,"k": 0.01292,"l": 0.04025,"m": 0.02406,"n": 0.06749, "o": 0.07507,"p": 0.01929,"q": 0.00095,"r": 0.07587,"s": 0.06327,"t": 0.09356,"u": 0.02758, "v": 0.00978,"w": 0.02560,"x": 0.00150,"y": 0.01994,"z": 0.00077,} # Build Alphabet Map alphabet = [' '] + [chr(i + ord('a')) for i in range(26)] alphabet_distribution = {} alphabet_freq = {} for i in range(0, len(alphabet)): alphabet_distribution[alphabet[i]] = 0 alphabet_freq[alphabet[i]] = 0 test2_sample_str = "" total_chars = 0 # num_strings = 50000 for i in range(0, num_strings): test2_sample_str += test2_plaintext_gen(filename, maxMsgLength) for c in test2_sample_str: alphabet_distribution[c] += 1 total_chars += 1 for i in range(len(alphabet)): alphabet_freq[alphabet[i]] = round(alphabet_distribution[alphabet[i]]/total_chars, 4) # print("Test 2 sample str: ",test2_sample_str) print("Total chars: ", len(test2_sample_str)) print("Test 2 alpha distribution: ",alphabet_distribution) print("Test 2 alpha frequency: ", alphabet_freq) print("==============================") print("English Lang Std Freq:", frequencies) print("==============================") return alphabet_freq def main(): # ********************************************************************************************************* # Project 1 configuration to test encryption / decryption of 2 attack types # ********************************************************************************************************* # test random message generator # maxKeyLength = 24 maxKeyLength = 24 # randomizer value of 1 is a simple randomizer : (i % t) + 1 : i is the plaintext index, t is the key length randomizer = 1 # randomizer = 0 # randomizer action tells the encryptor whether to add or subtract the randomizer from i % t randomizer_action = "add" # randomizer_action = "subtract" # testNum = 1: Randomly select 1 of 5, 500 char strings and try to decrypt it # testNum = 2: Randomly select words from a dict to generate a ~500 char string and try to decrypt it testNum = 2 maxMsgLength = 500 fileName = "../main.resources/wordsMerged.txt" #encryptor(maxKeyLength, randomizer, randomizer_action, testNum, maxMsgLength) encryptor(fileName, maxKeyLength, randomizer, randomizer_action, testNum, maxMsgLength) #get_dict2_freq_distribution(fileName, 50000, 500) if __name__ == "__main__": main()
[ "noreply@github.com" ]
noreply@github.com
e4d4fea068c46ee67164d1c119beff0d536a0ce2
b02234111d79ea1fe352e57884cbaef7822c92b6
/day6/Hurdle 3_3.py
be5ec4b303a9686852f4d5432d3963c476cd52d1
[]
no_license
medbasso/python_bootcamp_solution
1567d257d6cf4c339195f59f341fdf289790d09c
07e234d4199cfdaa87e0f4e3b039bfaa0ac522be
refs/heads/main
2023-02-05T00:47:29.722318
2020-12-24T20:03:23
2020-12-24T20:03:23
322,890,807
1
0
null
null
null
null
UTF-8
Python
false
false
538
py
def right(): turn_left() turn_left() turn_left() def jump(): turn_left() move() right() move() right() move() turn_left() while at_goal() !=True: if wall_in_front() != True: move() else: jump() ################################################################ # WARNING: Do not change this comment. # Library Code is below. ################################################################
[ "tounsi1295@gmail.com" ]
tounsi1295@gmail.com
42caf49b668d0512a63087fa1f772a41f02fcc14
f811ff7901a565842b71ceb347ff613c07036ffb
/python/1-6-2.py
33d9c37acd775d62b517bbd642bf54a1021a6b67
[]
no_license
anfernee84/Learning
600f8006f1c0033245b9e1bf7e4191540d7bd04f
6fd9e24e6ca51155b313957c77119bab816c0a07
refs/heads/master
2021-08-03T15:47:53.226387
2021-07-25T12:00:26
2021-07-25T12:00:26
234,156,414
0
0
null
null
null
null
UTF-8
Python
false
false
339
py
def total_salary(path): fh = open(path, 'r') sums = 0 while True: line = fh.readline() if not line: break l = line l = l.rstrip("\n") l = l.split(",") sums += float(l[1]) fh.close() return (sums) print(total_salary('test.txt'))
[ "noreply@github.com" ]
noreply@github.com
93e57d2c77d07d9aed1f2c455f9e6ead7e2746ae
621070139978d383f95203aaf994ba8ee8814fcc
/brewwolf/rate_beer/migrations/0003_auto_20191225_1931.py
67436c421a8f252f6975620f23a93ab626a29d48
[]
no_license
AMPER54ND/tin-django
2c0022653d8c7a455ce2bd9a5425f14a45990393
90aa56abbf412f809d978cff8d1bb121744a4379
refs/heads/master
2020-11-29T15:56:20.785884
2020-01-07T15:18:52
2020-01-07T15:18:52
230,158,346
0
0
null
null
null
null
UTF-8
Python
false
false
361
py
# Generated by Django 3.0 on 2019-12-25 19:31 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('rate_beer', '0002_auto_20191212_0116'), ] operations = [ migrations.RenameField( model_name='beer', old_name='creator', new_name='owner', ), ]
[ "btmacd@gmail.com" ]
btmacd@gmail.com
e0b5ca9db7e40e9b5e0260f2d584aa234eb16f94
cb2a40b70bc21d0057c96ddb2c86edceffe19707
/payments/migrations/0011_auto_20180104_1301.py
259d5612830139f25d17956bd53eef9cb226afa7
[]
no_license
rebkwok/pipsevents
ceed9f420b08cd1a3fa418800c0870f5a95a4067
c997349a1b4f3995ca4bb3a897be6a73001c9810
refs/heads/main
2023-08-09T14:11:52.227086
2023-07-27T20:21:01
2023-07-27T20:21:01
29,796,344
1
1
null
2023-09-13T14:32:16
2015-01-24T23:53:34
Python
UTF-8
Python
false
false
697
py
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2018-01-04 13:01 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('payments', '0010_auto_20180102_1130'), ] operations = [ migrations.AlterField( model_name='paypalblocktransaction', name='invoice_id', field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AlterField( model_name='paypalblocktransaction', name='transaction_id', field=models.CharField(blank=True, max_length=255, null=True), ), ]
[ "rebkwok@gmail.com" ]
rebkwok@gmail.com
ea3767f48063c198e4644402f4f8bd10e8f8c404
5683e0be45bbd4c0eff0bc143e1fabb39e3dd2d1
/data_bootstrap/management/commands/bootstrap.py
63aa966cbb00559c06f1852f44fddc334c1e4161
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
permissive
SteveWaweru/mfl_api
be1e6b24a039553447dc6fdc23b588c4a6756a8f
695001fb48cb1b15661cd480831ae33fe6374532
refs/heads/master
2023-05-29T04:27:35.421574
2021-10-27T06:07:10
2021-10-27T06:07:10
205,343,934
0
5
MIT
2023-05-15T00:38:30
2019-08-30T08:54:14
Python
UTF-8
Python
false
false
734
py
import os import glob from django.core.management import BaseCommand from ...bootstrap import process_json_file class Command(BaseCommand): def add_arguments(self, parser): # Positional arguments parser.add_argument('data_file', nargs='+', type=str) def handle(self, *args, **options): for suggestion in options['data_file']: # if it's just a simple json file if os.path.exists(suggestion) and os.path.isfile(suggestion): process_json_file(suggestion) else: # check if it's a glob for filename in glob.glob(suggestion): process_json_file(filename) self.stdout.write("Done loading")
[ "marika@savannahinformatics.com" ]
marika@savannahinformatics.com
41719d1f84a14e2c8c31ca71d64fb6fe025054a3
40c6fa589a0dfe88e82f8bd969cd5ef0ed04f303
/SWEA/D2/1954.py
6f69fcd9fca262d0e6c5087f16a45514a8d6b3b2
[]
no_license
EHwooKim/Algorithms
7d8653e55a491f3bca77a197965f15792f7ebe47
5db0a22b9dc0ba9a30bb9812c54d2d5ecec1676b
refs/heads/master
2021-08-20T04:05:09.967910
2021-06-15T07:54:17
2021-06-15T07:54:17
197,136,680
0
2
null
2021-01-08T05:51:37
2019-07-16T06:46:57
Python
UTF-8
Python
false
false
751
py
T = int(input()) for t in range(1, T + 1): print(f'#{t}') N = int(input()) i = j = 0 min_num = 0 max_num = N - 1 count = 1 result = [[0]*N for i in range(N)] while count <= N**2 - 1: while j < max_num: result[i][j] = count j += 1 count += 1 while i < max_num: result[i][j] = count i += 1 count += 1 max_num -= 1 while j > min_num: result[i][j] = count j -= 1 count += 1 min_num += 1 while i > min_num: result[i][j] = count i -= 1 count +=1 result[i][j] = count for n in range(N): print(*result[n], sep = ' ')
[ "ehwoo0707@naver.com" ]
ehwoo0707@naver.com
a2efb56dab315b04b0175314bda7483e3137b35a
b08f5367ffd3bdd1463de2ddc05d34cbfba6796e
/search/search_missing_among_billions.py
89e090a9dfd46719bbba7f53ba780a4de22f17eb
[]
no_license
uohzxela/fundamentals
cb611fa6c820dc8643a43fd045efe96bc43ba4ed
6bbbd489c3854fa4bf2fe73e1a2dfb2efe4aeb94
refs/heads/master
2020-04-04T03:56:44.145222
2018-04-05T01:08:14
2018-04-05T01:08:14
54,199,110
0
0
null
null
null
null
UTF-8
Python
false
false
1,038
py
''' create an array of 2^16 32-bit integers for every integer in the file, take its 16 most significant bits to index into this array and increment count since the file contains less than 2^32 numbers, there must be one entry in the array that is less than 2^16 this tells us that there is at least one integer which has those upper bits and is not in the file in the second pass, we focus only on the integers whose leading 16 bits match the one we have found and use a bit array of size 2^16 to identify a missing address ''' def search(file): count = [0 for i in xrange(2^16)] for e in file: count[e >> 16] += 1 for i in xrange(len(count)): c = count[i] bitset = [False for i in xrange(2^16)] if c < 2^16: for e in file: if e >> 16 == i: ''' 2^16-1 is used to mask off the upper 16 bits so that only the lower 16 bits can be obtained why minus 1? e.g. 2^4 = 10000, 2^4-1 = 01111 ''' bitset[2^16-1 & e] = True for j in xrange(2^16): if not bitset[j]: return i << 16 | j
[ "uohzxela@gmail.com" ]
uohzxela@gmail.com
e8da1751379981edada6b01f73513a0670fac6bd
f15620243d86981982ac3f79839fc5224a5a2adf
/__main__.py
a14001cb1571124598d6c1a7f8ae6aab9654a3b0
[ "Unlicense" ]
permissive
w73pa/kivy-calc
6f47866993e78101fad56fd230567728a2f493f7
1284d5e6ecca7a537c2b5391da43596c7bf2ffce
refs/heads/master
2016-09-06T07:57:52.182411
2013-11-05T19:53:46
2013-11-05T19:53:46
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,100
py
from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.properties import * class Calculator(BoxLayout): wip = BooleanProperty(False) display = ObjectProperty(None) info = ObjectProperty(None) def append(self, c): if self.wip: self.display.text += c else: self.display.text = c self.wip = True def clr(self): self.wip = False self.display.text = '0' def ce(self): if self.wip: self.display.text = self.display.text[:-1] def compute(self): self.wip = False try: # multiply the expression with 1.0 to force a float operation expression = '1.0 * {0}'.format(self.display.text) result = eval(expression) self.info.text = self.display.text + '=' self.display.text = '{0}'.format(result) except Exception as e: self.display.text = 'Error: {0}'.format(e) class Calc(App): def build(self): return Calculator() if __name__ == "__main__": Calc().run()
[ "bernd@gauweiler.net" ]
bernd@gauweiler.net
be823ef9a397bb6adc46c4212db7e1c05d19effa
afe50e43fcdcda9bc8ab3d48d8e46dfd8e3b40a8
/django_env/bin/pip
f7fda958f777a5249a24a98774f9b5e6e659f79c
[]
no_license
astazja/Opti
79ef7cc9f89191a2b1b079765c62c3744827d163
c4792dc5e9b9da4fa86e9396d05e5222cdd134e4
refs/heads/master
2022-12-10T10:36:30.629227
2020-09-07T07:52:46
2020-09-07T07:52:46
293,458,585
0
0
null
null
null
null
UTF-8
Python
false
false
403
#!/home/kasia/coderslab/OptiKurier/django_env/bin/python # EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip' __requires__ = 'pip==19.0.3' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('pip==19.0.3', 'console_scripts', 'pip')() )
[ "katarzyna@pacewi.cz" ]
katarzyna@pacewi.cz
9124041deaeabe8651514004072aaac126543069
a36f2bea040d5b2da1da3af6162008cdb0b9dcea
/ADXL345.py
0fd034e277a4a36fd67735a6ee245bb439accd33
[]
no_license
omar-abdelwahab2/cpsc359-4
5ef11823d910d638269441c25e58a900795b1ae9
cec4643cf8dee755a3799c0714edf7e742744c9d
refs/heads/master
2021-08-23T17:50:34.354969
2017-12-05T23:59:22
2017-12-05T23:59:22
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,254
py
''' class: ADXL345 Purpose: This class is used to communicate through the SMbus and collect information from the accelerometer. Methods: Constants: These constants are used throughout the code of the ADXL345 class and have been provided by the manufacturer. __init__: constructor for the ADXL345 begin: Used to check that the accelerometer is connected properly to pi and the explorer hat and that eveything is communicating properly to each other. write_register: takes a value and gives it to the accelerometer through smbus methods while making sure to open and close lines of communication properly read_register: similar to previous method except it returns a value from the ADXL345 but it needs a register to be given to know which one to read from values for used registers are defined in the constants at the top of the class. read_16: used to read a word instead of just a byte by reading a byte, shifting it to the higher bits then reading another byte. get_x, get_y, get_z: returns properly formatted data from the accelerometer with the length of a word for each of the x, y, and z axes respectively. ''' import mySmbus class ADXL345: ADXL345_ADDRESS = 0x53 # Assumes ALT address pin low ADXL345_REG_DEVID = 0x00 # Device ID ADXL345_REG_POWER_CTL = 0x2D # Power-saving features control ADXL345_REG_DATAX0 = 0x32 # X-axis data 0 ADXL345_REG_DATAY0 = 0x34 # Y-axis data 0 ADXL345_REG_DATAZ0 = 0x36 # Z-axis data 0 def __init__(self): self.mySmbus = mySmbus # self.bus = smbus.SMBus() self.BUS_ID = 1 self.range = 0 def begin(self): # check connection self.mySmbus.my_my_init() device_id = self.read_register(self.ADXL345_REG_DEVID) if device_id != 0xe5: # No ADXL345 detected ... return false #print(format(device_id, '02x')) # print(device_id) return False # enable measurements self.write_register(self.ADXL345_REG_POWER_CTL, 0x08) self.mySmbus.my_my_uninit() return True def write_register(self, reg, value): # self.bus.open(self.BUS_ID) self.mySmbus.my_my_init() self.mySmbus.my_i2c_write_byte_data(self.ADXL345_ADDRESS, reg, value) self.mySmbus.my_my_uninit() # self.bus.close() def read_register(self, reg): # self.bus.open(self.BUS_ID) temp = self.mySmbus.my_my_init() reply = self.mySmbus.my_i2c_read_byte_data(self.ADXL345_ADDRESS, reg) self.mySmbus.my_my_uninit() # self.bus.close() return reply def read_16(self, reg): # self.bus.open(self.BUS_ID) self.mySmbus.my_my_init() reply = self.mySmbus.my_i2c_read_word_data(self.ADXL345_ADDRESS, reg) self.mySmbus.my_my_uninit() # self.bus.close() return reply def get_x(self): return self.read_16(self.ADXL345_REG_DATAX0) def get_y(self): return self.read_16(self.ADXL345_REG_DATAY0) def get_z(self): return self.read_16(self.ADXL345_REG_DATAZ0)
[ "baraka.am@gmail.com" ]
baraka.am@gmail.com
fdb02bf66446c83561f10691d239c3aad88bb1b7
09efdf48ca3444c4020dfac88000e4cf182db2e7
/Basic Programs/menu.py
2033960b26c6d31422418cbdc8eee029268c8ea3
[]
no_license
himanij11/Python---Basic-Programs
1aac3a1d0caccd2bde0d6cf067a70fb9427476e6
2f9a92bbd1fe1530f26027d24685bc927109b14e
refs/heads/master
2020-11-24T15:04:37.270439
2019-12-15T15:28:40
2019-12-15T15:28:40
228,207,045
0
0
null
null
null
null
UTF-8
Python
false
false
1,078
py
#menu driven for even,palindrome,armstrong def even(n): if(n%2==0): print("{} is an even number.".format(n)) else: print("{} is not an even no.".format(n)) def palindrome(n): temp=n rev=0 while n!=0: a=n%10 rev=rev*10+a n=int(n/10) if temp==rev: print("{} is a palindrome number.".format(temp)) else: print("{} is not a palindrome number.".format(temp)) def armstrong(n): temp=n sum=0 while n!=0: a=n%10 sum=sum+a*a*a n=int(n/10) if temp==sum: print("{} is a armstrong number.".format(temp)) else: print("{} is not an armstrong number.".format(temp)) n=int(input("enter n:")) ch=int(input("1.Even no \n2.Palindrome \n3.Armstrong \n4.Exit \nEnter choice=")) while ch!=4: if ch==1: even(n) elif ch==2: palindrome(n) else: armstrong(n) n=int(input("enter n:")) ch=int(input("1.Even no \n2.Palindrome \n3.Armstrong \n4.Exit \nEnter choice="))
[ "himanij2451@gmail.com" ]
himanij2451@gmail.com
4c17a2fd6c5aae776b17d9474dacb25c0396c160
738aedb8035e49951f83ce3f4291eee149cad5fb
/OB Damage - Li-Hopfield Model/All the code/Damage Trials/MC-1col_20_2D.py
83d3c9d36ca88bf3d357b7ab8bca600c998a336b
[]
no_license
jkberry07/OB_PD_Model
fb453303bfa64c1a3a43c7d81d2b5373950e1f4d
1ce30205354dc30cab4673e406988bfa76390238
refs/heads/master
2022-11-21T09:39:09.692654
2020-07-25T23:25:11
2020-07-25T23:25:11
282,358,721
0
0
null
null
null
null
UTF-8
Python
false
false
24,848
py
# -*- coding: utf-8 -*- """ Created on Tue Dec 18 13:38:32 2018 @author: wmmjk """ #This one does the damage to each of the granule cells (columns of H0) #Olfactory Bulb Model a la Li/Hopfield and Li/Hertz #Translated from Avinash's Matlab code #This one I have the initial condition in odeint as the equilibrium at rest plus noise #Change Log import numpy as np import scipy.linalg as lin import scipy.stats as stats import scipy.signal as signal from scipy.optimize import fsolve from scipy.integrate import solve_ivp import time import os import sys sys.path.append(os.getcwd()) tm1 = time.time() Nmitral0 = 20 #define network size in parent process #####Chapter 1 - The Output functions######################## def cellout(x,s1,s2,th): g = np.zeros(np.shape(x)) for i in np.r_[0:np.size(x)]: if x[i] < th: g[i] = s2 + s2*np.tanh((x[i]-th)/s2) else: g[i] = s2 + s1*np.tanh((x[i]-th)/s1) return g def celldiff(x,s1,s2,th): #Returns the differentiated outputs in a diagonal matrix for calculating #the matrix A Gdiff = np.zeros((np.size(x),np.size(x))) for i in np.r_[0:np.size(x)]: if x[i] < th: Gdiff[i,i] = (1 - (np.tanh((x[i]-th)/s2))**2) else: Gdiff[i,i] = (1 - (np.tanh((x[i]-th)/s1))**2) return Gdiff ######Chapter 2 - The Equations########################### def equi(x,Ndim,Nmitral,Sx,Sx2,Sy,Sy2,th,alpha,t_inh,H0,W0,P_odor,Ib,Ic,dam): F = np.zeros(Ndim) gx = cellout(x[0:Nmitral],Sx,Sx2,th) #calculate output from internal state gy = cellout(x[Nmitral:],Sy,Sy2,th) #for mitral and granule cells respectively F[0:Nmitral] = dam*(np.ravel(-np.dot(H0,gy)) - np.ravel(alpha*x[0:Nmitral]) + np.ravel(Ib) + \ np.ravel(P_odor*(180-t_inh))) - np.ravel(alpha*x[0:Nmitral]) #180 is 25 ms before the end of inhale F[Nmitral:] = np.ravel(np.dot(W0,gx)) - np.ravel(alpha*x[Nmitral:]) + np.ravel(Ic) return F def diffeq(t,x,Nmitral,Ngranule,Ndim,lastnoise,noise,noisewidth,noiselevel,\ t_inh,t_exh,exh_rate,alpha,Sy,Sy2,Sx,Sx2,th,H0,W0,P_odor,Ic,Ib,dam): y = x dydt = np.zeros(np.shape(y)) for i in np.r_[0:Nmitral]: if t < t_inh: dydt[i] = dam[i]*((t-lastnoise[i])*noise[i] - np.dot(np.reshape(H0[i,:],\ (1,Ngranule)), cellout(y[Nmitral:],Sy,Sy2,th)) + \ Ib[i]) - alpha*y[i] elif t < t_exh: dydt[i] = dam[i]*((t-lastnoise[i])*noise[i] - np.dot(np.reshape(H0[i,:],\ (1,Ngranule)), cellout(y[Nmitral:],Sy,Sy2,th)) + \ Ib[i] + P_odor[i]*(t-t_inh)) - alpha*y[i] else: dydt[i] = dam[i]*((t-lastnoise[i])*noise[i] - np.dot(np.reshape(H0[i,:],\ (1,Ngranule)), cellout(y[Nmitral:],Sy,Sy2,th)) + \ Ib[i] + P_odor[i]*(t-t_inh)*np.exp(-exh_rate*(t-t_exh))) - alpha*y[i] for i in np.r_[Nmitral:Ndim]: dydt[i] = (t-lastnoise[i])*noise[i] + np.dot(np.reshape(\ W0[i-Nmitral,:],(1,Nmitral)),cellout(y[:Nmitral],Sx,Sx2,th)) - \ alpha*y[i] + Ic[i-Nmitral] for i in np.r_[0:Ndim]: if (t-lastnoise[i])/noisewidth > .8 + np.random.rand(): lastnoise[i] = t noise[i] = noiselevel*(2*np.random.rand() -1) #to get noise btwn #-noiselevel and +nslvl return dydt #########Chapter3 - The solver############################## def olf_bulb_10(Nmitral,H_in,W_in,P_odor_in,dam): # Nmitral = 10 #number of mitral cells Ngranule = np.copy(Nmitral) #number of granule cells pg. 383 of Li/Hop Ndim = Nmitral+Ngranule #total number of cells t_inh = 25 ; # time when inhalation starts t_exh = 205; #time when exhalation starts finalt = 395; # end time of the cycle #y = zeros(ndim,1); Sx = 1.43 #Sx,Sx2,Sy,Sy2 are parameters for the activation functions Sx2 = 0.143 Sy = 2.86 #These are given in Li/Hopfield pg 382, slightly diff in her thesis Sy2 = 0.286 th = 1 #threshold for the activation function tau_exh = 33.3333; #Exhale time constant, pg. 382 of Li/Hop exh_rate = 1/tau_exh alpha = .15 #decay rate for the neurons #Li/Hop have it as 1/7 or .142 on pg 383 P_odor0=np.zeros((Nmitral,1)) #odor pattern, no odor H0 = H_in #weight matrix: to mitral from granule W0 = W_in #weights: to granule from mitral Ib = np.ones((Nmitral,1))*.243 #initial external input to mitral cells Ic = np.ones((Ngranule,1))*.1 #initial input to granule cells, these values are #given on pg 382 of Li/Hop signalflag = 1 # 0 for linear output, 1 for activation function noise = np.zeros((Ndim,1)) #noise in inputs noiselevel = .00143 noisewidth = 7 #noise correlation time, given pg 383 Li/Hop as 9, but 7 in thesis lastnoise = np.zeros((Ndim,1)) #initial time of last noise pule #****************************************************************************** #CALCULATE FIXED POINTS #Calculating equilibrium value with no input rest0 = np.zeros((Ndim,1)) restequi = fsolve(lambda x: equi(x,Ndim,Nmitral,Sx,Sx2,Sy,Sy2,th,alpha,\ t_inh,H0,W0,P_odor0,Ib,Ic,dam),rest0) #about 20 ms to run this np.random.seed(seed=23) #init0 = restequi+np.random.rand(Ndim)*.00143 #initial conditions plus some noise #for no odor input init0 = restequi+np.random.rand(Ndim)*.00143 #initial conditions plus some noise #for no odor input np.random.seed() #Now calculate equilibrium value with odor input lastnoise = lastnoise + t_inh - noisewidth #initialize lastnoise value #But what is it for? to have some #kind of correlation in the noise #find eigenvalues of A to see if input produces oscillating signal xequi = fsolve(lambda x: equi(x,Ndim,Nmitral,Sx,Sx2,Sy,Sy2,th,alpha,\ t_inh,H0,W0,P_odor_in,Ib,Ic,dam),rest0) #equilibrium values with some input, about 20 ms to run #****************************************************************************** #CALCULATE A AND DETERMINE EXISTENCE OF OSCILLATIONS diffgy = celldiff(xequi[Nmitral:],Sy,Sy2,th) diffgx = celldiff(xequi[0:Nmitral],Sx,Sx2,th) H1 = np.dot(H0,diffgy) W1 = np.dot(W0,diffgx) #intermediate step in constructing A A = np.dot(H1,W1) #Construct A dA,vA = lin.eig(A) #about 20 ms to run this #Find eigenvalues of A diff = (1j)*(dA)**.5 - alpha #criteria for a growing oscillation negsum = -(1j)*(dA)**.5 - alpha #Same diff_re = np.real(diff) #Take the real part negsum_re = np.real(negsum) #do an argmax to return the eigenvalue that will cause the fastest growing oscillations #Then do a spectrograph to track the growth of the associated freq through time indices = np.where(diff_re>0) #Find the indices where the criteria is met indices2 = np.where(negsum_re>0) #eigenvalues that could lead to growing oscillations # candidates = np.append(np.real((dA[indices])**.5),np.real((dA[indices2])**.5)) largest = np.argmax(diff_re) check = np.size(indices) check2 = np.size(indices2) if check==0 and check2==0: # print("No Odor Recognized") dominant_freq = 0 else: dominant_freq = np.real((dA[largest])**.5)/(2*np.pi) #find frequency of the dominant mode #Divide by 2pi to get to cycles/ms # print("Odor detected. Eigenvalues:",dA[indices],dA[indices2],\ # "\nEigenvectors:",vA[indices],vA[indices2],\ # "\nDominant Frequency:",dominant_freq) #************************************************************************* #SOLVE DIFFERENTIAL EQUATIONS TO GET INPUT AND OUTPUTS AS FN'S OF t #differential equation to solve teval = np.r_[0:finalt] #solve the differential equation sol = solve_ivp(lambda t,y: diffeq(t,y,Nmitral,Ngranule,Ndim,lastnoise,\ noise,noisewidth,noiselevel, t_inh,t_exh,exh_rate,alpha,Sy,\ Sy2,Sx,Sx2,th,H0,W0,P_odor_in,Ic,Ib,dam),\ [0,395],init0,t_eval = teval,method = 'RK45') t = sol.t y = sol.y y = np.transpose(y) yout = np.copy(y) #convert signal into output signal given by the activation fn if signalflag ==1: for i in np.arange(np.size(t)): yout[i,:Nmitral] = cellout(y[i,:Nmitral],Sx,Sx2,th) yout[i,Nmitral:] = cellout(y[i,Nmitral:],Sy,Sy2,th) #solve diffeq for P_odor = 0 #first, reinitialize lastnoise & noise noise = np.zeros((Ndim,1)) lastnoise = np.zeros((Ndim,1)) lastnoise = lastnoise + t_inh - noisewidth sol0 = sol = solve_ivp(lambda t,y: diffeq(t,y,Nmitral,Ngranule,Ndim,lastnoise,\ noise,noisewidth,noiselevel, t_inh,t_exh,exh_rate,alpha,Sy,\ Sy2,Sx,Sx2,th,H0,W0,P_odor0,Ic,Ib,dam),\ [0,395],init0,t_eval = teval,method = 'RK45') y0 = sol0.y y0 = np.transpose(y0) y0out = np.copy(y0) #convert signal into output signal given by the activation fn if signalflag ==1: for i in np.arange(np.size(t)): y0out[i,:Nmitral] = cellout(y0[i,:Nmitral],Sx,Sx2,th) y0out[i,Nmitral:] = cellout(y0[i,Nmitral:],Sy,Sy2,th) #***************************************************************************** #SIGNAL PROCESSING #Filtering the signal - O_mean: Lowpass fitered signal, under 20 Hz #S_h: Highpass filtered signal, over 20 Hz fs = 1/(.001*(t[1]-t[0])) #sampling freq, converting from ms to sec f_c = 15/fs # Cutoff freq at 20 Hz, written as a ratio of fc to sample freq flter = np.sinc(2*f_c*(t - (finalt-1)/2))*np.blackman(finalt) #creating the #windowed sinc filter #centered at the middle #of the time data flter = flter/np.sum(flter) #normalize hpflter = -np.copy(flter) hpflter[int((finalt-1)/2)] += 1 #convert the LP filter into a HP filter Sh = np.zeros(np.shape(yout)) Sl = np.copy(Sh) Sl0 = np.copy(Sh) Sbp = np.copy(Sh) for i in np.arange(Ndim): Sh[:,i] = np.convolve(yout[:,i],hpflter,mode='same') Sl[:,i] = np.convolve(yout[:,i],flter,mode='same') Sl0[:,i] = np.convolve(y0out[:,i],flter,mode='same') #find the oscillation period Tosc (Tosc must be greater than 5 ms to exclude noise) Tosc0 = np.zeros(np.size(np.arange(5,50))) for i in np.arange(5,50): Sh_shifted=np.roll(Sh,i,axis=0) Tosc0[i-5] = np.sum(np.diagonal(np.dot(np.transpose(Sh[:,:Nmitral]),Sh_shifted[:,:Nmitral]))) #That is, do the correlation matrix (time correlation), take the diagonal to #get the autocorrelations, and find the max Tosc = np.argmax(Tosc0) Tosc = Tosc + 5 f_c2 = 1000*(1.3/Tosc)/fs #Filter out components with frequencies higher than this #to get rid of noise effects in cross-correlation #times 1000 to get units right flter2 = np.sinc(2*f_c2*(t - (finalt-1)/2))*np.blackman(finalt) flter2 = flter2/np.sum(flter2) for i in np.arange(Ndim): Sbp[:,i] = np.convolve(Sh[:,i],flter2,mode='same') #CALCULATE THE DISTANCE MEASURES #calculate phase via cross-correlation with each cell phase = np.zeros(Nmitral) for i in np.arange(1,Nmitral): crosscor = signal.correlate(Sbp[:,0],Sbp[:,i]) tdiff = np.argmax(crosscor)-(finalt-1) phase[i] = tdiff/Tosc * 2*np.pi #Problem with the method below is that it will only give values from 0 to pi #for i in np.arange(1,Nmitral): # phase[i]=np.arccos(np.dot(Sbp[:,0],Sbp[:,i])/(lin.norm(Sbp[:,0])*lin.norm(Sbp[:,i]))) OsciAmp = np.zeros(Nmitral) Oosci = np.copy(OsciAmp)*0j Omean = np.zeros(Nmitral) for i in np.arange(Nmitral): OsciAmp[i] = np.sqrt(np.sum(Sh[125:250,i]**2)/np.size(Sh[125:250,i])) Oosci[i] = OsciAmp[i]*np.exp(1j*phase[i]) Omean[i] = np.average(Sl[:,i] - Sl0[:,i]) Omean = np.maximum(Omean,0) Ooscibar = np.sqrt(np.dot(Oosci,np.conjugate(Oosci)))/Nmitral #can't just square b/c it's complex Omeanbar = np.sqrt(np.dot(Omean,Omean))/Nmitral maxlam = np.max(np.abs(np.imag(np.sqrt(dA)))) return yout,y0out,Sh,t,OsciAmp,Omean,Oosci,Omeanbar,Ooscibar,dominant_freq,maxlam def dmg_seed_20_2D(colnum): #INITIALIZING STUFF Nmitral = 20 Ngranule = np.copy(Nmitral) #number of granule cells pg. 383 of Li/Hop Ndim = Nmitral+Ngranule #total number of cells # t_inh = 25 ; # time when inhalation starts # t_exh = 205; #time when exhalation starts # Ndamagetotal = Nmitral*2 + 1 #number of damage steps Ndamage = 6 Ncols = int(Nmitral/2) #define number of columns to damage finalt = 395; # end time of the cycle #y = zeros(ndim,1); P_odor0=np.zeros((Nmitral,1)) #odor pattern, no odor P_odor1 = P_odor0 + .00429 #Odor pattern 1 # P_odor2 = 1/70*np.array([.6,.5,.5,.5,.3,.6,.4,.5,.5,.5]) # P_odor3 = 4/700*np.array([.7,.8,.5,1.2,.7,1.2,.8,.7,.8,.8]) #control_odor = control_order + .00429 #control_odor = np.zeros((Nmitral,1)) #odor input for adaptation #controllevel = 1 #1 is full adaptation H0 = np.zeros((Nmitral,Ngranule)) #weight matrix: to mitral from granule W0 = np.zeros((Ngranule,Nmitral)) #weights: to granule from mitral H0 = np.load('H0_20_2D_50Hz.npy') #load weight matrix W0 = np.load('W0_20_2D_50Hz.npy') #load weight matrix #H0 = H0 + H0*np.random.rand(np.shape(H0)) #W0 = W0+W0*np.random.rand(np.shape(W0)) M = 5 #average over 5 trials for each level of damage #initialize iterative variables d1it,d2it,d3it,d4it = np.zeros(M),np.zeros(M),np.zeros(M),np.zeros(M) IPRit,IPR2it,pnit = np.zeros(M),np.zeros(M),np.zeros(M) frequencyit = np.zeros(M) pwrit = np.zeros(M) yout2,Sh2 = np.zeros((finalt,Ndim)),np.zeros((finalt,Ndim)) psi = np.copy(Sh2[:,:Nmitral]) #initialize quantities to be returned at end of the process dmgpct1 = np.zeros(Ncols*(Ndamage-1)+1) eigfreq1 = np.zeros(Ncols*(Ndamage-1)+1) d11 = np.zeros(Ncols*(Ndamage-1)+1) d21 = np.zeros(Ncols*(Ndamage-1)+1) d31 = np.zeros(Ncols*(Ndamage-1)+1) d41 = np.zeros(Ncols*(Ndamage-1)+1) pwr1 = np.zeros(Ncols*(Ndamage-1)+1) IPR1 = np.zeros(Ncols*(Ndamage-1)+1) IPR2 = np.zeros(Ncols*(Ndamage-1)+1) pn1 = np.zeros(Ncols*(Ndamage-1)+1) freq1 = np.zeros(Ncols*(Ndamage-1)+1) cell_act = np.zeros((finalt,Ndim,Ncols*(Ndamage-1)+1)) # spread = -1 #start at -1 so that the first damage level has a spread of 0 radius damage = 0 dam = np.ones(Nmitral) #Get the base response first Omean1,Oosci1,Omeanbar1,Ooscibar1 = np.zeros((Nmitral,M))+0j,\ np.zeros((Nmitral,M))+0j,np.zeros(M)+0j,np.zeros(M)+0j for m in np.arange(M): yout,y0out,Sh,t,OsciAmp1,Omean1[:,m],Oosci1[:,m],Omeanbar1[m],\ Ooscibar1[m],freq0,maxlam = olf_bulb_10(Nmitral,H0,W0,P_odor1,dam) counter = 0 #to get the right index for each of the measures damage = 0 dam[colnum]+=.2 # so that first level is zero damage for col in range(Ncols): cols = int(np.mod(colnum+col,Nmitral)) for lv in np.arange(Ndamage): #reinitialize all iterative variables to zero (really only need to do for distance measures, but good habit) d1it,d2it,d3it,d4it = np.zeros(M),np.zeros(M),np.zeros(M),np.zeros(M) IPRit,IPR2it,pnit = np.zeros(M),np.zeros(M),np.zeros(M) frequencyit = np.zeros(M) pwrit = np.zeros(M) if not(lv==0 and cols!=colnum): #if it's the 0th level for any but the original col, skip dam[cols] = dam[cols] - 0.2 dam[dam<1e-10] = 0 damage = np.sum(1-dam) for m in np.arange(M): #Then get respons of damaged network yout2[:,:],y0out2,Sh2[:,:],t2,OsciAmp2,Omean2,Oosci2,Omeanbar2,\ Ooscibar2,freq2,grow_eigs2 = olf_bulb_10(Nmitral,H0,W0,P_odor1,dam) #calculate distance measures print(time.time()-tm1) for i in np.arange(M): d1it[m] += 1-Omean1[:,m].dot(Omean2)/(lin.norm(Omean1[:,m])*lin.norm(Omean2)) d2it[m] += 1-lin.norm(Oosci1[:,m].dot(np.conjugate(Oosci2)))/(lin.norm(Oosci1[:,m])*lin.norm(Oosci2)) d3it[m] += (Omeanbar1[m] - Omeanbar2)/(Omeanbar1[m] + Omeanbar2) d4it[m] += np.real((Ooscibar1[m] - Ooscibar2)/(Ooscibar1[m] + Ooscibar2)) d1it[m] = d1it[m]/M d2it[m] = d2it[m]/M d3it[m] = d3it[m]/M d4it[m] = d4it[m]/M #calculate spectral density and "wave function" to get average power and IPR P_den = np.zeros((501,Nmitral)) #only calculate the spectral density from for i in np.arange(Nmitral): #t=125 to t=250, during the main oscillations f, P_den[:,i] = signal.periodogram(Sh2[125:250,i],nfft=1000,fs=1000) psi = np.zeros(Nmitral) for p in np.arange(Nmitral): psi[p] = np.sum(P_den[:,p]) psi = psi/np.sqrt(np.sum(psi**2)) psi2 = np.copy(OsciAmp2) psi2 = psi2/np.sqrt(np.sum(psi2**2)) maxAmp = np.max(OsciAmp2) pnit[m] = len(OsciAmp2[OsciAmp2>maxAmp/2]) IPRit[m] = 1/np.sum(psi**4) IPR2it[m] = 1/np.sum(psi2**4) pwrit[m] = np.sum(P_den)/Nmitral #get the frequency according to the adiabatic analysis maxargs = np.argmax(P_den,axis=0) argf = stats.mode(maxargs[maxargs!=0]) frequencyit[m] = f[argf[0][0]] # print(cols) # print(time.time()-tm1) # # print('level',lv) #Get the returned variables for each level of damage dmgpct1[counter]=damage/Nmitral IPR1[counter] = np.average(IPRit) #Had to do 1D list, so pwr1[counter] = np.average(pwrit) #it goes column 0 damage counterl freq1[counter]=np.average(frequencyit) #0,1,2,3,4...Ndamage-1, then #col 1 damage level 0,1,2... # IPRsd[counter]=np.std(IPRit) # pwrsd[counter]=np.std(pwrit) # freqsd[counter]=np.std(frequencyit) IPR2[counter] = np.average(IPR2it) pn1[counter] = np.average(pnit) d11[counter]= np.average(d1it) d21[counter] = np.average(d2it) d31[counter] = np.average(d3it) d41[counter] = np.average(d4it) # d1sd[counter] = np.std(d1it) # d2sd[counter] = np.std(d2it) # d3sd[counter]=np.std(d3it) # d4sd[counter]=np.std(d4it) eigfreq1[counter] = np.copy(freq2) if (colnum == 0 or colnum==int(Nmitral/2)): cell_act[:,:,lv]=np.copy(yout2) counter+=1 return dmgpct1,eigfreq1,d11,d21,d31,d41,pwr1,IPR1,IPR2,pn1,freq1,cell_act #save all the data #****************************************************************************** Ndamage0 = 21 #Recording 0 level damage, too, so it will be 21 levels of damage counterl = 0 #used to be an iterative variable, but now just a place holder if __name__ == '__main__': # dmgpct,eigfreq = np.zeros((Ndamage,Nmitral)),np.zeros((Ndamage,Nmitral)) # d1, d1sd = np.zeros((Ndamage,Nmitral)),np.zeros((Ndamage,Nmitral)) # d2,d2sd = np.zeros((Ndamage,Nmitral)),np.zeros((Ndamage,Nmitral)) # d3,d3sd = np.zeros((Ndamage,Nmitral)),np.zeros((Ndamage,Nmitral)) # d4,d4sd = np.zeros((Ndamage,Nmitral)),np.zeros((Ndamage,Nmitral)) # pwr,pwrsd = np.zeros((Ndamage,Nmitral)),np.zeros((Ndamage,Nmitral)) # IPR,IPRsd = np.zeros((Ndamage,Nmitral)),np.zeros((Ndamage,Nmitral)) # freq,freqsd = np.zeros((Ndamage,Nmitral)),np.zeros((Ndamage,Nmitral)) # poolsize = np.copy(Nmitral) # Ncolumns = np.copy(Nmitral) Ncolumns = np.copy(Nmitral0) arrayid = int(os.environ["SLURM_ARRAY_TASK_ID"]) dmgpct,eigfreq,d1,d2,d3,d4,pwr,IPR,IPR2,pn,freq,cell_act = dmg_seed_20_2D(arrayid) print(time.time()-tm1) ##************For testing the function********************* #d1,d2,d3,d4 = [0 for i in range(Ndamage*Ncols)],[0 for i in range(Ndamage*Ncols)],[0 for i in range(Ndamage*Ncols)],[0 for i in range(Ndamage*Ncols)] #pwr,IPR,freq= [0 for i in range(Ndamage*Ncols)],[0 for i in range(Ndamage*Ncols)],[0 for i in range(Ndamage*Ncols)] #d1sd,d2sd,d3sd=[0 for i in range(Ndamage*Ncols)],[0 for i in range(Ndamage*Ncols)],[0 for i in range(Ndamage*Ncols)] #d4sd,pwrsd,IPRsd = [0 for i in range(Ndamage*Ncols)],[0 for i in range(Ndamage*Ncols)],[0 for i in range(Ndamage*Ncols)] #freqsd,lock = [0 for i in range(Ndamage*Ncols)],0 #lvl,coln,dmgpct = 1,1,[0 for i in range(Ndamage*Ncols)] #dmg_col_10_1D(lvl,coln,lock,dmgpct,d1,d2,d3,d4,pwr,IPR,freq,d1sd,d2sd,d3sd,d4sd,\ # pwrsd,IPRsd,freqsd) #****************************************************************************** dmgpctfl,d1fl,d2fl,d3fl,d4fl,IPRfl,pwrfl,frequencyfl,eigfreqfl = "dmgpct","d1",\ "d2","d3","d4","IPR","pwr","frequency","eigfreq" # d1sdfl,d2sdfl,d3sdfl,d4sdfl,IPRsdfl,pwrsdfl,frequencysdfl = "d1sd",\ # "d2sd","d3sd","d4sd","IPRsd","pwrsd","frequencysd" IPR2fl,pnfl = "IPR2","pn" pd_type = "_20_" + str(arrayid) np.save(d1fl+pd_type,d1),np.save(d2fl+pd_type,d2),np.save(d3fl+pd_type,d3),np.save(d4fl+pd_type,d4) np.save(IPRfl+pd_type,IPR),np.save(pwrfl+pd_type,pwr) # np.save(d1sdfl+pd_type,d1sd),np.save(d2sdfl+pd_type,d2sd),np.save(d3sdfl+pd_type,d3sd),np.save(d4sdfl+pd_type,d4sd) # np.save(IPRsdfl+pd_type,IPRsd),np.save(pwrsdfl+pd_type,pwrsd) np.save(eigfreqfl+pd_type,eigfreq),np.save(dmgpctfl+pd_type,dmgpct) np.save(frequencyfl+pd_type,freq) np.save(IPR2fl+pd_type,IPR2), np.save(pnfl+pd_type,pn) # np.save(frequencysdfl+pd_type,freqsd) if arrayid == 0 or arrayid==int(Nmitral0/2): np.save("cell_act"+pd_type,cell_act)
[ "noreply@github.com" ]
noreply@github.com
3545e70ca1d77d61f305eff8dd5a893eeea97f75
d2eb6c904536abf3c66ecd3a67d160285ea32bc4
/process_image.py
b2439d8bb9ed8695f23a5906c3e53e4671c56fe5
[]
no_license
peiciwu/CarND-Advanced-Lane-Lines
7f9fe92c13bbec26b6c1bfc2b6bd933f59d99f06
7b2c6933dad2ab19e61cbded0b0e9391c65e45b7
refs/heads/master
2021-01-05T08:58:55.470407
2017-08-23T07:09:36
2017-08-23T07:09:36
99,514,760
0
0
null
null
null
null
UTF-8
Python
false
false
16,740
py
import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg import glob import os import collections from image_processor import ImageProcessor, plotTwo # Global parameters ym_per_pixel = 30/720 # meters per pixel in y dimension xm_per_pixel = 3.7/700 # meters per pixel in x dimension ploty = np.linspace(0, 719, 720) # y range of image num_failed_allowed = 10 # max number of consecutive failed frames num_recent_fits = 10 # max number of the past fits to average # Use window slding to detect lines def run_one_image(fname, plot = False, debug = False): img = mpimg.imread(fname) name = ' (' + os.path.splitext(os.path.basename(fname))[0] + ')' # Pre-process all the images: distort, thresholding, and perspective transform undist = processor.undistort(img) plotTwo((img, undist), ('Original'+name, 'Undistorted'+name)) thresh = processor.thresholding(undist, debug) plotTwo((undist, thresh), ('Undistorted'+name, 'Thresholding'+name)) # For debugging, warp on the undistort image. if debug: processor.perspective_transform(undist, debug) warped = processor.perspective_transform(thresh) plotTwo((thresh, warped), ('Thresholding'+name, 'Warped'+name)) # Use window sliding to find the lines left_fit, right_fit = find_lane_lines_sliding_window(warped, plot) if debug: print(name, ": ", left_fit, ", ", right_fit) result = draw_lane(img, warped, left_fit, right_fit) if plot: plt.title('Detected lane'+name) plt.imshow(result) plt.show(block=True) # Calculate radius_of_curvature curv = (cal_radius_of_curvature(left_fit) + cal_radius_of_curvature(right_fit))/2 draw_radius_of_curvature(result, curv) draw_vehicle_position(result, left_fit, right_fit) if debug: left_fitx = left_fit[0]*ploty**2 + left_fit[1]*ploty + left_fit[2] right_fitx = right_fit[0]*ploty**2 + right_fit[1]*ploty + right_fit[2] diff = right_fitx - left_fitx min_width = np.min(diff) max_width = np.max(diff) cv2.putText(result, 'min_width = ' + str(round(min_width, 3))+' (pixel)',(50,150), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255),2) cv2.putText(result, 'max_width = ' + str(round(max_width, 3))+' (pixel)',(50,200), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255),2) print("min_width: ", min_width) print("max_width: ", max_width) plt.title('Detected lane with info'+name) plt.imshow(result) plt.show(block=True) def run_all_test_images(imageDir, plot = False, debug = False): testFiles = glob.glob(imageDir+'/*.jpg') for fname in testFiles: run_one_image(fname, plot, debug) def find_lane_lines_sliding_window(img, plot=False): # Parameters setting num_windows = 9 window_height = np.int(img.shape[0]/num_windows) margin = 80 # widnow width = 2 * margin min_pixels = 50 # minimum number of pixels found in one window # Create an output image to draw on and visualize the result if plot == True: out_img = np.dstack((img, img, img))*255 # Starting points: The peaks of the histogram at the left half and the right half. histogram = np.sum(img[img.shape[0]//2:,:], axis=0) midpoint = np.int(histogram.shape[0]/2) leftx_current = np.argmax(histogram[:midpoint]) rightx_current = np.argmax(histogram[midpoint:]) + midpoint # X and y positions where the pixels are nonzero nonzero = img.nonzero() nonzeroy = np.array(nonzero[0]) nonzerox = np.array(nonzero[1]) # For pixel found within windows, record the indices to nonzero array left_lane_indices = [] right_lane_indices = [] for window in range(num_windows): # Window boundaries win_y = (img.shape[0] - (window+1)*window_height, img.shape[0] - window*window_height) win_left_x = (leftx_current - margin, leftx_current + margin) win_right_x = (rightx_current - margin, rightx_current + margin) if plot == True: # Draw the windows cv2.rectangle(out_img, (win_left_x[0], win_y[0]), (win_left_x[1], win_y[1]), (0, 255, 0), 2) cv2.rectangle(out_img, (win_right_x[0], win_y[0]), (win_right_x[1], win_y[1]), (0, 255, 0), 2) # Find nonzero pixels within the window nonzero_left_indices = ((nonzeroy >= win_y[0]) & (nonzeroy < win_y[1]) & (nonzerox >= win_left_x[0]) & (nonzerox < win_left_x[1])).nonzero()[0] nonzero_right_indices = ((nonzeroy >= win_y[0]) & (nonzeroy < win_y[1]) & (nonzerox >= win_right_x[0]) & (nonzerox < win_right_x[1])).nonzero()[0] # Record the indices of nonzero pixels left_lane_indices.append(nonzero_left_indices) right_lane_indices.append(nonzero_right_indices) # Move to the next widnow if > minimum pixels found if len(nonzero_left_indices) > min_pixels: leftx_current = np.int(np.mean(nonzerox[nonzero_left_indices])) if len(nonzero_right_indices) > min_pixels: rightx_current = np.int(np.mean(nonzerox[nonzero_right_indices])) # Concatenate the indices array left_lane_indices = np.concatenate(left_lane_indices) right_lane_indices = np.concatenate(right_lane_indices) # Fit a second order polynomial leftx = nonzerox[left_lane_indices] lefty = nonzeroy[left_lane_indices] rightx = nonzerox[right_lane_indices] righty = nonzeroy[right_lane_indices] left_fit = np.polyfit(lefty, leftx, 2) right_fit = np.polyfit(righty, rightx, 2) # Plot the current fitted polynomial if plot == True: # Mark the pixels in the window: left with red, right with blue out_img[nonzeroy[left_lane_indices], nonzerox[left_lane_indices]] = [255, 0, 0] out_img[nonzeroy[right_lane_indices], nonzerox[right_lane_indices]] = [0, 0, 255] plt.imshow(out_img) # Plot the fitted polynomial left_fitx = left_fit[0]*ploty**2 + left_fit[1]*ploty + left_fit[2] right_fitx = right_fit[0]*ploty**2 + right_fit[1]*ploty + right_fit[2] plt.plot(left_fitx, ploty, color='yellow') plt.plot(right_fitx, ploty, color='yellow') plt.xlim(0, img.shape[1]) plt.ylim(img.shape[0], 0) plt.show(block=True) return left_fit, right_fit def find_lane_lines_using_previous_fit(img, left_fit, right_fit, plot=False): # X and y positions where the pixels are nonzero nonzero = img.nonzero() nonzeroy = np.array(nonzero[0]) nonzerox = np.array(nonzero[1]) margin = 100 # widnow width = 2 * margin # Indices within the margin of the polynomial left_lane_indices = ((nonzerox > (left_fit[0]*(nonzeroy**2) + left_fit[1]*nonzeroy + left_fit[2]) - margin) & (nonzerox < (left_fit[0]*(nonzeroy**2) + left_fit[1]*nonzeroy + left_fit[2]) + margin)) right_lane_indices = ((nonzerox > (right_fit[0]*(nonzeroy**2) + right_fit[1]*nonzeroy + right_fit[2]) - margin) & (nonzerox < (right_fit[0]*(nonzeroy**2) + right_fit[1]*nonzeroy + right_fit[2]) + margin)) # Extract left and right line pixel positions leftx = nonzerox[left_lane_indices] lefty = nonzeroy[left_lane_indices] rightx = nonzerox[right_lane_indices] righty = nonzeroy[right_lane_indices] # Fit a second order polynomial left_fit = np.polyfit(lefty, leftx, 2) right_fit = np.polyfit(righty, rightx, 2) if plot == True: # Create an output image to draw on and visualize the result out_img = np.dstack((img, img, img))*255 # Mark the pixels in the window: left with red, right with blue out_img[nonzeroy[left_lane_indices], nonzerox[left_lane_indices]] = [255, 0, 0] out_img[nonzeroy[right_lane_indices], nonzerox[right_lane_indices]] = [0, 0, 255] plt.imshow(out_img) # Generate a polygon to illustrate the search window area left_fitx = left_fit[0]*ploty**2 + left_fit[1]*ploty + left_fit[2] right_fitx = right_fit[0]*ploty**2 + right_fit[1]*ploty + right_fit[2] # And recast the x and y points into usable format for cv2.fillPoly() left_line_window1 = np.array([np.transpose(np.vstack([left_fitx-margin, ploty]))]) left_line_window2 = np.array([np.flipud(np.transpose(np.vstack([left_fitx+margin, ploty])))]) left_line_pts = np.hstack((left_line_window1, left_line_window2)) right_line_window1 = np.array([np.transpose(np.vstack([right_fitx-margin, ploty]))]) right_line_window2 = np.array([np.flipud(np.transpose(np.vstack([right_fitx+margin, ploty])))]) right_line_pts = np.hstack((right_line_window1, right_line_window2)) # window img window_img = np.zeros_like(out_img) # Draw the lane onto the window image cv2.fillPoly(window_img, np.int_([left_line_pts]), (0,255, 0)) cv2.fillPoly(window_img, np.int_([right_line_pts]), (0,255, 0)) result = cv2.addWeighted(out_img, 1, window_img, 0.3, 0) plt.imshow(result) plt.plot(left_fitx, ploty, color='yellow') plt.plot(right_fitx, ploty, color='yellow') plt.xlim(0, img.shape[1]) plt.ylim(img.shape[0], 0) plt.show(block=True) return left_fit, right_fit def draw_lane(img, warped, left_fit, right_fit): warp_zero = np.zeros_like(warped).astype(np.uint8) if img.shape[2] == 3: color_warp = np.dstack((warp_zero, warp_zero, warp_zero)) else: # Images dumped from video have 4 channels. color_warp = np.dstack((warp_zero, warp_zero, warp_zero, warp_zero)) left_fitx = left_fit[0]*ploty**2 + left_fit[1]*ploty + left_fit[2] right_fitx = right_fit[0]*ploty**2 + right_fit[1]*ploty + right_fit[2] # Recast the x and y points into usable format for cv2.fillPoly() pts_left = np.array([np.transpose(np.vstack([left_fitx, ploty]))]) pts_right = np.array([np.flipud(np.transpose(np.vstack([right_fitx, ploty])))]) pts = np.hstack((pts_left, pts_right)) # Draw the lane onto the warped blank image cv2.fillPoly(color_warp, np.int_([pts]), (0,255, 0)) cv2.polylines(color_warp, np.int32([pts_left]), isClosed=False, color=(255, 0, 0), thickness=20) cv2.polylines(color_warp, np.int32([pts_right]), isClosed=False, color=(0, 0, 255), thickness=20) # Warp the blank back to original image space using inverse perspective matrix (Minv) new_warp = cv2.warpPerspective(color_warp, processor.invM, (warped.shape[1], warped.shape[0])) # Combine the result with the original image result = cv2.addWeighted(img, 1, new_warp, 0.3, 0) return result # Define a class to receive the characteristics of each line detection class Line: def __init__(self): # polynomial coefficients for the most recent fit self.current_fit = None # x values of the last n fits of the line self.recent_xfitted = collections.deque(maxlen=num_recent_fits) # polynomial coefficients averaged over the last n iterations self.best_fit = None # radius of curvature of the best fit self.radius_of_curvature = None # frame number in the video self.frame_counter = -1 # number of consecutive failed frames self.num_failed = 0 def add_fit(self, fit, valid_line): self.frame_counter += 1 if not valid_line: self.num_failed += 1 else: self.current_fit = fit fitx = fit[0]*ploty**2 + fit[1]*ploty + fit[2] self.recent_xfitted.append(fitx) avg_fitx = np.average(self.recent_xfitted, axis=0) self.best_fit = np.polyfit(ploty, avg_fitx, 2) self.radius_of_curvature = cal_radius_of_curvature(self.best_fit) def do_slide_window(self): if self.best_fit == None: return True # Start from scratch if self.num_failed >= num_failed_allowed: self.reset() return True return False def reset(self): self.current_fit = None self.best_fit = None self.radius_of_curvature = None self.num_of_faileds = 0 def check_line(self, fit): # Check radius_ofcurvature change curverad = cal_radius_of_curvature(fit) change = abs(curverad - self.radius_of_curvature)/self.radius_of_curvature if change > 0.3: return False # Check diff of polynomial cofficients between \fit and the best fit diff = abs(fit - self.best_fit) if diff[0] > 0.001 or diff[1] > 1 or diff[2] > 100: return False return True def cal_radius_of_curvature(fit): fitx = fit[0]*ploty**2 + fit[1]*ploty + fit[2] # Fit new polynomials to x, y in world space fit_cr = np.polyfit(ploty * ym_per_pixel, fitx * xm_per_pixel, 2) y_eval = np.max(ploty) curverad = ((1 + (2*fit_cr[0]*y_eval*ym_per_pixel + fit_cr[1])**2)**1.5) / np.absolute(2*fit_cr[0]) return curverad # Draw radius of curvature on the result image def draw_radius_of_curvature(img, curv): cv2.putText(img, 'Radius of curvature = ' + str(round(curv, 3))+' m',(50,50), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255),2) # Draw vehicle position from the center of the lane def draw_vehicle_position(img, left_fit, right_fit): left_bottom = left_fit[0]*ploty[-1]**2 + left_fit[1]*ploty[-1] + left_fit[2] right_bottom = right_fit[0]*ploty[-1]**2 + right_fit[1]*ploty[-1] + right_fit[2] lane_center = (left_bottom + right_bottom) / 2 vehicle_pos = img.shape[1]/2 diff = (vehicle_pos - lane_center) * xm_per_pixel l_or_r = ' left' if diff < 0 else ' right' cv2.putText(img, 'Vehicle position : ' + str(abs(round(diff, 3)))+' m'+l_or_r+' of center',(50,100), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255),2) def process_image(img, plot = False, dump = False): undist = processor.undistort(img) thresh = processor.thresholding(undist) warped = processor.perspective_transform(thresh) if left_line.do_slide_window() or right_line.do_slide_window(): left_fit, right_fit = find_lane_lines_sliding_window(warped, plot) else: left_fit, right_fit = find_lane_lines_using_previous_fit(warped, left_line.current_fit, right_line.current_fit, plot) valid_lane = check_lane(left_fit, right_fit) left_line.add_fit(left_fit, valid_lane) right_line.add_fit(right_fit, valid_lane) # Draw the best fit result = draw_lane(img, warped, left_line.best_fit, right_line.best_fit) draw_radius_of_curvature(result, (left_line.radius_of_curvature+right_line.radius_of_curvature)/2) draw_vehicle_position(result, left_line.best_fit, right_line.best_fit) if dump: filename = "./video_frames_images/" + str(left_line.frame_counter) + ".jpg" mpimg.imsave(filename, img) filename = "./video_frames_processed_images/" + str(left_line.frame_counter) + ".jpg" mpimg.imsave(filename, result) if plot == True: plt.imshow(result) plt.show(block=True) return result def check_width(left_fit, right_fit): # Check lane width left_fitx = left_fit[0]*ploty**2 + left_fit[1]*ploty + left_fit[2] right_fitx = right_fit[0]*ploty**2 + right_fit[1]*ploty + right_fit[2] diff = right_fitx - left_fitx min_width = np.min(diff) max_width = np.max(diff) if min_width < 550 or max_width > 850: # 550 <= valid lane width <= 850 return False return True def check_lane(left_fit, right_fit): if left_line.best_fit == None or right_line.best_fit == None: return True # Take whatever we have right now if not check_width(left_fit, right_fit): return False if not left_line.check_line(left_fit): return False if not right_line.check_line(right_fit): return False return True def process_video(in_name, out_name, plot = False, dump = False): from moviepy.editor import VideoFileClip output1 = './project_video_processed.mp4' clip1 = VideoFileClip("./project_video.mp4") processed_clip1 = clip1.fl_image(process_image) #NOTE: this function expects color images!! processed_clip1.write_videofile(output1, audio=False) MODE = 1 # 1 - Images, 2 - Videos processor = ImageProcessor() if MODE == 1: run_all_test_images('./test_images', plot=True, debug=False) #run_all_test_images('./my_test_images/other_types_test_images/', plot=True, debug=True) #run_all_test_images('./my_test_images', plot=True, debug=True) elif MODE == 2: left_line = Line() right_line = Line() process_video('./project_video.mp4', 'project_video_processed.mp4')
[ "peiciwu@gmail.com" ]
peiciwu@gmail.com
d509eed695ce2b3e20d2b819a42172b2c95fccab
4e04db11d891f869a51adf0e0895999d425f29f6
/portalbackend/lendapi/v1/accounts/permissions.py
d03cc4c6a2749a8264b3b36768a2678d71de1192
[]
no_license
mthangaraj/ix-ec-backend
21e2d4b642c1174b53a86cd1a15564f99985d23f
11b80dbd665e3592ed862403dd8c8d65b6791b30
refs/heads/master
2022-12-12T12:21:29.237675
2018-06-20T13:10:21
2018-06-20T13:10:21
138,033,811
0
0
null
2022-06-27T16:54:14
2018-06-20T13:04:22
JavaScript
UTF-8
Python
false
false
4,807
py
import json import re from rest_framework import permissions, status from rest_framework.exceptions import APIException from portalbackend.validator.errormapping import ErrorMessage from portalbackend.validator.errorcodemapping import ErrorCode from django.utils.deprecation import MiddlewareMixin from datetime import datetime, timedelta from portalbackend.lendapi.accounts.models import UserSession,CompanyMeta from re import sub from oauth2_provider.models import AccessToken from portalbackend.lendapi.v1.accounting.utils import Utils from django.http import JsonResponse from django.utils.timezone import utc from portalbackend.lendapi.constants import SESSION_EXPIRE_MINUTES, SESSION_SAVE_URLS class IsAuthenticatedOrCreate(permissions.IsAuthenticated): def has_permission(self, request, view): if request.method == 'POST': return True return super(IsAuthenticatedOrCreate, self).has_permission(request, view) class ResourceNotFound(APIException): status_code = status.HTTP_404_NOT_FOUND default_detail = {"message": ErrorMessage.RESOURCE_NOT_FOUND, "status": "failed"} class UnauthorizedAccess(APIException): status_code = status.HTTP_401_UNAUTHORIZED default_detail = {"message": ErrorMessage.UNAUTHORIZED_ACCESS, "status": "failed"} class IsCompanyUser(permissions.IsAuthenticated): message = {"message": ErrorMessage.UNAUTHORIZED_ACCESS, "status": "failed"} def has_permission(self, request, view): try: split_url = request.META.get('PATH_INFO').split("/") if split_url[3] == "docs": return request.user.is_authenticated() if len(view.kwargs) == 0 or split_url[3] != "company": if request.user.is_superuser: return request.user and request.user.is_authenticated() else: raise UnauthorizedAccess is_valid_company, message = Utils.check_company_exists(view.kwargs["pk"]) if not is_valid_company: raise ResourceNotFound if request.user.is_superuser: return request.user and request.user.is_authenticated() else: return ((request.user.is_superuser or request.user.company.id == int( view.kwargs["pk"])) and request.user.is_authenticated()) except APIException as err: raise err class SessionValidator(MiddlewareMixin): def process_request(self, request): try: session_save_urls = SESSION_SAVE_URLS request_api_url = request.META.get('PATH_INFO') for url in session_save_urls: if re.search(url, request_api_url): return header_token = request.META.get('HTTP_AUTHORIZATION', None) if header_token is not None: token = sub('Token ', '', request.META.get('HTTP_AUTHORIZATION', None)) token = token.split(' ') token_obj = AccessToken.objects.get(token=token[1]) user = token_obj.user meta = CompanyMeta.objects.get(company = user.company) if meta is not None and meta.monthly_reporting_sync_method == 'QBD': return try: user_session = UserSession.objects.get(user=user) if user_session: if user_session.is_first_time: user_session.is_first_time = False user_session.auth_key = token_obj if user_session.auth_key == token_obj: now = datetime.utcnow().replace(tzinfo=utc) if user_session.end_time > now: user_session.end_time = now + timedelta(minutes=SESSION_EXPIRE_MINUTES) user_session.save() else: user_session.delete() return JsonResponse( {'error': ErrorMessage.SESSION_EXPRIED, 'code': ErrorCode.SESSION_EXPRIED}, status=401) else: return JsonResponse( {'error': ErrorMessage.SESSION_ALREADY_ACTIVE, 'code': ErrorCode.SESSION_ALREADY_ACTIVE}, status=401) except UserSession.DoesNotExist: return JsonResponse({'error': ErrorMessage.SESSION_EXPRIED, 'code': ErrorCode.SESSION_EXPRIED}, status=401) except Exception as e: print(e) return
[ "thangaraj.matheson@ionixxtech.com" ]
thangaraj.matheson@ionixxtech.com
76d246ae50464e8ce26b99f4892ebf619b0fd6bd
0d98a09a81bdcead13e6020877380a4e7e6b5d74
/fizyka/pyfiz.py
2bdca7ea555847122d2cad6111eb675dc7d39be6
[]
no_license
pawelsag/Studies
e7f56b823fdf5d7aa438c6dfb41f0d617718576e
34c2e8a786df59ce18c8dbf9f4476d891a456fe1
refs/heads/master
2020-04-04T14:29:38.184527
2020-01-11T08:16:45
2020-01-11T08:16:45
156,000,522
0
1
null
null
null
null
UTF-8
Python
false
false
710
py
import math # data amount n = 12 tau = 0.0 fiY = 0.0 delA =0.0 delB =0.0 with open("fiz.txt", "r") as f: # get A, B coefficients A,B = f.readline().split(',') A = float(A) B = float(B) # get measured values x,y data = [] for line in f: x,y = line.split(' ') data.append( ( float(x),float(y) ) ) # calculate tau v1 = 0.0 v2 = 0.0 for x,y in data: v1 += x**2 v2 += x tau = (n*(v1)) - (v2**2) for x,y in data: fiY += (y - A*x -B)**2 print("SUMA(epislon^2)=",fiY) fiY = math.sqrt(fiY/(n-2)) delA = fiY*math.sqrt(n/tau) delB = fiY*math.sqrt(v1/tau) print("n =",n ) print("tau=",tau ) print("fiY=",fiY) print("v1=",v1) print("delA =", delA) print("delB =", delB)
[ "sagan.pawel1000@gmail.com" ]
sagan.pawel1000@gmail.com
c2e0941d1ce77fcbec7429f96196816cf290fd15
99d8cdf79898b5dabd2b80340d9b90e78831a3b7
/handlers/helper.py
dcec79c00fe8067c52bf0d4dd66f856d3e0767c5
[]
no_license
crazcarl/gridironguessinggame
99fa021f1ce8e946d68e8524317b5e969510a7e7
517596dbec03c6f2126fbbbe08e4ce9d0ea90467
refs/heads/master
2021-01-01T17:16:05.986335
2015-10-20T01:29:47
2015-10-20T01:29:47
16,240,124
0
0
null
2014-01-29T04:19:25
2014-01-25T21:16:50
Python
UTF-8
Python
false
false
2,547
py
def teamToLong(input): if input=="NYG": return "NY Giants" if input=="WAS": return "Washington" if input=="BAL": return "Baltimore" if input=="CAR": return "Carolina" if input=="CHI": return "Chicago" if input=="GB": return "Green Bay" if input=="HOU": return "Houston" if input=="BUF": return "Buffalo" if input=="IND": return "Indianapolis" if input=="TEN": return "Tennessee" if input=="NYJ": return "NY Jets" if input=="DET": return "Detroit" if input=="OAK": return "Oakland" if input=="MIA": return "Miami" if input=="PIT": return "Pittsburgh" if input=="TB": return "Tampa Bay" if input=="SD": return "San Diego" if input=="JAC": return "Jacksonville" if input=="MIN": return "Minnesota" if input=="ATL": return "Atlanta" if input=="SF": return "San Francisco" if input=="PHI": return "Philadelphia" if input=="DAL": return "Dallas" if input=="NO": return "New Orleans" if input=="KC": return "Kansas City" if input=="NE": return "New England" if input=="STL": return "St. Louis" if input=="CLE": return "Cleveland" if input=="DEN": return "Denver" if input=="ARI": return "Arizona" if input=="CIN": return "Cincinnati" if input=="SEA": return "Seattle" return "OTHER" def teamToShort(input): if input=="NY Giants": return "NYG" if input=="Washington": return "WAS" if input=="Baltimore": return "BAL" if input=="Carolina": return "CAR" if input=="Chicago": return "CHI" if input=="Green Bay": return "GB" if input=="Houston": return "HOU" if input=="Buffalo": return "BUF" if input=="Indianapolis": return "IND" if input=="Tennessee": return "TEN" if input=="NY Jets": return "NYJ" if input=="Detroit": return "DET" if input=="Oakland": return "OAK" if input=="Miami": return "MIA" if input=="Pittsburgh": return "PIT" if input=="Tampa Bay": return "TB" if input=="San Diego": return "SD" if input=="Jacksonville": return "JAC" if input=="Minnesota": return "MIN" if input=="Atlanta": return "ATL" if input=="San Francisco": return "SF" if input=="Philadelphia": return "PHI" if input=="Dallas": return "DAL" if input=="New Orleans": return "NO" if input=="Kansas City": return "KC" if input=="New England": return "NE" if input=="St. Louis": return "STL" if input=="Cleveland": return "CLE" if input=="Denver": return "DEN" if input=="Arizona": return "ARI" if input=="Cincinnati": return "CIN" if input=="Seattle": return "SEA" return "OTHER"
[ "crazcarl@gmail.com" ]
crazcarl@gmail.com
4e0e5d6bdbe92c957594f844fe1240c99f90303c
25cb3605e3239f41ca73e860c65fddf63c887924
/src/Calculator.py
7e16169da3ceeeb37f5174a0e53d7dd28ecf1c4c
[ "MIT" ]
permissive
Ayush6459/Simple_Calculator_package
8dacc5ee345e8efcd01456288f77c3adb1ac95ea
8c7260ed8e91def3bf0964798b716e1305433872
refs/heads/master
2023-04-25T10:56:36.308773
2021-05-14T10:41:35
2021-05-14T10:41:35
367,270,133
0
0
null
null
null
null
UTF-8
Python
false
false
192
py
def add_num(num1, num2): return num1+num2 def sub_num(num1,num2): return num1-num2 def multi_num(num1, num2): return num1*num2 def div_num(num1,num2): return num1/num2
[ "ayushranjan6459@gmail.com" ]
ayushranjan6459@gmail.com
702dc360e83014136e7a9d53ebe06f992815b006
ebf6463d4e520429a24d1fd34375d3302b245346
/net/modifire/PStats.py
3ca2c2ffd73208b91bc45b11b48128de21450347
[]
no_license
czorn/Modifire
6f8c8f2d679c7be7618607e1b46a3a019f09b918
77f2cdff0214468482a98ca92c7a2d548d77f3d9
refs/heads/master
2020-12-24T14:26:53.286484
2013-10-22T18:54:26
2013-10-22T18:54:26
3,159,644
0
0
null
null
null
null
UTF-8
Python
false
false
915
py
#import direct.directbase.DirectStart def pstat(func): from pandac.PandaModules import PStatCollector collectorName = "Debug:%s" % func.__name__ if hasattr(base, 'custom_collectors'): if collectorName in base.custom_collectors.keys(): pstat = base.custom_collectors[collectorName] else: base.custom_collectors[collectorName] = PStatCollector(collectorName) pstat = base.custom_collectors[collectorName] else: base.custom_collectors = {} base.custom_collectors[collectorName] = PStatCollector(collectorName) pstat = base.custom_collectors[collectorName] def doPstat(*args, **kargs): pstat.start() returned = func(*args, **kargs) pstat.stop() return returned doPstat.__name__ = func.__name__ doPstat.__dict__ = func.__dict__ doPstat.__doc__ = func.__doc__ return doPstat
[ "chrismzorn@gmail.com" ]
chrismzorn@gmail.com
3452b41fdad457f398c9c0dc90e7f1a6f36d42ff
8fbafbd67689c487615ed4b08db835457b67ea52
/demo_python_backend_files/sparse_feature_selection_methods.py
061fa59e3d9473a7298ccecc67f959cd9834112a
[]
no_license
RezaBorhani/RezaBorhani.github.io
c8939e2f3484a7e5f3f0b4b9199c9d90ca51bf78
ca23e5288f7ac8aab80559192fbf4fa6f3aeb20f
refs/heads/master
2021-01-21T06:39:02.122817
2017-07-21T01:31:43
2017-07-21T01:31:43
82,868,389
1
0
null
null
null
null
UTF-8
Python
false
false
2,878
py
import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') import matplotlib.patches as mpatches def plot_genes(X, gene_id_1, gene_id_2): N = X.shape[1]/2 plt.xlabel('gene #'+str(gene_id_1)) plt.ylabel('gene #'+str(gene_id_2)) red_patch = mpatches.Patch(color='red', label='healthy') blue_patch = mpatches.Patch(color='blue', label='afflicted') plt.legend(handles=[red_patch, blue_patch]) plt.legend(handles=[red_patch, blue_patch], loc = 2) ax = plt.scatter(X[gene_id_1+1,0:N], X[gene_id_2+1,0:N], color='r', s=30) #plotting the data plt.scatter(X[gene_id_1+1,N+1:2*N], X[gene_id_2+1,N+1:2*N], color='b', s=30) plt.show() return def plot_weights(w, gene_id_1, gene_id_2): plt.figure(figsize=(20,5)) plt.xlabel('genes') plt.ylabel('learned weights') plt.bar(np.arange(0,len(w)), w, color='grey', alpha=.5) plt.bar([gene_id_1, gene_id_2],[w[gene_id_1], w[gene_id_2]], color='k', alpha=.7) plt.show() return def compute_grad(X, y, w): #produce gradient for each class weights grad = 0 for p in range(0,len(y)): x_p = X[:,p] y_p = y[p] grad+= -1/(1 + np.exp(y_p*np.dot(x_p.T,w)))*y_p*x_p grad.shape = (len(grad),1) return grad def L1_logistic_regression(X, y, lam): # initialize weights - we choose w = random for illustrative purposes w = np.zeros((X.shape[0],1)) # set maximum number of iterations and step length alpha = 1 max_its = 2000 # make list to record weights at each step of algorithm w_history = np.zeros((len(w),max_its+1)) w_history[:,0] = w.flatten() # gradient descent loop for k in range(1,max_its+1): # form gradient grad = compute_grad(X,y,w) # take gradient descent step w = w - alpha*grad # take a proximal step w[1:] = proximal_step(w[1:], lam) # save new weights w_history[:,k] = w.flatten() # return weights from each step return w_history[1:,-1] def proximal_step(w, lam): return np.maximum(np.abs(w) - 2*lam,0)*np.sign(w) def logistic_regression(X, y): # initialize weights - we choose w = random for illustrative purposes w = np.zeros((X.shape[0],1)) # set maximum number of iterations and step length alpha = 1 max_its = 2000 # make list to record weights at each step of algorithm w_history = np.zeros((len(w),max_its+1)) w_history[:,0] = w.flatten() # gradient descent loop for k in range(1,max_its+1): # form gradient grad = compute_grad(X,y,w) # take gradient descent step w = w - alpha*grad # save new weights w_history[:,k] = w.flatten() # return weights from each step return w_history[1:,-1]
[ "rezaborhani@Rezas-MacBook-Pro.local" ]
rezaborhani@Rezas-MacBook-Pro.local
29c4cee2c425d08ec436f41058b807836271e49a
89e53cff0ab14d22511157e1b6ed877790a862e1
/posegan/code/param.py
d0417371a71487157f112356d4d9cf1aff3feb44
[]
no_license
dahburj/deepcoaching
96d6cabe120043f4ebf6bfb0e425b38d94213b54
535e0a374666f7815f6cf5c20eb05f455871ff38
refs/heads/master
2020-06-13T23:59:01.781604
2019-06-11T00:51:58
2019-06-11T00:51:58
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,510
py
""" Various important parameters of our model and training procedure. """ def get_general_params(): param = {} dn = 1 param['IMG_HEIGHT'] = int(256/dn) param['IMG_WIDTH'] = int(256/dn) param['obj_scale_factor'] = 1.14/dn param['scale_max'] = 1.05 # Augmentation scaling param['scale_min'] = 0.95 param['max_rotate_degree'] = 5 param['max_sat_factor'] = 0.05 param['max_px_shift'] = 5 param['posemap_downsample'] = 2 param['sigma_joint'] = 7/4.0 param['n_joints'] = 14 param['n_limbs'] = 10 # Using MPII-style joints: head (0), neck (1), r-shoulder (2), r-elbow (3), r-wrist (4), l-shoulder (5), # l-elbow (6), l-wrist (7), r-hip (8), r-knee (9), r-ankle (10), l-hip (11), l-knee (12), l-ankle (13) param['limbs'] = [[0, 1], [2, 3], [3, 4], [5, 6], [6, 7], [8, 9], [9, 10], [11, 12], [12, 13], [2, 5, 8, 11]] # Using OpenPose joints: Nose (0), Neck (1), RShoulder (2), RElbow (3), RWrist (4), LShoulder (5), # LElbow (6), LWrist (7), r-hip (8), r-knee (9), r-ankle (10), l-hip (11), l-knee (12), l-ankle (13) param['limbs'] = [[0, 1], [2, 3], [3, 4], [5, 6], [6, 7], [8, 9], [9, 10], [11, 12], [12, 13], [2, 5, 8, 11]] param['n_training_iter'] = 200000 param['test_interval'] = 5 param['model_save_interval'] = 200 param['project_dir'] = '..' param['model_save_dir'] = param['project_dir'] + '/models/' param['data_dir'] = param['project_dir'] + '/data/' param['batch_size'] = 8 return param
[ "chuanqi.chen@gmail.com" ]
chuanqi.chen@gmail.com
65c21d782d2fdb0fa84bfc14127e2a04d4bf7534
0a66dcbf1f96676ccca588191f940c798d15eebb
/DRL_data/data_labeling.py
8c24d935ce6b438655dfe8441f251cae7f85c637
[]
no_license
Fence/Documents
5e498203f2b2363b98441ecba0e2eadc74aaec4d
d5874fae9cb6618d275fcc9ea303a2c68e331f52
refs/heads/master
2020-03-11T07:02:33.351230
2018-05-14T14:55:40
2018-05-14T14:55:40
129,847,147
0
0
null
null
null
null
UTF-8
Python
false
false
49,850
py
import re import os import sys import ipdb import time import json import pickle from tqdm import tqdm class QuitProgram(Exception): def __init__(self, message='Quit the program.\n'): Exception.__init__(self) self.message = message class TextParsing(object): """docstring for TextParsing""" def __init__(self): from nltk.stem import WordNetLemmatizer from nltk.parse.stanford import StanfordDependencyParser core = '/home/fengwf/stanford/stanford-corenlp-3.7.0.jar' model = '/home/fengwf/stanford/english-models.jar' self.dep_parser = StanfordDependencyParser(path_to_jar=core, path_to_models_jar=model, encoding='utf8', java_options='-mx2000m') self.lemma = WordNetLemmatizer() def build_vocab(self, save_name): # e.g. save_name = 'wikihow/wikihow_act_seq.pkl' with open(save_name, 'rb') as f: data = pickle.load(f) word_dict = {} verb_dict = {} objs_dict = {} for text in data: for act, objs in text['act_seq']: act = act.lower() if act not in word_dict: word_dict[act] = 1 else: word_dict[act] += 1 if act not in verb_dict: verb_dict[act] = 1 else: verb_dict[act] += 1 for obj in objs.split('_'): if obj not in word_dict: word_dict[obj] = 1 else: word_dict[obj] += 1 if obj not in objs_dict: objs_dict[obj] = 1 else: objs_dict[obj] += 1 ipdb.set_trace() words = sorted(word_dict.items(), key=lambda x:x[1], reverse=True) verbs = sorted(verb_dict.items(), key=lambda x:x[1], reverse=True) objs = sorted(objs_dict.items(), key=lambda x:x[1], reverse=True) print(len(word_dict), len(verb_dict), len(objs_dict)) def stanford_find_vp_details(self, indata_name, outdata_name): data = [] with open(indata_name, 'rb') as f0: indata = pickle.load(f0)[-1] if os.path.exists('%s.pkl' % outdata_name): print('Loading data...') data = pickle.load(open('%s.pkl' % outdata_name, 'rb')) print('len(data) = %d' % len(data)) try: count = 0 for cate in indata: print(cate) for page in indata[cate]: if 'detail' not in page: continue for detail in page['detail']: count += 1 if count <= len(data): continue tmp_data = {'title': page['title']} tmp_data['sent'] = [] tmp_data['act_seq'] = [] tmp_data['dep_conll'] = [] sents = [] for step in detail: text = re.sub(r'\[.*\]|/', '', step) text = re.sub(r'[\n\r]', ' ', text) tmp_sents = re.split(r'\. |\? |\! ', text) for s in tmp_sents: if len(s.strip().split()) > 1: sents.append(s.strip()) try: dep = self.dep_parser.raw_parse_sents(sents) except AssertionError: print('Raise AssertionError') sents = [' '.join(re.findall(r'[\w\'\.]+', s)) for s in sents] try: dep = self.dep_parser.raw_parse_sents(sents) except Exception as e: print(e) continue except Exception as e: print(e) continue for j in range(len(sents)): try: dep_root = next(dep) dep_sent = next(dep_root) except StopIteration: print('j = %d len(sents) = %d Raise StopIteration.\n' % (j, len(sents))) break conll = [_.split() for _ in str(dep_sent.to_conll(10)).split('\n') if _] words = [] idx2word = {} for w in conll: idx2word[w[0]] = w[1] words.append(w[1]) tmp_data['sent'].append(' '.join(words)) #tmp_data['dep_conll'].append(conll) for line in conll: if 'dobj' in line or 'nsubjpass' in line: obj = [line[1]] obj_idxs = [line[0]] verb_idx = line[6] for one_line in conll: if one_line[6] == obj_idxs[0] and one_line[7] == 'conj': obj.append(one_line[1]) obj_idxs.append(one_line[0]) act = idx2word[verb_idx].lower() act_obj_pair = (act, '_'.join(obj)) tmp_data['act_seq'].append(act_obj_pair) data.append(tmp_data) print(len(data), page['title']) if len(data) % 2000 == 0: print('len(data): %d, try to save file.' % len(data)) self.save_txt_and_pkl(outdata_name, data) print('Successfully save %s\n' % outdata_name) elif len(data) % 1000 == 0: print('len(data): %d, try to save file.' % len(data)) self.save_txt_and_pkl(outdata_name, data, False) print('Successfully save %s\n' % outdata_name) except KeyboardInterrupt: print('Manually keyboard interrupt!\n') except Exception as e: print(e) print('len(data): %d, try to save file.' % len(data)) self.save_txt_and_pkl(outdata_name, data) print('Successfully save %s\n' % outdata_name) def stanford_find_vp(self, indata_name, outdata_name): num_texts = 124 # 96 # source = 'wikihow/new_details/' #'ehow/out_data/' # 'cooking/out_data/' # #save_name = 'wikihow/wikihow_act_seq_100k' # 'ehow/ehow_act_seq' # 'cooking/cooking_act_seq' # data = [] #ipdb.set_trace() with open(indata_name, 'rb') as f0: indata = pickle.load(f0)[-1] if os.path.exists('%s.pkl' % outdata_name): print('Loading data...') data = pickle.load(open('%s.pkl' % outdata_name, 'rb')) print('len(data) = %d' % len(data)) #for i in range(num_texts): #for name in os.listdir(source): try: count = 0 for cate in indata: print(cate) for page in indata[cate]: if 'sub_task' not in page: continue for sub_task in page['sub_task']: count += 1 if count <= len(data): continue text = '\n'.join(sub_task) tmp_data = {'title': page['title']} tmp_data['sent'] = [] tmp_data['act_seq'] = [] tmp_data['dep_conll'] = [] #fname = '%s%d.txt' % (source, i + 1) #fname = source + name #print(fname) #try: #text = open(fname).read() text = re.sub(r'/', ' ', text) sents = text.split('\n') #.readlines() try: dep = self.dep_parser.raw_parse_sents(sents) except AssertionError: #print('\n', sents) print('Raise AssertionError') sents = [' '.join(re.findall(r'[\w\'\.]+', s)) for s in sents] #print(sents, '\n') try: dep = self.dep_parser.raw_parse_sents(sents) except Exception as e: print(e) continue except Exception as e: print(e) continue for j in range(len(sents)): try: dep_root = next(dep) dep_sent = next(dep_root) except StopIteration: print('j = %d len(sents) = %d Raise StopIteration.\n' % (j, len(sents))) break conll = [_.split() for _ in str(dep_sent.to_conll(10)).split('\n') if _] words = [] idx2word = {} for w in conll: idx2word[w[0]] = w[1] #word_lemma = self.lemma.lemmatize(w[1]) #if word_lemma == 'pythonly': # word_lemma = w[1] words.append(w[1]) #word_lemma tmp_data['sent'].append(' '.join(words)) tmp_data['dep_conll'].append(conll) for line in conll: if 'dobj' in line or 'nsubjpass' in line: obj = [line[1]] obj_idxs = [line[0]] verb_idx = line[6] for one_line in conll: if one_line[6] == obj_idxs[0] and one_line[7] == 'conj': obj.append(one_line[1]) obj_idxs.append(one_line[0]) # lemmatize, find the original word of action act = idx2word[verb_idx].lower() act_obj_pair = (act, '_'.join(obj)) tmp_data['act_seq'].append(act_obj_pair) data.append(tmp_data) print(len(data), page['title']) if len(data) % 2000 == 0: print('len(data): %d, try to save file.' % len(data)) self.save_txt_and_pkl(outdata_name, data) print('Successfully save %s\n' % outdata_name) elif len(data) % 1000 == 0: print('len(data): %d, try to save file.' % len(data)) self.save_txt_and_pkl(outdata_name, data, False) print('Successfully save %s\n' % outdata_name) except KeyboardInterrupt: print('Manually keyboard interrupt!\n') except Exception as e: print(e) print('len(data): %d, try to save file.' % len(data)) self.save_txt_and_pkl(outdata_name, data) print('Successfully save %s' % outdata_name) def get_labeled_win2k(self): text = open('win2k/window2k_annotations.txt').read() articles = text.split('-------------------------------------------------')[1:] data = [] #ipdb.set_trace() for article in articles: tmp_data = {} tmp_data['sent'] = [] tmp_data['act_seq'] = [] lines = article.split('\n') for line in lines: if line.startswith('article', 4): print(line.strip()) elif line.startswith('c:', 9): pass elif line.startswith('- ', 9) or line.startswith('~ ', 9): a = re.split(r'\([\w\-\/\:]*\)', line) assert len(a) >= 2 act = re.findall(r'\w+', a[0]) obj = re.findall(r'\w+', a[1]) if len(act) == 0 or len(obj) == 0: ipdb.set_trace() act = self.lemma.lemmatize('_'.join(act).lower(), pos='v') obj = '_'.join(obj).lower() act_obj_pair = (act, obj) tmp_data['act_seq'].append(act_obj_pair) elif len(line.strip()): tmp_data['sent'].append(line.strip()) if len(tmp_data['act_seq']) == 0: ipdb.set_trace() data.append(tmp_data) self.save_txt_and_pkl('win2k/win2k_act_seq', data, True, protocol=2) def save_txt_and_pkl(self, fname, data, save_txt=False, protocol=3): with open('%s.pkl'%fname, 'wb') as f1: pickle.dump(data, f1, protocol=protocol) if save_txt: with open('%s.txt'%fname, 'w') as f0: count = 0 for d in data: count += 1 if 'title' in d: try: f0.write('<Article %d>: %s\n' % (count, d['title'])) except Exception as e: print('An error occurs in saving file', e) else: try: f0.write('<Article %d>: \n' % count) except Exception as e: print('An error occurs in saving file', e) for i, s in enumerate(d['sent']): try: f0.write('<Sentence %d>: %s\n' % (i, s)) except Exception as e: print('An error occurs in saving file', e) f0.write('\n') for j, (act, obj) in enumerate(d['act_seq']): try: f0.write('<Action %d>: %s %s\n' % (j, act, obj)) except Exception as e: print('An error occurs in saving file', e) f0.write('\n') #if 'dep_conll' in d.keys(): # f0.write('\n<Dependency>\n') # for dc in d['dep_conll']: # for c in dc: # f0.write(' '.join(c)+'\n') # f0.write('\n') f0.write('\n') class DataLabeler(object): """for wikihow dataset: 1. find top 500 'or texts' of home and garden 2. text labeling, add annotations: action types, action indexes, object indexes 3. add object type, split object indexes by 'or, Or' """ def __init__(self): self.num_texts = 154 self.one_line_data = 1 self.home = 'wikihow' #'ehow' #'cooking' #'win2k' #wikihow self.source = '%s/raw_data/' % self.home self.out_path = '%s/out_data/' % self.home self.save_file = '%s/%s_data.pkl' % (self.home, self.home) self.save_labeled_data = '%s/labeled_%s_data.pkl' % (self.home, self.home) self.refined_data = '%s/refined_%s_data.pkl' % (self.home, self.home) def find_top_or_text_by_category(self): print('Loading data...') data = pickle.load(open('wikihow/wikihow_data_100k.pkl', 'rb'))[-1] garden = data['Category:Home-and-Garden'] print(len(garden)) texts = [] for page in garden: if 'detail' not in page or len(page['detail']) != len(page['task']): continue for i, detail in enumerate(page['detail']): sents = [] for step in detail: text = re.sub(r'\[.*\]|/', '', step) text = re.sub(r'[\n\r]', ' ', text) tmp_sents = re.split(r'\. |\? |\! ', text) for s in tmp_sents: s = re.sub(r'<.*>|<*', '', s) if len(s.strip().split()) > 1: sents.append(s.strip()) texts.append({'title': page['task'][i], 'sent': sents}) with open('wikihow/wikihow_home_and_garden_data.pkl', 'wb') as f: pickle.dump(texts, f) self.find_top_or_text('', 'wikihow/home_and_garden_500_words', texts) def find_top_or_text(self, infile, outfile, texts='', topn=-1): # infile = 'wikihow/wikihow_act_seq_152k_details.pkl' # outfile = 'top1000_or_texts_152k.txt' if texts: data = texts else: data = pickle.load(open(infile, 'rb')) or_dicts = {} for i, text in enumerate(data): #if len(text['sent']) > 40: # continue if sum([len(s.split()) for s in text['sent']]) > 500: continue for sent in text['sent']: words = sent.split() if 'or' in words or 'Or' in words: if i not in or_dicts: or_dicts[i] = 1 else: or_dicts[i] += 1 or_list = sorted(or_dicts.items(), key=lambda x:x[1], reverse=True) f = open(outfile + '.txt', 'w') if topn <= 0: topn = len(or_list) print('topn:', topn) texts = [] for idx in or_list[: topn]: text = data[idx[0]]['sent'] sents = [re.sub(r',|;|:|\.|', '', s) for s in text] texts.append(sents) f.write('text: %d\n' % idx[0]) if 'title' in data[idx[0]]: f.write('title: %s\n' % data[idx[0]]['title']) for j, sent in enumerate(text): f.write('No%d: %s\n' % (j, sent)) f.write('\n\n') f.close() with open(outfile + '.pkl', 'wb') as f: pickle.dump(texts, f, protocol=2) def get_sail_data(self): lines = open('sail/paragraph.instructions').readlines() i = 0 data = {} assert len(lines) % 4 == 0 for i in range(int(len(lines) / 4)): tags = lines[i * 4].split('_') key = '_'.join(tags[1: 4]) #key = lines[i*4] sents = lines[i * 4 + 2].replace('\n', ' ') sents = sents.split('. ') assert len(sents[-1]) == 0 words = [s.split() for s in sents[: -1]] if key not in data: data[key] = [words] else: data[key].append(words) print(len(data)) total = 0 for key, sents in data.items(): words_num = 0 for sent in sents: words_num += sum([len(s) for s in sent]) total += words_num print('{:<20}\t{:<5}\t{:<5}\t{:<5}'.format(key, len(sents), words_num, total)) ipdb.set_trace() for i in sorted(data.items(),key=lambda x:x[1], reverse=True): print(i) def add_action_type(self): self.save_labeled_data = 'cooking/new_refined_cooking_data2.pkl' self.refined_data = 'cooking/new_cooking_labeled_data2.pkl' with open(self.save_labeled_data, 'rb') as f: data = pickle.load(f) last_sent = last_text = 0 out_data = [] if os.path.exists(self.refined_data): print('Load data from %s...\n' % self.refined_data) last_text, last_sent, out_data = pickle.load(open(self.refined_data, 'rb')) print('last_text: %d\t last_sent: %d\n' % (last_text, last_sent)) while True: init = input('Input last text num and sent num\n') if not init: print('No input, program exit!\n') if len(init.split()) == 2: start_text = int(init.split()[0]) start_sent = int(init.split()[1]) break ipdb.set_trace() else: start_text = start_sent = 0 out_data = [[] for _ in range(len(data))] try: for i in range(start_text, len(data)): if i == start_text and len(out_data[i]) > 0: out_sents = out_data[i] else: out_sents = [{} for _ in range(len(data[i]))] if i != start_text: start_sent = 0 for j in range(start_sent, len(data[i])): print('\nT%d of %d, S%d of %d:' % (i, len(data), j, len(data[i]))) sent = data[i][j] words = sent['last_sent'] + sent['this_sent'] acts = [] for l, w in enumerate(words): print('%s(%d)'%(w, l), end=' ') print('\n') tips = False for w in ['or', 'Or', 'if', 'If', "don't", 'not', 'avoid']: if w in sent['this_sent']: tips = True print("\n%s in words[%d]\n" % (w, words.index(w))) tmp_acts = sorted(sent['acts'].items(), key=lambda x:x[0]) for act_idx, obj_idxs in tmp_acts: objs = [] for o in obj_idxs: if o >= 0: objs.append(words[o]) else: objs.append('NULL') print('%s(%s)'%(words[act_idx], ','.join(objs))) for act_idx, obj_idxs in tmp_acts: print(act_idx, obj_idxs) if not tips: act_type = 1 related_acts = [] acts.append({'act_idx': act_idx, 'obj_idxs': obj_idxs, 'act_type': act_type, 'related_acts': related_acts}) continue while True: inputs = input('\nInput action type and related action indecies:\n') if not inputs: continue if inputs == 'q': last_sent = j last_text = i out_data[i] = out_sents raise QuitProgram() elif inputs == 'r': # revise a sent print(' '.join(sent['this_sent'])) text = input('Input right this sentence\n') sent['this_sent'] = text.strip().split() words = sent['last_sent'] + sent['this_sent'] for l, w in enumerate(words): print('%s(%d)'%(w, l), end=' ') continue elif inputs == 'w': print(' '.join(sent['last_sent'])) text = input('Input right last sentence\n') sent['last_sent'] = text.strip().split() words = sent['last_sent'] + sent['this_sent'] for l, w in enumerate(words): print('%s(%d)'%(w, l), end=' ') continue elif inputs == 't': #ipdb.set_trace() sent['this_sent'][0] = sent['this_sent'][0][0] + sent['this_sent'][0][1:].lower() for ii in range(1, len(sent['this_sent'])): sent['this_sent'][ii] = sent['this_sent'][ii].lower() words = sent['last_sent'] + sent['this_sent'] for l, w in enumerate(words): print('%s(%d)'%(w, l), end=' ') continue elif inputs == 'e': sent['last_sent'][0] = sent['last_sent'][0][0] + sent['last_sent'][0][1:].lower() for ii in range(1, len(sent['last_sent'])): sent['last_sent'][ii] = sent['last_sent'][ii].lower() words = sent['last_sent'] + sent['this_sent'] for l, w in enumerate(words): print('%s(%d)'%(w, l), end=' ') continue inputs = inputs.split() if len(inputs) >= 1: act_type = int(inputs[0]) related_acts = [int(ra) for ra in inputs[1: ]] if act_type > 3 or act_type < 1: print('Wrong action type! act_type should be 1, 2 or 3!') continue if act_type == 3 and len(related_acts) == 0: print('Wrong inputs! Missed related actions!') continue if len(related_acts) > 0: related_act_words = [] for ra in related_acts: related_act_words.append(words[ra]) print(act_type, ' '.join(related_act_words)) acts.append({'act_idx': act_idx, 'obj_idxs': obj_idxs, 'act_type': act_type, 'related_acts': related_acts}) break print(acts) sent['acts'] = acts out_sents[j] = sent out_data[i] = out_sents except Exception as e: print(e) with open(self.refined_data, 'wb') as f: pickle.dump([i, j, out_data], f, protocol=2) print('last_text: %d\t last_sent: %d\n' % (i, j)) def add_object_type(self): with open(self.save_labeled_data, 'rb') as f: data = pickle.load(f)[-1] last_sent = last_text = 0 out_data = [] if os.path.exists(self.refined_data): print('Load data from %s...\n' % self.refined_data) last_text, last_sent, out_data = pickle.load(open(self.refined_data, 'rb')) print('last_text: %d\t last_sent: %d\n' % (last_text, last_sent)) while True: init = input('Input last text num and sent num\n') if not init: print('No input, program exit!\n') if len(init.split()) == 2: start_text = int(init.split()[0]) start_sent = int(init.split()[1]) break ipdb.set_trace() else: start_text = start_sent = 0 out_data = [[] for _ in range(len(data))] try: for i in range(start_text, len(data)): if i == start_text and len(out_data[i]) > 0: if len(out_data[i]) == len(data[i]): out_sents = out_data[i] else: out_sents = [{} for _ in range(len(data[i]))] else: out_sents = [{} for _ in range(len(data[i]))] #[]# if i != start_text: start_sent = 0 for j in range(start_sent, len(data[i])): sent = data[i][j] if len(sent) == 0: #print('\nEmpty sentence: (i=%d, j=%d)\n' % (i, j)) continue words = sent['last_sent'] + sent['this_sent'] acts = [] or_ind = [] print_change = False for k, w in enumerate(sent['this_sent']): if w == 'or': or_ind.append(k + len(sent['last_sent'])) if len(or_ind) == 0: for act in sent['acts']: act['obj_idxs'] = [act['obj_idxs'], []] acts.append(act) else: for act in sent['acts']: split = None for k in range(len(act['obj_idxs']) - 1): for oi in or_ind: if act['obj_idxs'][k] < oi < act['obj_idxs'][k+1]: split = k + 1 break if split != None: break if split != None: print('\nT%d of %d, S%d of %d:' % (i, len(data), j, len(data[i]))) for l, w in enumerate(words): print('%s(%d)'%(w, l), end=' ') print('\n') print('or_ind: {}\n'.format(or_ind)) print('{}({})'.format(act['act_idx'], act['obj_idxs'])) confirm = input('Split or not? (y/n)\n') if confirm.lower() == 'y': act['obj_idxs'] = [act['obj_idxs'][: split], act['obj_idxs'][split: ]] print('{}({}; {})'.format(act['act_idx'], act['obj_idxs'][0], act['obj_idxs'][1])) print_change = True else: act['obj_idxs'] = [act['obj_idxs'], []] else: act['obj_idxs'] = [act['obj_idxs'], []] acts.append(act) if print_change: print('before: {}\n\nafter : {}\n'.format(sent['acts'], acts)) sent['acts'] = acts if len(out_sents) < j + 1: out_sents.append({}) out_sents[j] = sent #out_sents.append(sent) out_data[i] = out_sents # if(len(out_sents) != len(data[i])): # #ipdb.set_trace() # time.sleep(1) # print('\nlen(out_sents) != len(data[i]): (i=%d, j=%d)\n' % (i, j)) except Exception as e: ipdb.set_trace() print(e) with open(self.refined_data, 'wb') as f: pickle.dump([i, j, out_data], f, protocol=2) print('last_text: %d\t last_sent: %d\n' % (i, j)) def transfer(self, name): _, __, indata = pickle.load(open('%s/refined_%s_data.pkl'%(name, name),'rb')) data = [] tmp_data = {} max_sent_len = 0 max_char_len = 0 log = {'wrong_last_sent': 0, 'act_reference_1': 0, 'related_act_reference_1': 0, 'obj_reference_1': 0, 'non-obj_reference_1': 0} #ipdb.set_trace() for i in range(len(indata)): words = [] sents = [] word2sent = {} text_acts = [] sent_acts = [] #if i == 44: # ipdb.set_trace() reference_related_acts = False for j in range(len(indata[i])): if len(indata[i][j]) == 0: print('%s, len(indata[%d][%d]) == 0'%(name, i, j)) continue last_sent = indata[i][j]['last_sent'] this_sent = indata[i][j]['this_sent'] acts = indata[i][j]['acts'] if j > 0 and len(last_sent) != len(indata[i][j-1]['this_sent']): #ipdb.set_trace() b1 = len(last_sent) b2 = len(indata[i][j-1]['this_sent']) for k in range(len(acts)): ai = acts[k]['act_idx'] new_act_type = acts[k]['act_type'] new_act_idx = ai - b1 + b2 new_obj_idxs = [[],[]] for l in range(2): for oi in acts[k]['obj_idxs'][l]: if oi == -1: new_obj_idxs[l].append(oi) else: new_obj_idxs[l].append(oi - b1 + b2) assert len(new_obj_idxs[l]) == len(acts[k]['obj_idxs'][l]) #if len(acts[k]['related_acts']) > 0: # ipdb.set_trace() new_related_acts = [] acts[k] = {'act_idx': new_act_idx, 'obj_idxs': new_obj_idxs, 'act_type': new_act_type, 'related_acts': new_related_acts} last_sent = indata[i][j-1]['this_sent'] log['wrong_last_sent'] += 1 sent = last_sent + this_sent bias = len(last_sent) reference_obj_flag = False tmp_acts = [] for k in range(len(acts)): act_idx = acts[k]['act_idx'] obj_idxs = acts[k]['obj_idxs'] tmp_act_idx = act_idx - bias if tmp_act_idx < 0: log['act_reference_1'] += 1 #continue tmp_obj_idxs = [[],[]] for l in range(2): for oi in obj_idxs[l]: if oi == -1: tmp_obj_idxs[l].append(oi) else: tmp_obj_idxs[l].append(oi - bias) if oi - bias < 0: reference_obj_flag = True assert len(tmp_obj_idxs[l]) == len(obj_idxs[l]) tmp_act_type = acts[k]['act_type'] tmp_related_acts = [] if len(acts[k]['related_acts']) > 0: for idx in acts[k]['related_acts']: tmp_related_acts.append(idx - bias) if idx - bias < 0: reference_related_acts = True log['related_act_reference_1'] += 1 assert len(tmp_related_acts) == len(acts[k]['related_acts']) tmp_acts.append({'act_idx': tmp_act_idx, 'obj_idxs': tmp_obj_idxs, 'act_type': tmp_act_type, 'related_acts': tmp_related_acts}) assert len(tmp_acts) == len(acts) if j == 0: if reference_obj_flag: log['obj_reference_1'] += 1 for ii in range(len(words), len(words)+len(last_sent)): word2sent[ii] = len(sents) words.extend(last_sent) sents.append(last_sent) sent_acts.append({}) #elif reference_related_acts: # log['related_act_reference_1'] += 1 else: if len(last_sent) > 0: log['non-obj_reference_1'] += 1 last_sent = [] bias = len(last_sent) sent = last_sent + this_sent acts = tmp_acts add_bias = len(words) for ii in range(len(words), len(words)+len(this_sent)): word2sent[ii] = len(sents) words.extend(this_sent) sents.append(this_sent) sent_acts.append(acts) for k in range(len(tmp_acts)): act_idx = tmp_acts[k]['act_idx'] obj_idxs = tmp_acts[k]['obj_idxs'] text_act_idx = act_idx + add_bias if sent[act_idx + bias] != words[act_idx + add_bias]: ipdb.set_trace() print(sent[act_idx + bias], words[act_idx + add_bias]) text_obj_idxs = [[],[]] for l in range(2): for oi in obj_idxs[l]: if oi == -1: text_obj_idxs[l].append(-1) else: text_obj_idxs[l].append(oi + add_bias) if sent[oi + bias] != words[oi + add_bias]: ipdb.set_trace() print(sent[oi + bias], words[oi + add_bias]) assert len(text_obj_idxs[l]) == len(obj_idxs[l]) text_act_type = tmp_acts[k]['act_type'] text_related_acts = [] if len(tmp_acts[k]['related_acts']) > 0: for idx in tmp_acts[k]['related_acts']: text_related_acts.append(idx + add_bias) assert len(text_related_acts) == len(tmp_acts[k]['related_acts']) text_acts.append({'act_idx': text_act_idx, 'obj_idxs': text_obj_idxs, 'act_type': text_act_type, 'related_acts': text_related_acts}) assert len(word2sent) == len(words) assert len(sents) == len(sent_acts) if reference_related_acts: for m, a in enumerate(text_acts): print('{}\t{}\n'.format(m, a)) #ipdb.set_trace() data.append({'words': words, 'acts': text_acts, 'sent_acts': sent_acts, 'sents': sents, 'word2sent': word2sent}) upper_bound = 0 lower_bound = 0 for d in data: for n in range(len(d['acts'])): act = d['acts'][n]['act_idx'] objs = d['acts'][n]['obj_idxs'] for l in range(2): for obj in objs[l]: if obj == -1: continue if obj - act < lower_bound: lower_bound = obj - act print(act, obj) if obj - act > upper_bound: upper_bound = obj - act print(act, obj) print('\nupper_bound: {}\tlower_bound: {}\nlog history: {}\n'.format( upper_bound, lower_bound, log)) with open('%s/%s_labeled_text_data.pkl'%(name, name), 'wb') as f: pickle.dump(data, f, protocol=2) def split_sents(self): num = 1 ipdb.set_trace() texts = [] #for fname in os.listdir(self.source): for i in range(self.num_texts): fname = '%d.txt' % (i + 1) if not fname.endswith('.txt'): continue with open(self.source + fname) as f: if self.one_line_data: atext = f.read() #f.readlines() #atext = re.sub(r'\.\n|\?\n|\!\n', '\n', atext) #for j in range(len(btext)): btext = atext.split('\n')#[:-1] assert len(btext[-1]) != 0 #btext[0] = btext[0][0] + btext[0][1:].lower() texts.append(btext) else: text = f.read() #atext = re.sub(r'\n|\r|,|;|\(|\)', ' ', text) atext = re.sub(r'\n|\r|\(|\)', ' ', text) btext = re.split(r'\. |\? |\! ', atext) texts.append(btext[:-1]) with open(self.out_path + '%d.txt' % num, 'w') as f1: print(num) f1.write('\n'.join(btext)) num += 1 with open(self.save_file, 'wb') as outfile: pickle.dump(texts, outfile, protocol=2) def text_labeling(self): if self.home == 'wikihow': self.num_texts = 256 self.save_file = 'wikihow/home_and_garden_500_words.pkl' if self.home != 'cooking': with open(self.save_file, 'rb') as f: texts = pickle.load(f) if self.home == 'wikihow': _ = texts.pop(87) # skip out of place texts _ = texts.pop(108) _ = texts.pop(118) _ = texts.pop(118) _ = texts.pop(122) _ = texts.pop(123) _ = texts.pop(126) _ = texts.pop(126) if os.path.exists(self.save_labeled_data): with open(self.save_labeled_data, 'rb') as f: print('Load data from %s...\n' % self.save_labeled_data) last_text, last_sent, data = pickle.load(f) print('last_text: %d\t last_sent: %d\n' % (last_text, last_sent)) while True: init = input('Input last text num and sent num\n') if not init: print('No input, program exit!\n') if len(init.split()) == 2: start_text = int(init.split()[0]) start_sent = int(init.split()[1]) break # for i in range(len(data)): # for j in range(len(data[i])): # if len(data[i][j]) == 0: # print(i, j) ipdb.set_trace() else: start_text = start_sent = 0 data = [[] for _ in range(self.num_texts)] for i in range(start_text, self.num_texts): if self.home == 'cooking' and i >= 96: text = open('cooking/new_texts/%d.txt'%(i+1)).read() text = re.sub(r',|;', ' ', text) text = [t for t in text.split('\n') if len(t.split()) > 1] else: text = [t for t in texts[i] if len(t.split()) > 1] sents_num = len(text) print('\ntext %d: total %d words\n' % (i, sum([len(t.split()) for t in text]))) if len(data[i]) > 0: #self.home != 'cooking' and i == start_text and sents = data[i] else: sents = [{} for _ in range(sents_num)] try: if i != start_text: start_sent = 0 for j in range(start_sent, sents_num): #if len(data[i]) <= j or len(data[i][j]) > 0: # continue sent = {} this_sent = text[j].split() if j > 0: # print two sentences, used for coreference resolution last_sent = text[j - 1].split() else: last_sent = [] if self.home == 'win2k': this_sent[0] = this_sent[0].title() if len(last_sent) > 0: last_sent[0] = last_sent[0].title() sent['last_sent'] = last_sent sent['this_sent'] = this_sent sent['acts'] = [] words = last_sent + this_sent words_num = len(words) print('T%d of %d, S%d of %d:' % (i, self.num_texts, j, sents_num)) for l, w in enumerate(words): print('%s(%d)'%(w, l), end=' ') while True: act = input('\nInput an action and object indices:\n') if not act: break if self.home == 'win2k2': lest_input = 1 act_i = 0 obj_i = 1 else: lest_input = 2 act_i = 1 obj_i = 2 if len(act.split()) <= lest_input: if act == 'q': raise QuitProgram() elif act == 'r': # revise a sent print(' '.join(sent['this_sent'])) text[j] = input('Input right sentence\n') sent['this_sent'] = text[j].strip().split() words = last_sent + sent['this_sent'] words_num = len(words) for l, w in enumerate(words): print('%s(%d)'%(w, l), end=' ') continue else: continue nums = [int(a) for a in act.split()] if self.home == 'win2k2': act_type = 1 related_acts = [] else: act_type = nums[0] if act_type not in [1, 2, 3]: # essential, optional, exclusive print('Wrong act_type!') continue if act_type == 3: related_acts = input('Enter its related actions (indices):\n') related_acts = [int(r) for r in related_acts.split()] if len(related_acts) == 0: print('You should input related_acts!\n') continue print('\tRelated actions: {}'.format([words[idx] for idx in related_acts])) else: related_acts = [] act_idx = nums[act_i] if act_idx >= words_num: print('action index %d out of range' % act_idx) continue obj_idxs = [] continue_flag = False for idx in nums[obj_i: ]: if idx >= words_num: print('object index %d out of range' % idx) continue_flag = True break obj_idxs.append(idx) if continue_flag: continue obj_names = [] for k in obj_idxs: if k >= 0: obj_names.append(words[k]) else: obj_names.append('NULL') print('\t%s(%s) act_type: %d' % (words[act_idx], ','.join(obj_names), act_type)) sent['acts'].append({'act_idx': act_idx, 'obj_idxs': obj_idxs, 'act_type': act_type, 'related_acts': related_acts}) if len(sents) < sents_num: sents.append({}) sents[j] = sent except Exception as e: print('Error:',e) if len(data) < self.num_texts: data.append([]) data[i] = sents with open(self.save_labeled_data, 'wb') as f: pickle.dump([i, j, data], f) break_flag = True print('last_text: %d\t last_sent: %d\n' % (i, j)) break if len(data) < self.num_texts: data.append([]) data[i] = sents with open(self.save_labeled_data, 'wb') as f: pickle.dump([i, j, data], f, protocol=2) break_flag = True print('last_text: %d\t last_sent: %d\n' % (i, j)) if __name__ == '__main__': start = time.time() model = DataLabeler() #model.find_top_or_text_by_category() #model.add_object_type() #model.transfer('wikihow') model.text_labeling() #for name in ['win2k', 'wikihow', 'cooking']: # model.transfer(name) end = time.time() print('Total time cost: %.2fs\n' % (end - start))
[ "787499313@qq.com" ]
787499313@qq.com
a3858baa61f208bad13adece86e95fda7e011367
d8f858b496a7133868d0e89cc8f4aad8f3001dff
/pytex.py
d5a8f7d16131824c54853c3167b2274141118044
[]
no_license
shawsa/m565
812b451acfb7239486a3fe689cafed0a174edaf0
47511eef4a921a1f02b5ed7311fac6067825f350
refs/heads/master
2021-01-20T08:38:17.971734
2017-12-08T05:10:09
2017-12-08T05:10:09
101,568,001
1
0
null
null
null
null
UTF-8
Python
false
false
708
py
def latex_table(t, headers=None): cols = len(t) rows = len(t[0]) print('\t\\begin{center}') print('\t\t\\begin{tabular}{' + '|c'*cols + '|}') print('\t\t\t\\hline') if headers != None: assert len(headers) == cols header_str = '' for h in headers: header_str += str(h) + '&' header_str = header_str[:-1] #remove trailing & print('\t\t\t' + header_str + '\\\\ \\hline') for i in range(rows): col = '' for j in range(cols): col += str(t[j][i]) + '&' col = col[:-1] #remove trailing & print('\t\t\t' + col + '\\\\ \\hline') print('\t\t\\end{tabular}') print('\t\\end{center}')
[ "sage.b.shaw@gmail.com" ]
sage.b.shaw@gmail.com
ce1cd13eb01ac664a6e72d6cac7965fbd900cff5
fcae2c35e3430702b643b8d914992c1d044f785d
/test_gp3.py
28a822b2c3fa4546c449b674823580521761759a
[]
no_license
016mm/gpTest
1754faf4c66c3735d5d39e0294374139917af201
5a83f51cd738bbfd5ea5ba0604487a567a694118
refs/heads/master
2023-03-06T18:13:36.785870
2021-02-23T03:33:33
2021-02-23T03:33:33
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,356
py
import urllib3 import requests import json from bs4 import BeautifulSoup def get_html(stock): headers = {"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"} url = "https://xuangubao.cn/stock/" reponse=requests.get(url+stock,headers=headers) reponse.raise_for_status() soup=BeautifulSoup(reponse.text,'html.parser') stock_name=soup.title.string[0:4] item=soup.find_all('div',class_='zhibiao-item') dict={} dict.update({stock_name:stock}) #print (new_item) for inform in item: item_0=inform.find('span',class_='zhibiao-item-label') item_1=inform.find('span',class_='zhibiao-item-text') #print (item_0.get_text(),item_1.get_text()) dict.update({item_0.get_text():item_1.get_text()}) #print (inform.get_text()) # print (dict.items()) return dict # 忽略警告:InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. requests.packages.urllib3.disable_warnings() # 一个PoolManager实例来生成请求, 由该实例对象处理与线程池的连接以及线程安全的所有细节 http = urllib3.PoolManager() # 通过request()方法创建一个请求: headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"} #7x24快讯api接口 url='https://api.xuangubao.cn/api/pc/msgs?subjids=9,10,162,723,35,469,821&limit=30' #r = http.request('GET', url, headers=headers) r = requests.get(url , headers=headers) #print(r.status) # 200 data=r.text #reponse = json.dumps(r.data.decode(),ensure_ascii=False) #print (reponse) resjson=json.loads(data) #print (resjson['NewMsgs'][0]) #print(type(resjson)) msg=resjson['NewMsgs'] print (len(msg)) for items in msg[0:]: title=items['Title'] BkjInfoArr=items['BkjInfoArr'] stock=items['Stocks'] print (title,"\t=group=",BkjInfoArr,"\t=stocks=",stock) if stock is not None: for stock_item in stock: #print(get_html(stock_item['Symbol'])) dict_stock=get_html(stock_item['Symbol']) print ("\t相关股票:",stock_item['Name'],stock_item['Symbol'],"最新:",dict_stock["最新"],dict_stock["涨幅"])
[ "menghongtao@sinotrans.com" ]
menghongtao@sinotrans.com
251796be631c7ff6cc48f6a893e651c17c6cd7a2
e2b7ba8a2df5089f0af1c52cd5ef33efbb389f4c
/tests/test_extension.py
77bf946e745db38ab065a80f7525d14a65dacd91
[ "Apache-2.0", "MIT", "BSD-2-Clause" ]
permissive
Neki/datadog-lambda-python
22406422a8984e4c4e9d348c0ea6e6f8da611c60
57cc2404b7d2d8ee5ff7791f41f0036aabd13d0c
refs/heads/main
2023-07-14T06:08:39.913580
2021-09-08T07:38:55
2021-09-08T07:38:55
384,703,202
0
0
NOASSERTION
2021-07-10T13:22:32
2021-07-10T13:22:31
null
UTF-8
Python
false
false
2,646
py
import os import sys import unittest import httpretty try: from unittest.mock import patch except ImportError: from mock import patch from datadog_lambda.extension import ( is_extension_running, flush_extension, should_use_extension, ) def exceptionCallback(request, uri, headers): raise Exception("oopsy!") class TestLambdaExtension(unittest.TestCase): # do not execute tests for Python v2.x __test__ = sys.version_info >= (3, 0) @patch("datadog_lambda.extension.EXTENSION_PATH", os.path.abspath(__file__)) def test_is_extension_running_true(self): httpretty.enable() last_request = httpretty.last_request() httpretty.register_uri(httpretty.GET, "http://127.0.0.1:8124/lambda/hello") assert is_extension_running() == True assert httpretty.last_request() != last_request httpretty.disable() def test_is_extension_running_file_not_found(self): httpretty.enable() last_request = httpretty.last_request() httpretty.register_uri(httpretty.GET, "http://127.0.0.1:8124/lambda/hello") assert is_extension_running() == False assert httpretty.last_request() == last_request httpretty.disable() @patch("datadog_lambda.extension.EXTENSION_PATH", os.path.abspath(__file__)) def test_is_extension_running_http_failure(self): httpretty.enable() last_request = httpretty.last_request() httpretty.register_uri( httpretty.GET, "http://127.0.0.1:8124/lambda/hello", status=503, body=exceptionCallback, ) assert is_extension_running() == False assert httpretty.last_request() != last_request httpretty.disable() @patch("datadog_lambda.extension.EXTENSION_PATH", os.path.abspath(__file__)) def test_flush_ok(self): httpretty.enable() last_request = httpretty.last_request() httpretty.register_uri(httpretty.POST, "http://127.0.0.1:8124/lambda/flush") assert flush_extension() == True assert httpretty.last_request() != last_request httpretty.disable() @patch("datadog_lambda.extension.EXTENSION_PATH", os.path.abspath(__file__)) def test_flush_not_ok(self): httpretty.enable() last_request = httpretty.last_request() httpretty.register_uri( httpretty.POST, "http://127.0.0.1:8124/lambda/flush", status=503, body=exceptionCallback, ) assert flush_extension() == False assert httpretty.last_request() != last_request httpretty.disable()
[ "noreply@github.com" ]
noreply@github.com
6fda0d0407e79c6d9a3df29ca3f097cbd2dcf0f5
b5cec2e9527e130d652ba87bcee9648c29a05e84
/src/zojax/cms/generations/__init__.py
641f878dc1da3c0ecf8825234b5d5b1b71677adf
[]
no_license
suvanna/zojax.cms
162766ccfb6df74421f8653fa1d3eb1a94447536
f5d88f6a2769e81369c3bdd302aefcee94d8cf28
refs/heads/master
2021-01-18T01:11:17.313119
2014-02-12T22:06:37
2014-02-12T22:06:37
null
0
0
null
null
null
null
UTF-8
Python
false
false
885
py
############################################################################## # # Copyright (c) 2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """ $Id$ """ from zope.app.generations.generations import SchemaManager pkg = 'zojax.cms.generations' schemaManager = SchemaManager(minimum_generation=0, generation=0, package_name=pkg)
[ "suvdim@gmail.com" ]
suvdim@gmail.com
7f0af037e66773cb760072ebad5fd4da7c335db8
9748610adb3d3ffcb3efd2d2661b691c2afbd2d4
/MERCURY2/m6_input.py
9fa18d19e363b09f203c128fb4d62bbb9e820f73
[]
no_license
Jooehn/Stars-Eating-Planets
bb421a9b283fe414e863b94b4a8a2760fff9bff7
5f66c23c82d79c89fbaa88c98ef8654ead68343e
refs/heads/master
2021-06-07T21:31:33.956125
2021-05-19T09:13:18
2021-05-19T09:13:18
172,890,639
0
0
null
null
null
null
UTF-8
Python
false
false
14,609
py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 30 13:51:34 2019 @author: John Wimarsson """ import numpy as np from tempfile import mkstemp from shutil import move from os import fdopen, remove ##### Format of input ##### # Bigdata must be an array with Nx10 elements containing for each big body the name, # mass, radius and density, as well its six orbital elements. # Smalldata must be an array with Nx8 elements, as the small particles are considered # point objects with not mass, radius or density def big_input(names,bigdata,asteroidal=False,epoch=0): """Function that generates the big.in input file for MERCURY6 given an Nx10 array of data in the following format: Columns: 0: mass of the object given in solar masses 1: radius of the object in Hill radii 2: density of the object 3: semi-major axis in AU 4: eccentricity 5: inclination in degrees 6: argument of pericentre in degrees 7: longitude of the ascending node 8: mean anomaly in degrees We can also pass the argument asteroidal as True if we want that coordinate system. Also the epoch can be specified, it should be given in years.""" N = len(bigdata) if asteroidal: style = 'Asteroidal' else: style = 'Cartesian' initlist = [')O+_06 Big-body initial data (WARNING: Do not delete this line!!)\n',\ ") Lines beginning with `)' are ignored.\n",\ ')---------------------------------------------------------------------\n',\ ' style (Cartesian, Asteroidal, Cometary) = {}\n'.format(style),\ ' epoch (in days) = {}\n'.format(epoch*365.25),\ ')---------------------------------------------------------------------\n'] with open('big.in','w+') as bigfile: for i in initlist: bigfile.write(i) for j in range(N): bigfile.write(' {0:11}m={1:.17E} r={2:.0f}.d0 d={3:.2f}\n'.format(names[j],*bigdata[j,0:3])) bigfile.write(' {0: .17E} {1: .17E} {2: .17E}\n'.format(*bigdata[j,3:6])) bigfile.write(' {0: .17E} {1: .17E} {2: .17E}\n'.format(*bigdata[j,6:])) bigfile.write(' 0. 0. 0.\n') def small_input(names=[],smalldata=[],epochs=[]): """Function that generates the small.in input file for MERCURY6 given an Nx10 array of data in the following format: Columns: 0: Name of the object in upper case letters 1: the object's epoch, set to zero if not relevant 2: semi-major axis in AU 3: eccentricity 4: inclination in degrees 5: argument of pericentre in degrees 6: longitude of the ascending node 7: mean anomaly in degrees If no data is given, the function will simply write only the necessary lines""" N = len(smalldata) if len(epochs) == 0: epochs = np.zeros(N) initlist = [')O+_06 Small-body initial data (WARNING: Do not delete this line!!)\n',\ ')---------------------------------------------------------------------\n',\ ' style (Cartesian, Asteroidal, Cometary) = Asteroidal\n',\ ')---------------------------------------------------------------------\n'] with open('small.in','w+') as smallfile: for i in initlist: smallfile.write(i) if N == 0: return for j in range(N): smallfile.write(' {0:9}epoch={1}\n'.format(*smalldata[j,0:2])) smallfile.write(' {0: .17E} {1: .17E} {2: .17E}\n'.format(*smalldata[j,2:5])) smallfile.write(' {0: .17E} {1: .17E} {2: .17E}\n'.format(*smalldata[j,5:])) smallfile.write(' 0. 0. 0.\n') def rand_big_input(names,bigdata): """Function that generates the big.in input file for MERCURY6 given that we wish to make a run for an unspecified system. bigdata should be an array containing Nx4 array that contains data in the following form: Columns: 1: mass of the object 2: Distance in Hill radii that yields a close encounter 3: semi-major axis in AU The code generates random properties of the objects from a uniform distribution. It yields a new mean anomaly for each body in the system.""" N = len(bigdata) initlist = [')O+_06 Big-body initial data (WARNING: Do not delete this line!!)\n',\ ") Lines beginning with `)' are ignored.\n",\ ')---------------------------------------------------------------------\n',\ ' style (Cartesian, Asteroidal, Cometary) = Asteroidal\n',\ ' epoch (in days) = 0\n',\ ')---------------------------------------------------------------------\n'] # rho = calc_density(bigdata[:,0]) ecc = np.random.uniform(0,0.01,size=N) i = np.random.uniform(0,5,size=N) n = np.random.uniform(0,360,size=N) M = np.random.uniform(0,360,size=N) p = np.random.uniform(0,360,size=N) # bigdata = np.insert(bigdata,2,rho,axis=1) bigdata = np.insert(bigdata,4,ecc,axis=1) bigdata = np.insert(bigdata,5,i,axis=1) bigdata = np.insert(bigdata,6,p,axis=1) bigdata = np.insert(bigdata,7,n,axis=1) bigdata = np.insert(bigdata,8,M,axis=1) with open('big.in','w+') as bigfile: for i in initlist: bigfile.write(i) for j in range(N): bigfile.write(' {0:11}m={1:.17E} r={2:.0f}.d0 d={3:.2f}\n'.format(names[j],*bigdata[j,0:3])) bigfile.write(' {0: .17E} {1: .17E} {2: .17E}\n'.format(*bigdata[j,3:6])) bigfile.write(' {0: .17E} {1: .17E} {2: .17E}\n'.format(*bigdata[j,6:])) bigfile.write(' 0. 0. 0.\n') def rand_small_input(smalldata,epochs=[]): """Function that generates the big.in input file for MERCURY6 given that we wish to make a run for an unspecified system. smalldata should be an array containing Nx2 elements with data in the following form: Columns: 0: name of the objects in upper case letters 1: argument of pericentre in degrees The code generates random properties of the objects from a uniform distribution. It yields eccentricities between 0 and 0.01, inclinations between 0 and 5 degrees, longitude of the ascending node between 0 and 360 degrees and mean anomalies between 0 and 360 degrees. Epochs for the small bodies can be specified """ N = len(smalldata) if len(epochs) == 0: epochs = np.zeros(N) a = np.random.uniform(0.65,2,size=N) ecc = np.random.uniform(0,0.01,size=N) i = np.random.uniform(0,5,size=N) n = np.random.uniform(0,360,size=N) M = np.random.uniform(0,360,size=N) smalldata = np.insert(smalldata,1,epochs,axis=1) smalldata = np.insert(smalldata,2,a,axis=1) smalldata = np.insert(smalldata,3,ecc,axis=1) smalldata = np.insert(smalldata,4,i,axis=1) smalldata = np.insert(smalldata,6,n,axis=1) smalldata = np.insert(smalldata,7,M,axis=1) initlist = [')O+_06 Small-body initial data (WARNING: Do not delete this line!!)\n',\ ')---------------------------------------------------------------------\n',\ ' style (Cartesian, Asteroidal, Cometary) = Asteroidal\n',\ ' epoch (in days) = 0\n',\ ')---------------------------------------------------------------------\n'] with open('small.in','w+') as smallfile: for i in initlist: smallfile.write(i) if N == 0: return for j in range(N): smallfile.write(' {0} epoch={1}\n'.format(*smalldata[j,0:2])) smallfile.write(' {0: .17E} {1: .17E} {2: .17E}\n'.format(*smalldata[j,2:5])) smallfile.write(' {0: .17E} {1: .17E} {2: .17E}\n'.format(*smalldata[j,5:])) smallfile.write(' 0. 0. 0.\n') def calc_density(mass): """Calculates the average density of a planet with a given mass using the mass-radius relations from Tremaine & Dong (2012) for planets above 10 Earth masses and Zeng, Sasselov & Jacobsen (2016) for the planets below 10 Earth masses. We assume that the planet is a perfect sphere.""" rjtoau = 1/2150 retoau = rjtoau/11 metoms = 1/332946 mjtoms = 300/332946 mstogr = 1.99e33 autocm = 1.496e13 rhovals = [] for m in mass: #We use the TD12 mass-relation for our planets if they are above 2.62 #Earth masses if m>=2.62*metoms: R = 10**(0.087+0.141*np.log10(m/mjtoms)-0.171*np.log10(m/mjtoms)**2)*rjtoau else: CMF = 0.33 #Core mass fraction of the Earth R = (1.07-0.21*CMF)*(m/metoms)**(1/3.7)*retoau V = 4*np.pi*(R*autocm)**3/3 rho = m*mstogr/V rhovals.append(rho) return rhovals def mass_boost(alpha): """Boosts the mass of the big objects in the system by a factor alpha, which is provided as input.""" #Makes temporary file fh, abs_path = mkstemp() with fdopen(fh,'w') as new_file: with open('big.in') as old_file: for line in old_file: if 'm=' in line: #We obtain the old arguments largs = line.split() #We extract the mass argument from the file and scale it #by a factor alpha mass_str = largs[1] old_mass = float(mass_str.split('m=')[1]) new_mass = alpha*old_mass #We then save this as our new mass argument largs[1] = new_mass #Finally we write this new line of object properties into #the big.in file. new_line = (' {0:11}m={1:.17E} {2} {3}\n'.format(*largs)) new_file.write(line.replace(line, new_line)) else: new_file.write(line) #Remove original file and move new file remove('big.in') move(abs_path, 'big.in') def setup_end_time(T,T_start=0): """Small function that sets up the duration of our integration. T: the total time of the integration given in yr T_start: we can also specify the start time. If no start time is given, it is set to zero by default. Should aso be given in yr""" #The string we want to change start_str = ' start time (days) = ' end_str = ' stop time (days) = ' #Makes temporary file fh, abs_path = mkstemp() with fdopen(fh,'w') as new_file: with open('param.in') as old_file: for line in old_file: if start_str in line: old_sstr = line # old_stime = float(old_sstr.strip(start_str)) new_stime = T_start new_sstr = start_str+str(new_stime)+'\n' new_file.write(line.replace(old_sstr, new_sstr)) elif end_str in line: old_estr = line etime = T*365.25 new_estr = end_str+str(etime)+'\n' new_file.write(line.replace(old_estr, new_estr)) else: new_file.write(line) #Remove original file and move new file remove('param.in') move(abs_path, 'param.in') def setup_rerun_time(T): """Small function that updates the stop time in param.dmp to allow for an extended integration in case we have no collisions. Updates the old time value by adding the value T.""" #The string we want to change start_str = ' start time (days) = ' end_str = ' stop time (days) = ' #Makes temporary file fh, abs_path = mkstemp() with fdopen(fh,'w') as new_file: with open('param.in') as old_file: lines = old_file.readlines() for line in lines: if start_str in line: old_sstr_idx = lines.index(line) elif end_str in line: old_estr_idx = lines.index(line) old_sstr = lines[old_sstr_idx] old_estr = lines[old_estr_idx] old_stime = float(old_sstr.strip(start_str)) old_etime = float(old_estr.strip(end_str)) new_stime = old_etime new_etime = old_etime+T*365.25 new_sstr = start_str+str(new_stime)+'\n' new_estr = end_str+str(new_etime)+'\n' lines[old_sstr_idx] = new_sstr lines[old_estr_idx] = new_estr new_file.writelines(lines) #Remove original file and move new file remove('param.in') move(abs_path, 'param.in') def extend_stop_time(T): """Small function that updates the stop time in param.dmp to allow for an extended integration in case we have no collisions. Updates the old time value by adding the value T.""" #The string we want to change stime_str = ' stop time (days) = ' #Makes temporary file fh, abs_path = mkstemp() with fdopen(fh,'w') as new_file: with open('param.dmp') as old_file: for line in old_file: if stime_str in line: old_str = line old_time = float(old_str.strip(stime_str)) new_time = old_time+T*365.25 rep_str = stime_str+str(old_time) new_str = stime_str+str(new_time) new_file.write(line.replace(rep_str, new_str)) else: new_file.write(line) #Remove original file and move new file remove('param.dmp') move(abs_path, 'param.dmp')
[ "jooehn@gmail.com" ]
jooehn@gmail.com
dd503f30535313cc118f2aff0289365f7759c68e
db3a0578ef5d79cee7f9e96fa3fd291bbaaf9eb4
/Web/flask/morse/morseclient.py
51987ad7f8af39d04cbbd30327428eafbe498b75
[ "MIT" ]
permissive
otisgbangba/python-lessons
0477a766cda6bc0e2671e4cce2f95bc62c8d3c43
a29f5383b56b21e6b0bc21aa9acaec40ed4df3cc
refs/heads/master
2022-11-03T22:10:52.845204
2020-06-13T15:42:40
2020-06-13T15:42:40
261,255,751
1
0
MIT
2020-05-04T17:48:12
2020-05-04T17:48:11
null
UTF-8
Python
false
false
626
py
import requests from time import sleep from codes import PASSWORD, morse_codes, words_by_symbol URL_BASE = 'http://localhost:5000' INTER_LETTER_DELAY = 0.2 def request_secret(): response = requests.get(URL_BASE + '/secret') print(response.text) def send_unlock_request(message): for letter in message: symbols_for_letter = morse_codes[letter] for symbol in symbols_for_letter: response = requests.get(URL_BASE + '/code/' + words_by_symbol[symbol]) print(response.text) sleep(INTER_LETTER_DELAY) request_secret() send_unlock_request(PASSWORD) request_secret()
[ "daveb@davebsoft.com" ]
daveb@davebsoft.com
863a9e7fabd741444ae2d183a4dac774c8e404b4
204d62b325fe5dff332a517a6bea9a3cad76371d
/django/first_project/first_project/settings.py
770e2788b153469112fe4d647d2f72998cd71d5f
[]
no_license
tedyeung/Python-
ca5b87b66df95cf3e2d68e516becc04a890bb361
f379aa48d1e2118729c422e6d48a067b70639c5f
refs/heads/master
2021-09-21T11:52:20.389770
2018-08-25T14:47:46
2018-08-25T14:47:46
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,274
py
""" Django settings for first_project project. Generated by 'django-admin startproject' using Django 1.11.8. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEMPLATE_DIR = os.path.join(BASE_DIR,'templates') STATIC_DIR = os.path.join(BASE_DIR,'static') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'bf=qzo1f4aew!i*@^^a^_mo6l0pmh@8#^l)%2(%7(n&o&p2@%i' # SECURITY WARNING: don't run with debug turned on in production! 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', 'first_app' ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'first_project.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [TEMPLATE_DIR,], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'first_project.wsgi.application' # Database # https://docs.djangoproject.com/en/1.11/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/1.11/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.11/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = [STATIC_DIR,]
[ "slavo@mimicom24.com" ]
slavo@mimicom24.com
3dca66b0b5cacb2e54ac3f447510aa0439007103
03fee24072271df3afde70f7c6abaa6bceaf4d18
/utils/image_downloader.py
eccd908636408c09dbd06c33bf313e71abf85b2c
[]
no_license
pottlock1/Automatic-celebrity-face-detection
1939a536c53c5a278d840157ba5e88b695b61c0a
3dff70e2edccfe5ae59d034127b0ba5297690787
refs/heads/main
2023-06-01T20:57:10.322600
2021-06-18T04:45:53
2021-06-18T04:45:53
373,872,966
0
0
null
null
null
null
UTF-8
Python
false
false
2,869
py
import os from selenium import webdriver import requests import time import pickle class CollectCelebImages: def __init__(self, celeb1, no_of_images = 20): self.celebs = [celeb1] self.no_of_images = no_of_images def download(self): for celeb in self.celebs: self.link_extractor(search_string=celeb, no_of_images=self.no_of_images) self.imagedownloader(celeb) def link_extractor(self, search_string: str, no_of_images, sleep_time=2, wd=webdriver): # opeing google chrome using selenium webdriver and searching our query... wd = webdriver.Chrome(executable_path='chromedriver.exe') search_url = "https://www.google.com/search?safe=off&site=&tbm=isch&source=hp&q={q}&oq={q}&gs_l=img" wd.get(search_url.format(q=search_string)) time.sleep(5) # getting thumbnail_images... thumbnail_result = wd.find_elements_by_css_selector('img.Q4LuWd') print(f'{len(thumbnail_result)} images are found!!') links = [] counter = 0 while len(links) < no_of_images: img = thumbnail_result[counter] img.click() time.sleep(sleep_time) actual_images = wd.find_elements_by_css_selector('img.n3VNCb') print(f'{len(actual_images)} candidate actual images are found for image {counter} !!') for actual_image in actual_images: if actual_image.get_attribute('src') and 'http' in actual_image.get_attribute('src'): links.append(actual_image.get_attribute('src')) else: pass print(f'no of links extracted = {len(links)}') counter += 1 f = open('train_dumps\image_links_{}.pickle'.format(search_string.replace(' ', '')), 'ab') pickle.dump(links, f) f.close() print('{} image links have been saved in pickle format!!'.format(len(links))) wd.quit() def imagedownloader(self, query): if not os.path.exists(os.path.join('celeb_images', query)): os.mkdir(os.path.join('celeb_images', query)) links = pickle.loads(open('train_dumps\image_links_{}.pickle'.format(query.replace(' ', '')), 'rb').read()) counter = 0 for i, link in enumerate(links): # try: response = requests.get(link) f = open(os.path.join('celeb_images', query, 'img_{}.jpg'.format(str(i+1))), 'wb') f.write(response.content) f.close() counter += 1 print('Total downloaded imges = {}'.format(counter)) # except: # print('Cannot download image {}'.format(i)) print('{} images of {} have been downloaded!!'.format(len(links), query))
[ "noreply@github.com" ]
noreply@github.com
0ab796f72f784b236f26c7a00d313df9f1ed0f6e
7bf5c0107bc2aa5eb2cccacc7096d95d0d54f176
/config/settings.py
e7c097b616f92377165a76b7ed3144228d9e9dd5
[]
no_license
aycaateser/djangoBlog
072704cf12334906953ff9b9f3e753ba290ba510
921f1e48d1efd32b1f9b6b3ad33474f6bf1e5856
refs/heads/master
2023-08-04T04:29:05.918480
2021-09-18T14:53:02
2021-09-18T14:53:02
401,058,729
0
0
null
null
null
null
UTF-8
Python
false
false
3,090
py
""" Django settings for config project. Generated by 'django-admin startproject' using Django 3.1.5. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'on42z8izw!ip*@zj^2&ks5+(&o_(^+ot&f7jxo30eb0@med&=w' # SECURITY WARNING: don't run with debug turned on in production! 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', 'blog', 'ckeditor', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'config.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'config.wsgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/3.1/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/3.1/howto/static-files/ STATIC_URL = '/static/'
[ "56490914+aycaateser@users.noreply.github.com" ]
56490914+aycaateser@users.noreply.github.com
58bcee664f37fd7932bda3ef2c04efa273f85d5a
743d58b82ed4aaeb556e703e3f698072087f98da
/user/views.py
fccc2e3d2f6705bd62cb1efde1794831ea2d5616
[]
no_license
johir9185/warrant_management
45397ebab0be8ab2a8b8999718c5f370e734eb8f
061d8b2f6a5e888dcd3b81bd89b3dd8bc2cd032b
refs/heads/main
2023-08-22T11:11:41.537185
2021-10-07T11:20:28
2021-10-07T11:20:28
414,567,032
0
0
null
null
null
null
UTF-8
Python
false
false
1,714
py
from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from user.models import CustomUser from user.forms import UserForm from django.shortcuts import redirect, render from django.views.generic.base import TemplateView # Create your views here. # user views start @method_decorator(login_required, name='dispatch', ) def user_list(request): data = {'user_list': CustomUser.objects.all()} return render(request, "user/list.html", data) @method_decorator(login_required, name='dispatch', ) def user_form(request, id=0): if request.method == 'GET': if id == 0: form = UserForm() else: user = CustomUser.objects.get(pk=id) form = UserForm(instance=user) return render(request, "user/create.html", {'form': form, 'id': id}) else: if id == 0: form = UserForm(request.POST) else: user = CustomUser.objects.get(pk=id) form = UserForm(request.POST, instance=user) if form.is_valid(): form.save() return redirect('/user/list') @method_decorator(login_required, name='dispatch', ) def user_delete(request, id): user = CustomUser.objects.get(pk=id) user.delete() return redirect('/user/list') # user views end @method_decorator(login_required, name='dispatch', ) class SampleTemplateView(TemplateView): template_name = 'user_list.html' @method_decorator(login_required, name='dispatch', ) class DashboardTemplate(TemplateView): template_name = 'dashboard.html' @method_decorator(login_required, name='dispatch', ) class UnionTemplate(TemplateView): template_name = 'union.html'
[ "johir9185@gmail.com" ]
johir9185@gmail.com
fbe7dd8af83e6e959b7c891b3883ac4c3029f0e0
0ccd82d94bfa1f6f1c0728dd19d89b7a29389a6f
/DOCODEX3/UmbralesN.py
33595d18746065f6e3bcc37f87dcf975668459c7
[]
no_license
plreyes/Memoria-DOCODEx3
e571bea5fe87ce731da2b4becd29ea1f61bcaf55
f2d4398de13fef7a3832a6c8c066fffa92456ddd
refs/heads/master
2020-12-24T09:22:24.184300
2016-11-22T16:11:26
2016-11-22T16:11:26
73,300,180
0
0
null
null
null
null
UTF-8
Python
false
false
125,904
py
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt plt.rc('text', usetex=True) plt.rc('font', family='serif') a = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.002, 0.003, 0.003, 0.003, 0.003, 0.004, 0.004, 0.004, 0.004, 0.004, 0.004, 0.004, 0.005, 0.005, 0.005, 0.006, 0.006, 0.006, 0.006, 0.006, 0.006, 0.006, 0.007, 0.007, 0.007, 0.007, 0.007, 0.007, 0.007, 0.008, 0.008, 0.008, 0.008, 0.008, 0.009, 0.009, 0.009, 0.009, 0.009, 0.009, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.011, 0.011, 0.011, 0.011, 0.011, 0.011, 0.011, 0.011, 0.011, 0.012, 0.012, 0.012, 0.012, 0.012, 0.012, 0.013, 0.013, 0.013, 0.013, 0.014, 0.014, 0.014, 0.015, 0.015, 0.015, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.017, 0.017, 0.017, 0.017, 0.017, 0.017, 0.017, 0.018, 0.018, 0.018, 0.018, 0.018, 0.018, 0.018, 0.018, 0.018, 0.019, 0.019, 0.019, 0.019, 0.019, 0.019, 0.019, 0.019, 0.019, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.021, 0.021, 0.021, 0.021, 0.021, 0.021, 0.021, 0.021, 0.021, 0.021, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.023, 0.023, 0.023, 0.023, 0.023, 0.023, 0.023, 0.023, 0.023, 0.023, 0.023, 0.023, 0.024, 0.024, 0.024, 0.024, 0.024, 0.024, 0.024, 0.024, 0.024, 0.024, 0.024, 0.025, 0.025, 0.025, 0.025, 0.025, 0.026, 0.026, 0.026, 0.026, 0.026, 0.026, 0.026, 0.026, 0.026, 0.026, 0.026, 0.026, 0.026, 0.026, 0.027, 0.027, 0.027, 0.027, 0.027, 0.027, 0.027, 0.027, 0.027, 0.028, 0.028, 0.028, 0.028, 0.028, 0.028, 0.028, 0.028, 0.028, 0.028, 0.028, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.031, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.032, 0.033, 0.033, 0.033, 0.033, 0.033, 0.033, 0.033, 0.033, 0.033, 0.033, 0.033, 0.033, 0.034, 0.034, 0.034, 0.034, 0.034, 0.034, 0.034, 0.034, 0.034, 0.034, 0.034, 0.034, 0.034, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.036, 0.036, 0.036, 0.036, 0.036, 0.036, 0.036, 0.036, 0.036, 0.036, 0.036, 0.036, 0.036, 0.036, 0.037, 0.037, 0.037, 0.037, 0.037, 0.037, 0.037, 0.037, 0.038, 0.038, 0.038, 0.038, 0.038, 0.038, 0.038, 0.038, 0.038, 0.038, 0.038, 0.038, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.039, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.041, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.042, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.044, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.046, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.048, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.049, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.051, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.052, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.054, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.056, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.057, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.061, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.062, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.063, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.064, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.066, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.067, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.068, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.069, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.071, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.072, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.073, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.074, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.075, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.076, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.077, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.078, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.079, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.082, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.083, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.084, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.086, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.087, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.089, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.091, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.092, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.093, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.094, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.095, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.096, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.097, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.098, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.099, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.101, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.102, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.104, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.106, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.107, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.108, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.109, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.111, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.112, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.113, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.114, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.116, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.117, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.118, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.119, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.121, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.122, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.123, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.124, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.126, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.127, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.128, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.129, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.131, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.132, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.133, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.134, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.135, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.136, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.137, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.138, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.139, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.145, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.148, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.149, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.151, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.153, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.157, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.158, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.159, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.161, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.162, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.163, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.164, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.165, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.166, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.168, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.169, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.171, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.172, 0.173, 0.173, 0.173, 0.173, 0.173, 0.173, 0.173, 0.173, 0.173, 0.173, 0.173, 0.173, 0.173, 0.173, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.174, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.175, 0.176, 0.176, 0.176, 0.176, 0.176, 0.176, 0.176, 0.176, 0.176, 0.176, 0.176, 0.176, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.177, 0.178, 0.178, 0.178, 0.178, 0.178, 0.178, 0.178, 0.178, 0.178, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.179, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.181, 0.181, 0.181, 0.181, 0.181, 0.181, 0.181, 0.181, 0.181, 0.181, 0.181, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.182, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.183, 0.184, 0.184, 0.184, 0.184, 0.184, 0.184, 0.184, 0.184, 0.184, 0.184, 0.184, 0.184, 0.184, 0.184, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.185, 0.186, 0.186, 0.186, 0.186, 0.186, 0.186, 0.186, 0.186, 0.186, 0.186, 0.186, 0.186, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.187, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.188, 0.189, 0.189, 0.189, 0.189, 0.189, 0.189, 0.189, 0.189, 0.189, 0.189, 0.189, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.19, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.191, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.192, 0.193, 0.193, 0.193, 0.193, 0.193, 0.193, 0.193, 0.193, 0.193, 0.193, 0.193, 0.194, 0.194, 0.194, 0.194, 0.194, 0.194, 0.194, 0.194, 0.194, 0.194, 0.194, 0.195, 0.195, 0.195, 0.195, 0.195, 0.195, 0.195, 0.195, 0.195, 0.196, 0.196, 0.196, 0.196, 0.196, 0.196, 0.196, 0.196, 0.196, 0.196, 0.196, 0.196, 0.196, 0.196, 0.197, 0.197, 0.197, 0.197, 0.197, 0.197, 0.197, 0.197, 0.197, 0.197, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.198, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.199, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.201, 0.202, 0.202, 0.202, 0.202, 0.202, 0.202, 0.202, 0.202, 0.202, 0.202, 0.202, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.203, 0.204, 0.204, 0.204, 0.204, 0.204, 0.204, 0.204, 0.204, 0.204, 0.204, 0.204, 0.204, 0.204, 0.205, 0.205, 0.205, 0.205, 0.205, 0.205, 0.205, 0.205, 0.205, 0.205, 0.205, 0.206, 0.206, 0.206, 0.206, 0.206, 0.206, 0.206, 0.206, 0.206, 0.206, 0.206, 0.206, 0.206, 0.206, 0.207, 0.207, 0.207, 0.207, 0.207, 0.207, 0.207, 0.208, 0.208, 0.208, 0.208, 0.208, 0.208, 0.208, 0.208, 0.209, 0.209, 0.209, 0.209, 0.209, 0.209, 0.209, 0.209, 0.21, 0.21, 0.21, 0.21, 0.21, 0.21, 0.21, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.211, 0.212, 0.212, 0.212, 0.212, 0.212, 0.212, 0.212, 0.212, 0.213, 0.213, 0.213, 0.213, 0.213, 0.213, 0.213, 0.213, 0.213, 0.213, 0.213, 0.213, 0.213, 0.213, 0.214, 0.214, 0.214, 0.214, 0.214, 0.214, 0.214, 0.214, 0.214, 0.214, 0.214, 0.215, 0.215, 0.215, 0.215, 0.215, 0.215, 0.215, 0.215, 0.215, 0.215, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.217, 0.217, 0.217, 0.217, 0.217, 0.217, 0.218, 0.218, 0.218, 0.218, 0.218, 0.218, 0.218, 0.219, 0.219, 0.219, 0.219, 0.219, 0.219, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.221, 0.221, 0.221, 0.221, 0.221, 0.221, 0.221, 0.221, 0.222, 0.222, 0.222, 0.222, 0.222, 0.222, 0.222, 0.222, 0.222, 0.223, 0.223, 0.223, 0.223, 0.223, 0.223, 0.223, 0.223, 0.223, 0.224, 0.224, 0.224, 0.224, 0.224, 0.224, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.226, 0.226, 0.226, 0.226, 0.226, 0.226, 0.226, 0.226, 0.227, 0.227, 0.227, 0.227, 0.227, 0.227, 0.227, 0.227, 0.227, 0.228, 0.228, 0.228, 0.228, 0.228, 0.228, 0.228, 0.228, 0.228, 0.228, 0.228, 0.229, 0.229, 0.229, 0.229, 0.229, 0.229, 0.229, 0.229, 0.229, 0.229, 0.229, 0.229, 0.23, 0.23, 0.23, 0.23, 0.23, 0.23, 0.23, 0.23, 0.23, 0.23, 0.23, 0.23, 0.23, 0.23, 0.231, 0.231, 0.231, 0.232, 0.232, 0.232, 0.232, 0.232, 0.232, 0.232, 0.232, 0.232, 0.232, 0.232, 0.233, 0.233, 0.233, 0.233, 0.233, 0.234, 0.234, 0.234, 0.234, 0.234, 0.235, 0.235, 0.235, 0.235, 0.235, 0.235, 0.235, 0.235, 0.235, 0.235, 0.236, 0.236, 0.236, 0.236, 0.236, 0.236, 0.237, 0.237, 0.237, 0.238, 0.239, 0.239, 0.239, 0.239, 0.239, 0.239, 0.239, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.241, 0.241, 0.241, 0.241, 0.241, 0.241, 0.242, 0.243, 0.243, 0.243, 0.243, 0.243, 0.243, 0.243, 0.243, 0.244, 0.244, 0.244, 0.244, 0.244, 0.244, 0.244, 0.245, 0.245, 0.245, 0.246, 0.247, 0.247, 0.247, 0.247, 0.247, 0.248, 0.248, 0.248, 0.248, 0.248, 0.248, 0.249, 0.249, 0.25, 0.25, 0.25, 0.25, 0.25, 0.251, 0.251, 0.251, 0.251, 0.251, 0.251, 0.252, 0.252, 0.253, 0.253, 0.253, 0.254, 0.254, 0.254, 0.254, 0.254, 0.255, 0.255, 0.255, 0.255, 0.256, 0.256, 0.256, 0.256, 0.256, 0.256, 0.256, 0.256, 0.256, 0.257, 0.258, 0.258, 0.258, 0.259, 0.259, 0.259, 0.259, 0.259, 0.259, 0.26, 0.26, 0.26, 0.261, 0.261, 0.261, 0.261, 0.261, 0.262, 0.262, 0.262, 0.262, 0.262, 0.262, 0.263, 0.263, 0.263, 0.264, 0.265, 0.265, 0.265, 0.265, 0.265, 0.266, 0.266, 0.266, 0.266, 0.266, 0.267, 0.267, 0.268, 0.268, 0.268, 0.268, 0.268, 0.269, 0.269, 0.269, 0.269, 0.271, 0.271, 0.271, 0.271, 0.271, 0.271, 0.272, 0.272, 0.272, 0.272, 0.273, 0.273, 0.273, 0.273, 0.273, 0.274, 0.274, 0.275, 0.275, 0.275, 0.276, 0.276, 0.276, 0.277, 0.277, 0.277, 0.277, 0.277, 0.277, 0.277, 0.278, 0.278, 0.278, 0.278, 0.278, 0.279, 0.279, 0.28, 0.28, 0.28, 0.28, 0.28, 0.28, 0.281, 0.281, 0.281, 0.281, 0.281, 0.282, 0.283, 0.283, 0.283, 0.283, 0.284, 0.284, 0.284, 0.284, 0.284, 0.284, 0.284, 0.285, 0.285, 0.285, 0.286, 0.286, 0.286, 0.287, 0.287, 0.287, 0.287, 0.287, 0.287, 0.287, 0.288, 0.288, 0.288, 0.288, 0.288, 0.288, 0.289, 0.289, 0.289, 0.289, 0.289, 0.289, 0.29, 0.29, 0.29, 0.29, 0.291, 0.291, 0.292, 0.292, 0.292, 0.292, 0.293, 0.293, 0.293, 0.293, 0.293, 0.294, 0.294, 0.294, 0.294, 0.295, 0.295, 0.296, 0.296, 0.296, 0.297, 0.297, 0.298, 0.298, 0.299, 0.299, 0.299, 0.299, 0.3, 0.301, 0.301, 0.301, 0.301, 0.302, 0.302, 0.303, 0.303, 0.303, 0.304, 0.304, 0.305, 0.305, 0.305, 0.306, 0.306, 0.306, 0.306, 0.306, 0.306, 0.307, 0.307, 0.308, 0.308, 0.309, 0.309, 0.31, 0.31, 0.31, 0.311, 0.311, 0.312, 0.313, 0.313, 0.313, 0.314, 0.315, 0.316, 0.316, 0.317, 0.317, 0.317, 0.317, 0.318, 0.319, 0.319, 0.32, 0.32, 0.321, 0.321, 0.322, 0.323, 0.323, 0.324, 0.324, 0.324, 0.325, 0.325, 0.325, 0.327, 0.327, 0.327, 0.328, 0.328, 0.329, 0.329, 0.329, 0.329, 0.329, 0.33, 0.33, 0.332, 0.333, 0.333, 0.334, 0.334, 0.337, 0.339, 0.34, 0.34, 0.341, 0.342, 0.343, 0.345, 0.348, 0.349, 0.349, 0.35, 0.35, 0.35, 0.351, 0.352, 0.353, 0.353, 0.354, 0.354, 0.354, 0.354, 0.356, 0.365, 0.37, 0.37, 0.371, 0.372, 0.375, 0.382, 0.386, 0.386, 0.389, 0.393, 0.393, 0.394, 0.396, 0.396, 0.4, 0.404, 0.409, 0.41, 0.413, 0.421, 0.427, 0.439, 0.452, 0.463, 0.476, 0.478, 0.491, 0.516] print np.mean(a)*2.3 plt.hist(a, bins=150) plt.xlabel(r'$\sigma*\lambda$') plt.ylabel('Frecuencua') plt.title(r'Histograma') plt.show()
[ "pablo.reyes@net-works.cl" ]
pablo.reyes@net-works.cl
620acd2432ea3ff3bb15d4301c8bbf72de6e9a3a
cfaa3a0762ca9655845637f4983c381d8d139a84
/examples/summary.py
00ce28e190ef109b1babc1fef25c5b12b3bffcb3
[ "Apache-2.0" ]
permissive
dteach-rv/mrtparse
6d72775060ef826a925f36e72562c2cde12b58c6
3a34fde53b5c2a65c11c0a559e06d18edb21e441
refs/heads/master
2020-07-22T01:02:12.368866
2019-05-02T15:19:29
2019-05-02T15:19:29
null
0
0
null
null
null
null
UTF-8
Python
false
false
5,088
py
#!/usr/bin/env python ''' summary.py - This script displays summary of MRT format data. Copyright (C) 2019 Tetsumune KISO 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. Authors: Tetsumune KISO <t2mune@gmail.com> Yoshiyuki YAMAUCHI <info@greenhippo.co.jp> Nobuhiro ITOU <js333123@gmail.com> ''' import sys from mrtparse import * from datetime import datetime summary = {} start_time = end_time = 0 def count(d, k): try: d[k] += 1 except KeyError: d[k] = 1 def total(d): if isinstance(d, int): return d n = 0 for k in d: if isinstance(d[k], dict): n += total(d[k]) else: n += d[k] return n def print_line(lv, s, n): fmt = '%s%%-%ds%%8d' % (' ' * 4 * lv, 32 - 4 * lv) print(fmt % (s + ':', n)) def get_summary(f): global start_time, end_time d = Reader(f) m = d.next() start_time = end_time = m.mrt.ts d = Reader(f) for m in d: m = m.mrt if m.err: continue if m.ts < start_time: start_time = m.ts elif m.ts > end_time: end_time = m.ts if m.type == MRT_T['BGP4MP'] \ or m.type == MRT_T['BGP4MP_ET']: if not m.type in summary: summary[m.type] = {} if m.subtype == BGP4MP_ST['BGP4MP_MESSAGE'] \ or m.subtype == BGP4MP_ST['BGP4MP_MESSAGE_AS4'] \ or m.subtype == BGP4MP_ST['BGP4MP_MESSAGE_LOCAL'] \ or m.subtype == BGP4MP_ST['BGP4MP_MESSAGE_AS4_LOCAL'] \ or m.subtype == BGP4MP_ST['BGP4MP_MESSAGE_ADDPATH'] \ or m.subtype == BGP4MP_ST['BGP4MP_MESSAGE_AS4_ADDPATH'] \ or m.subtype == BGP4MP_ST['BGP4MP_MESSAGE_LOCAL_ADDPATH'] \ or m.subtype == BGP4MP_ST['BGP4MP_MESSAGE_AS4_LOCAL_ADDPATH']: if not m.subtype in summary[m.type]: summary[m.type][m.subtype] = {} count(summary[m.type][m.subtype], m.bgp.msg.type) elif m.subtype == BGP4MP_ST['BGP4MP_STATE_CHANGE'] \ or m.subtype == BGP4MP_ST['BGP4MP_STATE_CHANGE_AS4']: if not m.subtype in summary[m.type]: summary[m.type][m.subtype] = {} count(summary[m.type][m.subtype], m.bgp.new_state) else: count(summary[m.type], m.subtype) else: if hasattr(m, 'subtype'): if not m.type in summary: summary[m.type] = {} count(summary[m.type], m.subtype) else: count(summary, m.type) def print_summary(): print('[%s - %s]' % ( datetime.fromtimestamp(start_time).strftime('%Y-%m-%d %H:%M:%S'), datetime.fromtimestamp(end_time).strftime('%Y-%m-%d %H:%M:%S'))) for k1 in sorted(summary.keys()): print_line(0, MRT_T[k1], total(summary[k1])) if k1 == MRT_T['TABLE_DUMP']: for k2 in sorted(summary[k1].keys()): print_line(1, TD_ST[k2], total(summary[k1][k2])) elif k1 == MRT_T['TABLE_DUMP_V2']: for k2 in sorted(summary[k1].keys()): print_line(1, TD_V2_ST[k2], total(summary[k1][k2])) elif k1 == MRT_T['BGP4MP'] \ or k1 == MRT_T['BGP4MP_ET']: for k2 in sorted(summary[k1].keys()): print_line(1, BGP4MP_ST[k2], total(summary[k1][k2])) if k2 == BGP4MP_ST['BGP4MP_MESSAGE'] \ or k2 == BGP4MP_ST['BGP4MP_MESSAGE_AS4'] \ or k2 == BGP4MP_ST['BGP4MP_MESSAGE_LOCAL'] \ or k2 == BGP4MP_ST['BGP4MP_MESSAGE_AS4_LOCAL'] \ or k2 == BGP4MP_ST['BGP4MP_MESSAGE_ADDPATH'] \ or k2 == BGP4MP_ST['BGP4MP_MESSAGE_AS4_ADDPATH'] \ or k2 == BGP4MP_ST['BGP4MP_MESSAGE_LOCAL_ADDPATH'] \ or k2 == BGP4MP_ST['BGP4MP_MESSAGE_AS4_LOCAL_ADDPATH']: for k3 in sorted(summary[k1][k2].keys()): print_line(2, BGP_MSG_T[k3], total(summary[k1][k2][k3])) elif k2 == BGP4MP_ST['BGP4MP_STATE_CHANGE'] \ or k2 == BGP4MP_ST['BGP4MP_STATE_CHANGE_AS4']: for k3 in sorted(summary[k1][k2].keys()): print_line(2, BGP_FSM[k3], total(summary[k1][k2][k3])) def main(): if len(sys.argv) != 2: print('Usage: %s FILENAME' % sys.argv[0]) exit(1) get_summary(sys.argv[1]) print_summary() if __name__ == '__main__': main()
[ "t2mune@gmail.com" ]
t2mune@gmail.com
9e4ee13b50083c91fb8d6304fd6933a06bc69f7b
278b060127761f2300037ed8983db5901e7f5ca5
/17.py
00f6bf7b9cadc6f7d14338e090339acf473e90f2
[]
no_license
AakashJaiswal21998/Basic-Python-Examples
d6de41f19fd4cdf3d395f151c20d0fd7e236680f
9911f6e4faede067363cc18fc224d957c8e9c908
refs/heads/master
2022-12-19T00:56:34.699926
2020-10-01T04:04:01
2020-10-01T04:04:01
300,136,153
1
0
null
null
null
null
UTF-8
Python
false
false
393
py
'''Program to print the sum of 1/1-1/2+1/3+1/4-1/5+1/6-1/7.............1/n Developer:Aakash Date:03.03.2020 --------------------------------''' a=int(input("Enter the number for which you want sum up=")) i=1;j=2 su=0;sm=0; while(i<=a): su=su+(1/i) i=i+2 print("The odd sum is=",su) while(j<=a): sm=sm+(1/j) j=j+2 print("The even sum is=",sm) print("The desired sum is=",su-sm)
[ "aakash123564@gmail.com" ]
aakash123564@gmail.com
0ef158ff4223440075caf395937a47ef60ba3264
0d8e03c2d3d506a878730b6bedf3af4b714ad431
/dz5/home/models.py
96a0425bc2cee5f83640da9e90eec77074bfbadf
[]
no_license
RyslanaBinko/Django
7baa0e1352fd3ec75aa1ea8967a541be92155e0f
6df5aff2c1b12202ae75e3827c49cd1a43b6f2b8
refs/heads/main
2023-04-01T09:15:42.910096
2021-03-16T10:49:15
2021-03-16T10:49:15
321,369,492
0
0
null
2021-03-16T10:49:16
2020-12-14T14:15:40
Python
UTF-8
Python
false
false
1,587
py
from django.db import models class Student(models.Model): id = models.AutoField(primary_key=True) # noqa name = models.CharField(max_length=200) normalized_name = models.CharField(max_length=200, null=True) age = models.SmallIntegerField(null=True) sex = models.CharField(max_length=200, null=True) address = models.CharField(max_length=200, null=True) description = models.TextField(max_length=200, null=True) birthday = models.DateField(null=True) email = models.CharField(max_length=200, null=True) url = models.CharField(max_length=200, null=True) subject = models.ForeignKey("home.Subject", on_delete=models.SET_NULL, null=True) book = models.OneToOneField("home.Book", on_delete=models.CASCADE, null=True) teacher = models.ManyToManyField("home.Teacher") class Teacher(models.Model): id = models.AutoField(primary_key=True) # noqa name = models.CharField(max_length=200, null=True) class Subject(models.Model): id = models.AutoField(primary_key=True) # noqa title = models.CharField(max_length=200) class Book(models.Model): id = models.AutoField(primary_key=True) # noqa title = models.CharField(max_length=200, null=True) class Currency(models.Model): id = models.AutoField(primary_key=True) # noqa ccy = models.CharField(max_length=5, null=True) base_ccy = models.CharField(max_length=5, null=True) buy = models.FloatField(max_length=200, null=True) sale = models.FloatField(max_length=200, null=True)
[ "binko.ryslana@gmail.com" ]
binko.ryslana@gmail.com
0a85d3a207041fe40d86bcaf79b55bb1e71d6e30
3ac6cc22d2a1c727064f4721a8e4e026dcfbfc9b
/configs/top_down/resnet/mpii/res101_mpii_256x256.py
17e9c7e66d65027869079d8b699e9a86f265eba9
[ "Apache-2.0" ]
permissive
Alex-bd/mmpose
8a3201a40208c4687342ad08ef83c1c79d0e775a
5bf1d8ceafc6ac4c3e1f4fdf10f5a8a0e86ad0e9
refs/heads/master
2022-12-12T00:10:13.368567
2020-08-31T11:15:01
2020-08-31T11:15:01
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,340
py
log_level = 'INFO' load_from = None resume_from = None dist_params = dict(backend='nccl') workflow = [('train', 1)] checkpoint_config = dict(interval=10) evaluation = dict(interval=1, metric='PCKh') optimizer = dict( type='Adam', lr=5e-4, ) optimizer_config = dict(grad_clip=None) # learning policy lr_config = dict( policy='step', warmup='linear', warmup_iters=500, warmup_ratio=0.001, step=[170, 200]) total_epochs = 210 log_config = dict( interval=50, hooks=[ dict(type='TextLoggerHook'), ]) channel_cfg = dict( num_output_channels=16, dataset_joints=16, dataset_channel=list(range(16)), inference_channel=list(range(16))) # model settings model = dict( type='TopDown', pretrained='models/pytorch/imagenet/resnet101-5d3b4d8f.pth', backbone=dict(type='ResNet', depth=101), keypoint_head=dict( type='TopDownSimpleHead', in_channels=2048, out_channels=channel_cfg['num_output_channels'], ), train_cfg=dict(), test_cfg=dict( flip_test=True, post_process=True, shift_heatmap=True, unbiased_decoding=False, modulate_kernel=11), loss_pose=dict(type='JointsMSELoss', use_target_weight=True)) data_cfg = dict( image_size=[256, 256], heatmap_size=[64, 64], num_output_channels=channel_cfg['num_output_channels'], num_joints=channel_cfg['dataset_joints'], dataset_channel=channel_cfg['dataset_channel'], inference_channel=channel_cfg['inference_channel'], use_gt_bbox=True, bbox_file=None, ) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='TopDownRandomFlip', flip_prob=0.5), dict( type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), dict(type='TopDownAffine'), dict(type='ToTensor'), dict( type='NormalizeTensor', mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), dict(type='TopDownGenerateTarget', sigma=2), dict( type='Collect', keys=['img', 'target', 'target_weight'], meta_keys=[ 'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', 'rotation', 'flip_pairs' ]), ] val_pipeline = [ dict(type='LoadImageFromFile'), dict(type='TopDownAffine'), dict(type='ToTensor'), dict( type='NormalizeTensor', mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), dict( type='Collect', keys=[ 'img', ], meta_keys=['image_file', 'center', 'scale', 'rotation', 'flip_pairs']), ] data_root = 'data/mpii' data = dict( samples_per_gpu=64, workers_per_gpu=2, train=dict( type='TopDownMpiiDataset', ann_file=f'{data_root}/annotations/mpii_train.json', img_prefix=f'{data_root}/images/', data_cfg=data_cfg, pipeline=train_pipeline), val=dict( type='TopDownMpiiDataset', ann_file=f'{data_root}/annotations/mpii_val.json', img_prefix=f'{data_root}/images/', data_cfg=data_cfg, pipeline=val_pipeline), test=dict( type='TopDownMpiiDataset', ann_file=f'{data_root}/annotations/mpii_val.json', img_prefix=f'{data_root}/images/', data_cfg=data_cfg, pipeline=val_pipeline), )
[ "noreply@github.com" ]
noreply@github.com
711d23ae5d368b269fb5d365992d30d65c87469d
21bd158545402c0912f303444002c7c8b62720d1
/src/url_storer_test.py
587d54d72613811f37c3d83bf54f7cefe6fedac4
[ "MIT" ]
permissive
Taekyoon/PyCrawler
23ef5cd6971ca00971ffd93380d3f915b75da5ea
93f0ef8bc07436ff70ba9a198b89d2ffa27bcc9e
refs/heads/master
2021-01-20T14:48:31.499910
2017-02-22T08:18:19
2017-02-22T08:18:19
82,775,691
0
0
null
null
null
null
UTF-8
Python
false
false
1,214
py
from url_storer import UrlStorer table_name = 'TEST' def create_database(): UrlStorer('test.db') UrlStorer.create_table(table_name) def close_database(): UrlStorer.close() def get_test(): return UrlStorer.get(table_name) def insert_test(key): UrlStorer.put(table_name,key,1) def exist_test(): UrlStorer.exist(table_name, 'naver.com') def delete_test(): UrlStorer.delete(table_name, 'naver.com') def test(): create_database() insert_test('abc') delete_test() close_database() import os import threading from queue import Queue NUMBER_OF_THREADS = 8 def create_workers(): for _ in range(NUMBER_OF_THREADS): t = threading.Thread(target=work) t.daemon = True t.start() def work(): while True: key = queue.get() for i in range(1000): insert_test(key + str(i)) print("%s: %s of 1000 is done." % (threading.current_thread().name, i+1)) queue.task_done() create_database() queue = Queue() input_list = ['a'*n for n in range(10)] for l in input_list: queue.put(l) create_workers() queue.join() for i,j in get_test(): print(i,j) close_database() os.delete('test.db') #test()
[ "tgchoi03@gmail.com" ]
tgchoi03@gmail.com
bc52f37436a7565189d51e912a3ff824c5577c49
d21326e0e2604431549e80cf025074624f36c6bb
/boneless/test/test_alsru.py
a8fd22835150c7e12b619be0fccb994aac84ee72
[ "0BSD", "Apache-2.0" ]
permissive
zignig/Boneless-CPU
ad9232d82e19c1035f5e10443b81f147d96c4072
10bb571b4efab015e1bf147c78f0b8b3c93443e4
refs/heads/master
2020-04-25T20:29:47.987910
2019-07-05T05:35:18
2019-07-05T05:35:18
173,051,283
0
0
NOASSERTION
2019-02-28T06:06:16
2019-02-28T06:06:15
null
UTF-8
Python
false
false
4,413
py
import unittest import contextlib import random from nmigen import * from nmigen.back.pysim import * from ..gateware.alsru import * class ALSRUTestCase: dut_cls = None def setUp(self): self.checks = 100 self.width = 16 self.dut = self.dut_cls(self.width) @contextlib.contextmanager def assertComputes(self, ctrl, ci=None, si=None): asserts = [] yield(self.dut, asserts) random.seed(0) for _ in range(self.checks): rand_a = random.randint(0, (1 << self.width) - 1) rand_b = random.randint(0, (1 << self.width) - 1) rand_r = random.randint(0, (1 << self.width) - 1) rand_ci = random.randint(0, 1) if ci is None else ci rand_si = random.randint(0, 1) if si is None else si with Simulator(self.dut) as sim: def process(): yield self.dut.ctrl.eq(ctrl) yield self.dut.a.eq(rand_a) yield self.dut.b.eq(rand_b) yield self.dut.r.eq(rand_r) yield self.dut.ci.eq(rand_ci) yield self.dut.si.eq(rand_si) yield Delay() fail = False msg = "for a={:0{}x} b={:0{}x} ci={} si={}:" \ .format(rand_a, self.width // 4, rand_b, self.width // 4, rand_ci, rand_si) for signal, expr in asserts: actual = (yield signal) expect = (yield expr) if expect != actual: fail = True msg += " {}={:0{}x} (expected {:0{}x})"\ .format(signal.name, actual, signal.nbits // 4, expect, signal.nbits // 4) if fail: self.fail(msg) sim.add_process(process) sim.run() def test_A(self): with self.assertComputes(self.dut_cls.CTRL_A, ci=0) as (dut, asserts): asserts += [(dut.o, dut.a)] def test_B(self): with self.assertComputes(self.dut_cls.CTRL_B, ci=0) as (dut, asserts): asserts += [(dut.o, dut.b)] def test_nB(self): with self.assertComputes(self.dut_cls.CTRL_nB, ci=0) as (dut, asserts): asserts += [(dut.o, ~dut.b)] def test_AaB(self): with self.assertComputes(self.dut_cls.CTRL_AaB, ci=0) as (dut, asserts): asserts += [(dut.o, dut.a & dut.b)] def test_AoB(self): with self.assertComputes(self.dut_cls.CTRL_AoB, ci=0) as (dut, asserts): asserts += [(dut.o, dut.a | dut.b)] def test_AxB(self): with self.assertComputes(self.dut_cls.CTRL_AxB, ci=0) as (dut, asserts): asserts += [(dut.o, dut.a ^ dut.b)] def test_ApB(self): with self.assertComputes(self.dut_cls.CTRL_ApB) as (dut, asserts): result = dut.a + dut.b + dut.ci asserts += [(dut.o, result[:self.width]), (dut.co, result[self.width]), (dut.vo, (dut.a[-1] == dut.b[-1]) & (dut.a[-1] != result[self.width - 1]))] def test_AmB(self): with self.assertComputes(self.dut_cls.CTRL_AmB) as (dut, asserts): result = dut.a - dut.b - ~dut.ci asserts += [(dut.o, result[:self.width]), (dut.co, ~result[self.width]), (dut.vo, (dut.a[-1] == ~dut.b[-1]) & (dut.a[-1] != result[self.width - 1]))] def test_SL(self): with self.assertComputes(self.dut_cls.CTRL_SL) as (dut, asserts): result = (dut.r << 1) | dut.si asserts += [(dut.o, result[:self.width]), (dut.so, dut.r[-1])] def test_SR(self): with self.assertComputes(self.dut_cls.CTRL_SR) as (dut, asserts): result = (dut.r >> 1) | (dut.si << (self.width - 1)) asserts += [(dut.o, result[:self.width]), (dut.so, dut.r[0])] class ALSRU_4LUT_TestCase(ALSRUTestCase, unittest.TestCase): dut_cls = ALSRU_4LUT
[ "whitequark@whitequark.org" ]
whitequark@whitequark.org
75fd5e661c51351127197212dce3457ddcf5037a
aea7f59f919992d5b49366552e40d777042a0a7b
/lib/event_handler.py
3a37e9dd98e30b54ad10b8ce6683532b36a01c62
[]
no_license
yogae/serverless-lambdaedge-resize
2f8334aef87a525574abe69562085ed1eb3a2b56
860e01b673f83cc4c186ce8fb7fd8a6a987368aa
refs/heads/master
2022-11-25T04:01:06.916311
2019-10-27T07:55:28
2019-10-27T07:55:28
216,831,630
0
0
null
2022-11-22T04:46:36
2019-10-22T14:16:28
Python
UTF-8
Python
false
false
1,054
py
import urllib def parse_resolution(request): query_string = request.get("querystring", None) if query_string is None: resolution = "origin" else: resolution = urllib.parse.parse_qs(query_string).get("resolution", None) if resolution is None: resolution = "origin" else: resolution = resolution[0] return resolution def parse_origin(request): domain_name = request["origin"]["s3"]["domainName"] bucket_name = domain_name.split(".")[0] return bucket_name class EventHandler: def __init__(self, event): self.event = event def get_request(self): request = self.event["Records"][0]["cf"]["request"] key = request["uri"][1:] if request["uri"].startswith("/") else request["uri"] resolution = parse_resolution(request) bucket_name = parse_origin(request) return dict(resolution = resolution, key = key, bucket_name = bucket_name) def get_response(self): return self.event["Records"][0]["cf"]["response"]
[ "" ]
0baaa732089fcef332a853334b008c15112aac4d
42d51b7f53a88e2808066782cc9786634a9138e5
/recipes/iris_nn.py
7d0721dc3a4c7d17be6d6e61297c965d4b64043c
[]
no_license
kent0304/PyTorchTutorial
64707a3bc8e187a3bddf62a7bafe5afc672d163f
ee0a4bb7904829f06880991bd1cdf4689ce8d912
refs/heads/master
2022-12-11T21:18:38.889200
2020-09-16T07:56:18
2020-09-16T07:56:18
264,959,345
0
0
null
2020-05-18T14:12:51
2020-05-18T14:09:56
Ruby
UTF-8
Python
false
false
1,823
py
from sklearn import datasets import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F iris = datasets.load_iris() # 教師ラベルをダミー変数化する必要はない # y = np.zeros((len(iris.target), 1+iris.target.max()), dtype=int) # y[np.arange(len(iris.target)), iris.target] = 1 y = iris.target from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(iris.data, y, test_size=0.2, random_state=0) X_train = torch.tensor(X_train, dtype=torch.float) y_train = torch.tensor(y_train) class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.fc1 = nn.Linear(4, 10) self.fc2 = nn.Linear(10, 8) self.fc3 = nn.Linear(8, 3) def forward(self, x): x = F.relu(self.fc1(x)) x = F.relu(self.fc2(x)) x = self.fc3(x) return x ### Training # ネットワークのインスタンス化 net = Net() # パラメタータ更新手法、学習率の指定 optimizer = optim.SGD(net.parameters(), lr=0.001) # 目的関数の指定 criterion = nn.CrossEntropyLoss() for i in range(3000): # 古い勾配は削除 optimizer.zero_grad() output = net(X_train) loss = criterion(output, y_train) # バックプロパゲーションを用いて目的関数の微分を計算 loss.backward() optimizer.step() ### Prediction outputs = net(torch.tensor(X_test, dtype=torch.float)) _, predicted = torch.max(outputs.data, 1) # print(outputs.data) # print(torch.max(outputs.data, 1)) # 2つめの引数に1をつけることで、最大値とそのインデックスを順に出力 print(y_test) accuracy = 100 * np.sum(predicted.numpy() == y_test) / len(iris.target) print('accuracy = {:.1f}%'.format(accuracy))
[ "tanaken0304.0123@gmail.com" ]
tanaken0304.0123@gmail.com
3cf839ea331331771691d73a49bad587c20960f2
9952f1a28e430313211b609a73e5fa6ef4b7f976
/lab_1/lab1.3.py
93298e94680584cde666c1e47a5e91f17d03b718
[]
no_license
onlysingle007/labs
f5666dc991d0fb7a14b03623454021635d8a0fc3
f43a3f0d86ab5d370c49690bda6c5053ecf6ad2b
refs/heads/master
2020-12-20T02:45:39.845664
2020-01-30T14:17:51
2020-01-30T14:17:51
235,938,089
0
0
null
null
null
null
UTF-8
Python
false
false
268
py
x=str(input("enter sentence to be checked: ")) print (x) y=len(x) z=a=b=0 for i in x: if i.isalpha(): z=z+1 elif i.isdigit(): a=a+1 else: b=b+1 print("number of alphabets are",z) print("and number of numbers are",a) print("number of special characters are",b)
[ "noreply@github.com" ]
noreply@github.com
acdd334ba1e6d6b647648d7ce04d95c971a8a97c
6b9084d234c87d7597f97ec95808e13f599bf9a1
/Dataset/Utility/youtube_downloader.py
9dfc738aba4989d5f42cfc43fb334b8de60c5b2a
[]
no_license
LitingLin/ubiquitous-happiness
4b46234ce0cb29c4d27b00ec5a60d3eeb52c26fc
aae2d764e136ca4a36c054212b361dd7e8b22cba
refs/heads/main
2023-07-13T19:51:32.227633
2021-08-03T16:02:03
2021-08-03T16:02:03
316,664,903
1
0
null
null
null
null
UTF-8
Python
false
false
1,870
py
import os import subprocess import threading from tqdm import tqdm import shutil def _read_outputs_from_precess(process): def _print_stdout(process): for line_ in iter(process.stdout.readline, ""): if len(line_) > 0: print(line_.strip()) def _print_stderr(process): for line_ in iter(process.stderr.readline, ""): if len(line_) > 0: print(line_.strip()) t1 = threading.Thread(target=_print_stdout, args=(process,)) t2 = threading.Thread(target=_print_stderr, args=(process,)) t1.start() t2.start() t1.join() t2.join() def download_youtube_videos(youtube_id_list, target_path: str, cache_path: str): for youtube_id in tqdm(youtube_id_list): youtube_video_path = os.path.join(target_path, youtube_id) if os.path.exists(youtube_video_path): continue url = f'https://www.youtube.com/watch?v={youtube_id}' # downloading_cache_path = os.path.join(cache_path, youtube_id) temp_path = os.path.join(target_path, f'{youtube_id}.tmp') if os.path.exists(temp_path): shutil.rmtree(temp_path) os.mkdir(temp_path) youtube_dl_output_path = os.path.join(temp_path, '%(title)s-%(id)s.%(ext)s') process = subprocess.Popen(['youtube-dl', '--cache-dir', cache_path, '-o', youtube_dl_output_path, url], stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8') _read_outputs_from_precess(process) process.wait() if process.returncode != 0: print(f'Failed to download video {youtube_id}') continue files = os.listdir(temp_path) if len(files) == 0: print(f'Youtube-dl returns 0, but nothing downloaded in video {youtube_id}') continue os.rename(temp_path, youtube_video_path)
[ "linliting06@live.com" ]
linliting06@live.com
4f2562228bcdf52337ff368b81103a2b007a2635
9d14540c5cc793e10e7aa761cffddbb301004adc
/wide_resnet.py
9f37d8bc2e5753a481218e443c9c67a4fa97f2db
[]
no_license
Liang-yc/will_delete_later
290a1a5f407ad5c801895e2b2e8590d2c6cb94b9
b5208754c1f6e868c53ba529ff32c72d11907de5
refs/heads/master
2022-10-12T10:01:03.456910
2019-08-22T22:50:06
2019-08-22T22:50:06
203,884,669
0
0
null
2022-09-29T12:20:19
2019-08-22T22:49:16
Python
UTF-8
Python
false
false
2,122
py
import keras from keras.models import Model from keras.layers import Dense, Conv2D, BatchNormalization, Activation from keras.layers import Input, Add, GlobalAveragePooling2D, Dropout,PReLU from keras import regularizers weight_decay = 5e-4 def conv3x3(input, out_planes, stride=1): """3x3 convolution with padding""" return Conv2D(out_planes, kernel_size=3, strides=stride, padding='same', use_bias=False, kernel_initializer='he_normal', kernel_regularizer=regularizers.l2(weight_decay))(input) def conv1x1(input, out_planes, stride=1): """1x1 convolution""" return Conv2D(out_planes, kernel_size=1, strides=stride, padding='same', use_bias=False, kernel_initializer='he_normal', kernel_regularizer=regularizers.l2(weight_decay))(input) def BasicBlock(input, planes, dropout, stride=1): inplanes = input._keras_shape[3] out = BatchNormalization()(input) out = PReLU()(out) out = conv3x3(out, planes, stride) out = BatchNormalization()(out) out = PReLU()(out) out = Dropout(dropout)(out) out = conv3x3(out, planes) if stride != 1 or inplanes != planes: shortcut = conv1x1(input, planes, stride) else: shortcut = out out = Add()([out, shortcut]) return out def WideResNet(depth, width, num_classes=10, dropout=0.3,include_top=True): layer = (depth - 4) // 6 input = Input(shape=(28,28,1)) x = conv3x3(input, 16) for _ in range(layer): x = BasicBlock(x, 16*width, dropout) x = BasicBlock(x, 32*width, dropout, 2) for _ in range(layer-1): x = BasicBlock(x, 32*width, dropout) x = BasicBlock(x, 64*width, dropout, 2) for _ in range(layer-1): x = BasicBlock(x, 64*width, dropout) x = BatchNormalization()(x) x = PReLU()(x) x = GlobalAveragePooling2D()(x) if include_top: output = Dense(num_classes, activation='softmax', kernel_regularizer=regularizers.l2(weight_decay))(x) model = Model(input, output) model.summary() return model return x
[ "noreply@github.com" ]
noreply@github.com
68e5589fe85596c30ef2e358b26b9a438f01ad92
0f7e18a483a44352dfac27137b8d351416f1d1bb
/application.py
c5bacc7030432a73f7dc538367825d6dc44c5983
[]
no_license
rinoshinme/slim_finetune
b5ec4ed53a2d6c15dfa5b4cfb73677ccb58a4aa6
1e465e3faff668e65cc873828057365114d4cfb1
refs/heads/master
2022-11-07T21:02:38.253001
2022-11-02T14:48:45
2022-11-02T14:48:45
199,089,723
0
0
null
null
null
null
UTF-8
Python
false
false
45
py
from app.nsfw_process import NSFWProcessor
[ "rinoshinme@163.com" ]
rinoshinme@163.com
c81a40039c0c97890bc37a375a712236114ae380
1122bcd042953f085835483ca7809c7dfeac21e2
/Gluon/k_means/main.py
81e2ccb65324768e76ebb32bdd7d4405119e1af7
[]
no_license
nguyen-viet-hung/Mxnet_Tutorial
7b293db2f415720e144e4e506d5fd3678fbedeb4
9892dbd91377476f8482baff473ae2c74105faff
refs/heads/master
2020-12-29T13:56:58.804003
2018-03-07T18:39:39
2018-03-07T18:39:39
null
0
0
null
null
null
null
UTF-8
Python
false
false
124
py
import mxnet as mx import kmeans kmeans.K_means_Algorithm(epoch=5000,centroid_numbers=10,point_numbers=5000,ctx=mx.gpu(0))
[ "medical18@naver.com" ]
medical18@naver.com
5d6557971ba1b18c0b15b18bead81f318c365147
87a22d7b301bb0234f813c5f142446f9d409e024
/vumi_http_retry/workers/sender/tests/test_worker.py
4235e92ef4ec536e996b3b1bb22f5a0259e6b174
[ "BSD-2-Clause" ]
permissive
praekelt/vumi-http-retry-api
9dad08ceef614fc9a5dc358cd45ec1927231706c
01c1e5635b2d281986de66489582be0a7bd8e040
refs/heads/develop
2021-01-02T22:45:36.606706
2017-06-09T14:28:33
2017-06-09T14:28:33
39,622,844
0
0
null
2017-06-09T14:21:40
2015-07-24T09:15:25
Python
UTF-8
Python
false
false
21,699
py
from twisted.internet import reactor from twisted.internet.task import Clock from twisted.trial.unittest import TestCase from twisted.internet.defer import ( inlineCallbacks, returnValue, DeferredQueue, Deferred) from vumi_http_retry.workers.sender.worker import RetrySenderWorker from vumi_http_retry.retries import ( set_req_count, get_req_count, pending_key, ready_key, add_ready) from vumi_http_retry.tests.redis import zitems, lvalues, delete from vumi_http_retry.tests.utils import ( Counter, ToyServer, ManualReadable, ManualWritable, pop_all) class TestRetrySenderWorker(TestCase): @inlineCallbacks def teardown_worker(self, worker): yield delete(worker.redis, 'test.*') yield worker.teardown() @inlineCallbacks def mk_worker(self, config=None): if config is None: config = {} config['redis_prefix'] = 'test' config.setdefault('overrides', {}).update({'persistent': False}) worker = RetrySenderWorker(config) self.patch_reactor_stop() yield worker.setup(Clock()) self.addCleanup(self.teardown_worker, worker) returnValue(worker) def patch_retry(self): reqs = DeferredQueue() def retry(req): reqs.put(req) self.patch(RetrySenderWorker, 'retry', staticmethod(retry)) return reqs def patch_next_req(self): pops = [] def pop(): d = Deferred() pops.append(d) return d self.patch(RetrySenderWorker, 'next_req', staticmethod(pop)) return pops def patch_poll(self, fn): self.patch(RetrySenderWorker, 'poll', fn) def patch_on_error(self): errors = [] def on_error(f): errors.append(f.value) self.patch(RetrySenderWorker, 'on_error', staticmethod(on_error)) return errors def patch_reactor_stop(self): c = Counter() self.patch(RetrySenderWorker, 'stop_reactor', c.inc) return c def patch_reactor_call_later(self, clock): self.patch(reactor, 'callLater', clock.callLater) def patch_log(self): msgs = [] def logger(*msg): msgs.append(msg) self.patch(RetrySenderWorker, 'log', staticmethod(logger)) return msgs @inlineCallbacks def test_retry(self): msgs = self.patch_log() worker = yield self.mk_worker() yield worker.stop() srv = yield ToyServer.from_test(self) reqs = [] @srv.app.route('/foo') def route(req): reqs.append(req) req = { 'owner_id': '1234', 'timestamp': 5, 'attempts': 0, 'intervals': [10], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } } pop_all(msgs) yield worker.retry(req) self.assertEqual(pop_all(msgs), [ ('Retrying request', req), ('Retry successful (200)', req), ]) [req] = reqs self.assertEqual(req.method, 'POST') self.assertEqual((yield zitems(worker.redis, pending_key('test'))), []) @inlineCallbacks def test_retry_reschedule(self): msgs = self.patch_log() worker = yield self.mk_worker() srv = yield ToyServer.from_test(self) yield worker.stop() @srv.app.route('/foo') def route(req): req.setResponseCode(500) req1 = { 'owner_id': '1234', 'timestamp': 5, 'attempts': 0, 'intervals': [10, 20], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } } req2 = { 'owner_id': '1234', 'timestamp': 10, 'attempts': 0, 'intervals': [10, 30], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } } pop_all(msgs) yield worker.retry(req1) self.assertEqual(pop_all(msgs), [ ('Retrying request', req1), ('Retry failed (500)', req1), ('Rescheduling retry', req1), ]) yield worker.retry(req2) self.assertEqual(pop_all(msgs), [ ('Retrying request', req2), ('Retry failed (500)', req2), ('Rescheduling retry', req2), ]) pending = yield zitems(worker.redis, pending_key('test')) self.assertEqual(pending, [ (5 + 20, { 'owner_id': '1234', 'timestamp': 5, 'attempts': 1, 'intervals': [10, 20], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } }), (10 + 30, { 'owner_id': '1234', 'timestamp': 10, 'attempts': 1, 'intervals': [10, 30], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } }) ]) @inlineCallbacks def test_retry_end(self): msgs = self.patch_log() worker = yield self.mk_worker() srv = yield ToyServer.from_test(self) yield worker.stop() @srv.app.route('/foo') def route(req): req.setResponseCode(500) req1 = { 'owner_id': '1234', 'timestamp': 5, 'attempts': 1, 'intervals': [10, 20], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } } req2 = { 'owner_id': '1234', 'timestamp': 10, 'attempts': 2, 'intervals': [10, 30, 40], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } } pop_all(msgs) yield worker.retry(req1) self.assertEqual(pop_all(msgs), [ ('Retrying request', req1), ('Retry failed (500)', req1), ('No remaining retry intervals, discarding request', req1), ]) yield worker.retry(req2) self.assertEqual(pop_all(msgs), [ ('Retrying request', req2), ('Retry failed (500)', req2), ('No remaining retry intervals, discarding request', req2), ]) self.assertEqual((yield zitems(worker.redis, pending_key('test'))), []) @inlineCallbacks def test_retry_timeout_reschedule(self): k = pending_key('test') msgs = self.patch_log() worker = yield self.mk_worker({'timeout': 3}) srv = yield ToyServer.from_test(self) self.patch_reactor_call_later(worker.clock) yield worker.stop() @srv.app.route('/foo') def route(req): return Deferred() req = { 'owner_id': '1234', 'timestamp': 5, 'attempts': 0, 'intervals': [10, 20], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } } pop_all(msgs) d = worker.retry(req) worker.clock.advance(2) self.assertEqual((yield zitems(worker.redis, k)), []) worker.clock.advance(4) yield d self.assertEqual(pop_all(msgs), [ ('Retrying request', req), ('Retry timed out', req), ('Rescheduling retry', req), ]) self.assertEqual((yield zitems(worker.redis, k)), [ (5 + 20, { 'owner_id': '1234', 'timestamp': 5, 'attempts': 1, 'intervals': [10, 20], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } }), ]) @inlineCallbacks def test_retry_timeout_end(self): k = pending_key('test') msgs = self.patch_log() worker = yield self.mk_worker({'timeout': 3}) srv = yield ToyServer.from_test(self) self.patch_reactor_call_later(worker.clock) yield worker.stop() @srv.app.route('/foo') def route(req): return Deferred() req = { 'owner_id': '1234', 'timestamp': 5, 'attempts': 1, 'intervals': [10, 20], 'request': { 'url': "%s/foo" % (srv.url,), 'method': 'POST' } } pop_all(msgs) d = worker.retry(req) worker.clock.advance(2) self.assertEqual((yield zitems(worker.redis, k)), []) worker.clock.advance(4) yield d self.assertEqual(pop_all(msgs), [ ('Retrying request', req), ('Retry timed out', req), ('No remaining retry intervals, discarding request', req), ]) self.assertEqual((yield zitems(worker.redis, k)), []) @inlineCallbacks def test_retry_dec_req_count_success(self): worker = yield self.mk_worker() srv = yield ToyServer.from_test(self) @srv.app.route('/') def route(req): pass yield set_req_count(worker.redis, 'test', '1234', 3) yield worker.retry({ 'owner_id': '1234', 'timestamp': 5, 'attempts': 1, 'intervals': [10, 20], 'request': { 'url': srv.url, 'method': 'GET' } }) self.assertEqual( (yield get_req_count(worker.redis, 'test', '1234')), 2) @inlineCallbacks def test_retry_dec_req_count_no_reattempt(self): worker = yield self.mk_worker() srv = yield ToyServer.from_test(self) @srv.app.route('/') def route(req): pass yield set_req_count(worker.redis, 'test', '1234', 3) yield worker.retry({ 'owner_id': '1234', 'timestamp': 5, 'attempts': 1, 'intervals': [10, 20], 'request': { 'url': srv.url, 'method': 'GET' } }) self.assertEqual( (yield get_req_count(worker.redis, 'test', '1234')), 2) @inlineCallbacks def test_retry_no_dec_req_count_on_reattempt(self): worker = yield self.mk_worker() srv = yield ToyServer.from_test(self) @srv.app.route('/') def route(req): req.setResponseCode(500) yield set_req_count(worker.redis, 'test', '1234', 3) yield worker.retry({ 'owner_id': '1234', 'timestamp': 5, 'attempts': 0, 'intervals': [10, 20], 'request': { 'url': srv.url, 'method': 'GET' } }) self.assertEqual( (yield get_req_count(worker.redis, 'test', '1234')), 3) @inlineCallbacks def test_loop(self): k = ready_key('test') msgs = self.patch_log() retries = self.patch_retry() worker = yield self.mk_worker({'frequency': 5}) reqs = [{ 'owner_id': '1234', 'timestamp': t, 'attempts': 0, 'intervals': [10], 'request': {'foo': t} } for t in range(5, 30, 5)] yield add_ready(worker.redis, 'test', reqs) self.assertEqual(pop_all(msgs), [ ('Polling for requests to retry',), ('Retrieving next request from ready set',), ('Ready set is empty, rechecking on next poll',), ]) worker.clock.advance(5) req = yield retries.get() self.assertEqual(req, reqs[0]) self.assertEqual((yield lvalues(worker.redis, k)), reqs[1:]) self.assertEqual(pop_all(msgs), [ ('Polling for requests to retry',), ('Retrieving next request from ready set',), ('Scheduling request for retrying', reqs[0]), ('Retrieving next request from ready set',), ]) req = yield retries.get() self.assertEqual(req, reqs[1]) self.assertEqual((yield lvalues(worker.redis, k)), reqs[2:]) self.assertEqual(pop_all(msgs), [ ('Scheduling request for retrying', reqs[1]), ('Retrieving next request from ready set',), ]) req = yield retries.get() self.assertEqual(req, reqs[2]) self.assertEqual((yield lvalues(worker.redis, k)), reqs[3:]) self.assertEqual(pop_all(msgs), [ ('Scheduling request for retrying', reqs[2]), ('Retrieving next request from ready set',), ]) req = yield retries.get() self.assertEqual(req, reqs[3]) self.assertEqual((yield lvalues(worker.redis, k)), reqs[4:]) self.assertEqual(pop_all(msgs), [ ('Scheduling request for retrying', reqs[3]), ('Retrieving next request from ready set',), ]) req = yield retries.get() self.assertEqual(req, reqs[4]) self.assertEqual((yield lvalues(worker.redis, k)), []) self.assertEqual(pop_all(msgs), [ ('Scheduling request for retrying', reqs[4]), ('Retrieving next request from ready set',), ]) worker.clock.advance(10) reqs = [{ 'owner_id': '1234', 'timestamp': t, 'attempts': 0, 'intervals': [10], 'request': {'foo': t} } for t in range(5, 15, 5)] yield add_ready(worker.redis, 'test', reqs) self.assertEqual(pop_all(msgs), [ ('Ready set is empty, rechecking on next poll',), ]) worker.clock.advance(5) req = yield retries.get() self.assertEqual(req, reqs[0]) self.assertEqual((yield lvalues(worker.redis, k)), reqs[1:]) self.assertEqual(pop_all(msgs), [ ('Polling for requests to retry',), ('Retrieving next request from ready set',), ('Scheduling request for retrying', reqs[0]), ('Retrieving next request from ready set',), ]) worker.clock.advance(5) req = yield retries.get() self.assertEqual(req, reqs[1]) self.assertEqual((yield lvalues(worker.redis, k)), []) self.assertEqual(pop_all(msgs), [ ('Scheduling request for retrying', reqs[1]), ('Retrieving next request from ready set',), ]) @inlineCallbacks def test_loop_error(self): e = Exception(':/') def bad_poll(): raise e errors = self.patch_on_error() self.patch_poll(staticmethod(bad_poll)) worker = yield self.mk_worker({'frequency': 5}) self.assertEqual(errors, [e]) worker.clock.advance(5) self.assertEqual(errors, [e]) worker.clock.advance(5) self.assertEqual(errors, [e]) @inlineCallbacks def test_loop_concurrency_limit(self): r = ManualReadable([1, 2, 3, 4, 5]) w = ManualWritable() self.patch(RetrySenderWorker, 'next_req', staticmethod(r.read)) self.patch(RetrySenderWorker, 'retry', staticmethod(w.write)) yield self.mk_worker({ 'frequency': 5, 'concurrency_limit': 2, }) # We haven't yet started any retries self.assertEqual(r.unread, [2, 3, 4, 5]) self.assertEqual(r.reading, [1]) self.assertEqual(w.writing, []) self.assertEqual(w.written, []) # We've started retrying request 1 and still have space yield r.next() self.assertEqual(r.unread, [3, 4, 5]) self.assertEqual(r.reading, [2]) self.assertEqual(w.writing, [1]) self.assertEqual(w.written, []) # We've started retrying request 2 and are at capacity yield r.next() self.assertEqual(r.unread, [4, 5]) self.assertEqual(r.reading, [3]) self.assertEqual(w.writing, [1, 2]) self.assertEqual(w.written, []) # We've read request 3 from redis but haven't retried it yet, since we # are waiting for request 1 and 2 to complete yield r.next() self.assertEqual(r.unread, [4, 5]) self.assertEqual(r.reading, []) self.assertEqual(w.writing, [1, 2]) self.assertEqual(w.written, []) # Request 1 has completed, so we have space to start retrying # request 3 and ask redis for request 4. yield w.next() self.assertEqual(r.unread, [5]) self.assertEqual(r.reading, [4]) self.assertEqual(w.writing, [2, 3]) self.assertEqual(w.written, [1]) # We've read request 4 from redis but haven't retried it yet, since we # are waiting for request 2 and 3 to complete yield r.next() self.assertEqual(r.unread, [5]) self.assertEqual(r.reading, []) self.assertEqual(w.writing, [2, 3]) self.assertEqual(w.written, [1]) # Request 2 has completed, so we have space to start retrying # request 3 and ask redis for request 5. yield w.next() self.assertEqual(r.unread, []) self.assertEqual(r.reading, [5]) self.assertEqual(w.writing, [3, 4]) self.assertEqual(w.written, [1, 2]) # Request 3 and 4 complete while we are waiting for request 5 # from redis yield w.next() yield w.next() self.assertEqual(r.unread, []) self.assertEqual(r.reading, [5]) self.assertEqual(w.writing, []) self.assertEqual(w.written, [1, 2, 3, 4]) # We've read request 5 from redis and started retrying it yield r.next() self.assertEqual(r.unread, []) self.assertEqual(r.reading, []) self.assertEqual(w.writing, [5]) self.assertEqual(w.written, [1, 2, 3, 4]) # We've retried request 5. Redis says we have nothing more to read, so # we are done. yield w.next() self.assertEqual(r.unread, []) self.assertEqual(r.reading, []) self.assertEqual(w.writing, []) self.assertEqual(w.written, [1, 2, 3, 4, 5]) @inlineCallbacks def test_loop_retry_err(self): e1 = Exception() e3 = Exception() errors = self.patch_on_error() r = ManualReadable([1, 2, 3]) w = ManualWritable() self.patch(RetrySenderWorker, 'next_req', staticmethod(r.read)) self.patch(RetrySenderWorker, 'retry', staticmethod(w.write)) yield self.mk_worker({ 'frequency': 5, 'concurrency_limit': 2, }) # We've read all three requests from redis and are busy retrying the # first two yield r.next() yield r.next() yield r.next() self.assertEqual(errors, []) self.assertEqual(r.unread, []) self.assertEqual(r.reading, []) self.assertEqual(w.writing, [1, 2]) self.assertEqual(w.written, []) # Retry 1 throws an error, we catch it. We now have space for # request 3. yield w.err(e1) self.assertEqual(errors, [e1]) self.assertEqual(r.unread, []) self.assertEqual(r.reading, []) self.assertEqual(w.writing, [2, 3]) self.assertEqual(w.written, []) # Retry 2 succeeds. yield w.next() self.assertEqual(errors, [e1]) self.assertEqual(r.unread, []) self.assertEqual(r.reading, []) self.assertEqual(w.writing, [3]) self.assertEqual(w.written, [2]) # Retry 3 throws an error, we catch it. yield w.err(e3) self.assertEqual(errors, [e1, e3]) self.assertEqual(r.unread, []) self.assertEqual(r.reading, []) self.assertEqual(w.writing, []) self.assertEqual(w.written, [2]) @inlineCallbacks def test_stop_after_pop_non_empty(self): """ If the loop was stopped, but we've already asked redis for the next request, we should retry the request. """ retries = self.patch_retry() pops = self.patch_next_req() worker = yield self.mk_worker({'frequency': 5}) self.assertTrue(worker.started) worker.stop() self.assertTrue(worker.stopping) popped_req = { 'owner_id': '1234', 'timestamp': 5, 'attempts': 0, 'intervals': [10], 'request': {'foo': 5} } pops.pop().callback(popped_req) req = yield retries.get() self.assertEqual(req, popped_req) self.assertEqual(pops, []) self.assertTrue(worker.stopped) @inlineCallbacks def test_config_redis_db(self): worker = yield self.mk_worker({ 'redis_prefix': 'test', 'redis_db': 1 }) yield worker.redis.set('test.foo', 'bar') yield worker.redis.select(1) self.assertEqual((yield worker.redis.get('test.foo')), 'bar') @inlineCallbacks def test_on_error(self): worker = yield self.mk_worker() stops = self.patch_reactor_stop() yield worker.stop() self.assertEqual(self.flushLoggedErrors(), []) self.assertEqual(stops.value, 0) err = Exception() worker.on_error(err) self.assertEqual([e.value for e in self.flushLoggedErrors()], [err]) self.assertEqual(stops.value, 1)
[ "justinvdm.0.1.0@gmail.com" ]
justinvdm.0.1.0@gmail.com
ad4c83cd892a3de7b7eb7a93417326f79ec89583
34e9126f2044f1a38841e22563d3742a56cc24d4
/ez-bof-exploit.py
c946f80877bf8ccd229cbcf1371244238d953095
[]
no_license
Ko-kn3t/my-oscp
d2a40c5990d41f93e99e43e262402a83aab0fa36
1fe6ec31fa24f61d20483ba2f47e430181365df7
refs/heads/master
2023-06-06T17:41:29.269723
2021-07-09T20:05:24
2021-07-09T20:05:24
null
0
0
null
null
null
null
UTF-8
Python
false
false
436
py
import socket ip = "192.168.34.110" port = 4455 prefix = "OVRFLW " offset = 0 overflow = "A" * offset retn = "" padding = "" payload = "" postfix = "" buffer = prefix + overflow + retn + padding + payload + postfix s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.connect((ip, port)) print("Sending evil buffer...") s.send(bytes(buffer + "\r\n", "latin-1")) print("Done!") except: print("Could not connect.")
[ "noreply@github.com" ]
noreply@github.com
1be2af53fa6f016ff4072f573289d49e119594b7
ca4b0be8f4ead842938c2f82254d5ebb781140be
/models/bilstm.py
1f86e8cd2c213d8029750f61fcb01a531bc88333
[ "Apache-2.0" ]
permissive
wuba/qa_match
27bd64df81800329dfc88cda42a1e8afbd7d8308
f74ffeb4a66589eb383a6c251b0a7413e0be7f20
refs/heads/master
2022-07-23T06:07:58.383905
2022-07-19T02:49:05
2022-07-19T02:49:05
245,431,046
348
90
NOASSERTION
2021-06-04T07:24:02
2020-03-06T13:47:37
Python
UTF-8
Python
false
false
7,273
py
# coding=utf-8 """ a bi-lstm implementation for short text classification using tensroflow library """ from __future__ import print_function import tensorflow as tf from tensorflow.contrib import rnn class BiLSTM(object): def __init__(self, FLAGS): """Constructor for BiLSTM Args: FLAGS: tf.app.flags, you can see the FLAGS of run_bi_lstm.py """ self.input_x = tf.placeholder(tf.int64, [None, FLAGS.seq_length], name="input_x") self.input_y = tf.placeholder(tf.int64, [None, ], name="input_y") self.x_len = tf.placeholder(tf.int64, [None, ], name="x_len") self.dropout_keep_prob = tf.placeholder(tf.float32, name="dropout_keep_prob") with tf.variable_scope("embedding", initializer=tf.orthogonal_initializer()): with tf.device('/cpu:0'): # word embedding table self.vocab = tf.get_variable('w', [FLAGS.vocab_size, FLAGS.embedding_size]) embedded = tf.nn.embedding_lookup(self.vocab, self.input_x) # [batch_size, seq_length, embedding_size] inputs = tf.split(embedded, FLAGS.seq_length, 1) # [[batch_size, 1, embedding_size], [batch_size, 1, embedding_size], number is seq_length] inputs = [tf.squeeze(input_, [1]) for input_ in inputs] # [[batch_size, embedding_size], [batch_size, embedding_size], number is seq_length] with tf.variable_scope("encoder", initializer=tf.orthogonal_initializer()): lstm_fw_cell = rnn.BasicLSTMCell(FLAGS.num_units) lstm_bw_cell = rnn.BasicLSTMCell(FLAGS.num_units) lstm_fw_cell_stack = rnn.MultiRNNCell([lstm_fw_cell] * FLAGS.lstm_layers, state_is_tuple=True) lstm_bw_cell_stack = rnn.MultiRNNCell([lstm_bw_cell] * FLAGS.lstm_layers, state_is_tuple=True) lstm_fw_cell_stack = rnn.DropoutWrapper(lstm_fw_cell_stack, input_keep_prob=self.dropout_keep_prob, output_keep_prob=self.dropout_keep_prob) lstm_bw_cell_stack = rnn.DropoutWrapper(lstm_bw_cell_stack, input_keep_prob=self.dropout_keep_prob, output_keep_prob=self.dropout_keep_prob) self.outputs, self.fw_st, self.bw_st = rnn.static_bidirectional_rnn(lstm_fw_cell_stack, lstm_bw_cell_stack, inputs, sequence_length=self.x_len, dtype=tf.float32) # multi-layer # only use the last layer last_layer_no = FLAGS.lstm_layers - 1 self.states = tf.concat([self.fw_st[last_layer_no].h, self.bw_st[last_layer_no].h], 1) # [batchsize, (num_units * 2)] attention_size = 2 * FLAGS.num_units with tf.variable_scope('attention'): attention_w = tf.Variable(tf.truncated_normal([2 * FLAGS.num_units, attention_size], stddev=0.1), name='attention_w') # [num_units * 2, num_units * 2] attention_b = tf.get_variable("attention_b", initializer=tf.zeros([attention_size])) # [num_units * 2] u_list = [] for index in range(FLAGS.seq_length): u_t = tf.tanh(tf.matmul(self.outputs[index], attention_w) + attention_b) # [batchsize, num_units * 2] u_list.append(u_t) # seq_length * [batchsize, num_units * 2] u_w = tf.Variable(tf.truncated_normal([attention_size, 1], stddev=0.1), name='attention_uw') # [num_units * 2, 1] attn_z = [] for index in range(FLAGS.seq_length): z_t = tf.matmul(u_list[index], u_w) attn_z.append(z_t) # seq_length * [batchsize, 1] # transform to batch_size * sequence_length attn_zconcat = tf.concat(attn_z, axis=1) # [batchsize, seq_length] alpha = tf.nn.softmax(attn_zconcat) # [batchsize, seq_length] # transform to sequence_length * batch_size * 1 , same rank as outputs alpha_trans = tf.reshape(tf.transpose(alpha, [1, 0]), [FLAGS.seq_length, -1, 1]) # [seq_length, batchsize, 1] self.final_output = tf.reduce_sum(self.outputs * alpha_trans, 0) # [batchsize, num_units * 2] with tf.variable_scope("output_layer"): weights = tf.get_variable("weights", [2 * FLAGS.num_units, FLAGS.label_size]) biases = tf.get_variable("biases", initializer=tf.zeros([FLAGS.label_size])) with tf.variable_scope("acc"): # use attention self.logits = tf.matmul(self.final_output, weights) + biases # [batchsize, label_size] # not use attention # self.logits = tf.matmul(self.states, weights) + biases self.prediction = tf.nn.softmax(self.logits, name="prediction_softmax") # [batchsize, label_size] self.loss = tf.reduce_mean( tf.nn.sparse_softmax_cross_entropy_with_logits(logits=self.logits, labels=self.input_y)) self.global_step = tf.train.get_or_create_global_step() self.correct = tf.equal(tf.argmax(self.prediction, 1), self.input_y) self.acc = tf.reduce_mean(tf.cast(self.correct, tf.float32)) _, self.arg_index = tf.nn.top_k(self.prediction, k=FLAGS.label_size) # [batch_size, label_size] with tf.variable_scope('training'): # optimizer self.learning_rate = tf.train.exponential_decay(FLAGS.lr, self.global_step, 200, 0.96, staircase=True) self.train_step = tf.train.AdamOptimizer(self.learning_rate).minimize(self.loss, global_step=self.global_step) self.saver = tf.train.Saver(tf.global_variables(), max_to_keep=2) def export_model(self, export_path, sess): builder = tf.saved_model.builder.SavedModelBuilder(export_path) tensor_info_x = tf.saved_model.utils.build_tensor_info(self.input_x) tensor_info_y = tf.saved_model.utils.build_tensor_info(self.prediction) tensor_info_len = tf.saved_model.utils.build_tensor_info(self.x_len) tensor_dropout_keep_prob = tf.saved_model.utils.build_tensor_info(self.dropout_keep_prob) # 1.0 for inference prediction_signature = ( tf.saved_model.signature_def_utils.build_signature_def( inputs={'input': tensor_info_x, 'sen_len': tensor_info_len, 'dropout_keep_prob': tensor_dropout_keep_prob}, outputs={'output': tensor_info_y}, method_name=tf.saved_model.signature_constants.PREDICT_METHOD_NAME)) legacy_init_op = None builder.add_meta_graph_and_variables(sess, [tf.saved_model.tag_constants.SERVING], signature_def_map={'prediction': prediction_signature, }, legacy_init_op=legacy_init_op, clear_devices=True, saver=self.saver) builder.save()
[ "herui02@58.com" ]
herui02@58.com
c38baec5d263b52e5b8b07f604db735e512f235b
5a52ccea88f90dd4f1acc2819997fce0dd5ffb7d
/alipay/aop/api/domain/KbIsvMaCode.py
fa25c52f96b6b0de55cd7ffaf33dc6023902ce7c
[ "Apache-2.0" ]
permissive
alipay/alipay-sdk-python-all
8bd20882852ffeb70a6e929038bf88ff1d1eff1c
1fad300587c9e7e099747305ba9077d4cd7afde9
refs/heads/master
2023-08-27T21:35:01.778771
2023-08-23T07:12:26
2023-08-23T07:12:26
133,338,689
247
70
Apache-2.0
2023-04-25T04:54:02
2018-05-14T09:40:54
Python
UTF-8
Python
false
false
1,183
py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class KbIsvMaCode(object): def __init__(self): self._code = None self._num = None @property def code(self): return self._code @code.setter def code(self, value): self._code = value @property def num(self): return self._num @num.setter def num(self, value): self._num = value def to_alipay_dict(self): params = dict() if self.code: if hasattr(self.code, 'to_alipay_dict'): params['code'] = self.code.to_alipay_dict() else: params['code'] = self.code if self.num: if hasattr(self.num, 'to_alipay_dict'): params['num'] = self.num.to_alipay_dict() else: params['num'] = self.num return params @staticmethod def from_alipay_dict(d): if not d: return None o = KbIsvMaCode() if 'code' in d: o.code = d['code'] if 'num' in d: o.num = d['num'] return o
[ "liuqun.lq@alibaba-inc.com" ]
liuqun.lq@alibaba-inc.com
609d3a6c31bdda855c9cdee73943267fea809e40
9645bdfbb15742e0d94e3327f94471663f32061a
/Python/719 - Find K-th Smallest Pair Distance/719_find-k-th-smallest-pair-distance.py
8370a768504118d06936fb1274d64a87cac376a5
[]
no_license
aptend/leetcode-rua
f81c080b2260adb2da677612e5c437eda256781d
80e44f4e9d3a5b592fdebe0bf16d1df54e99991e
refs/heads/master
2023-06-22T00:40:05.533424
2021-03-17T13:51:28
2021-03-17T13:51:28
186,434,133
2
0
null
2023-06-21T22:12:51
2019-05-13T14:17:27
HTML
UTF-8
Python
false
false
609
py
from leezy import Solution, solution from heapq import heappush, heappop class Q719(Solution): @solution def smallestDistancePair(self, nums, k): # MLE A = sorted(nums) N = len(A) heap = [] def push(i, j): heappush(heap, (abs(A[i]-A[j]), i, j)) for i in range(N-1): push(i, i+1) for _ in range(k): ans, i, j = heappop(heap) if j < N-1: push(i, j+1) return ans def main(): q = Q719() q.add_args([1, 3, 1], 1) q.run() if __name__ == "__main__": main()
[ "crescentwhale@hotmail.com" ]
crescentwhale@hotmail.com
ad46c5cf701393737c5af474da5fe9ea2f31a1c9
56554999cdd882b6a6701b2a09e148c1fa4465c8
/scramble.py
c9cd6805db2f8759634629df0b007e63d9a93de0
[]
no_license
theriley106/Cubuyo
a266bd97fb82a8443785b40151222f68901a4bb2
38fb8caf2cb395c3df2274fd0651b51c621a5723
refs/heads/master
2020-04-11T17:17:43.095793
2018-12-16T02:34:15
2018-12-16T02:34:15
161,955,403
2
0
null
null
null
null
UTF-8
Python
false
false
645
py
import random import re Notation = ["R", "R'", "L", "L'", "U", "U'", "F", "F'", "B", "B'"] def genNew(length): Scramble = [] while len(Scramble) < length: Move = random.choice(Notation) MoveStr = " ".join(re.findall("[a-zA-Z]+", str(Move))) PreviousMove = Scramble[-1:] PreviousMove = " ".join(re.findall("[a-zA-Z]+", str(PreviousMove))) if MoveStr != PreviousMove: Num = random.randint(1,3) if Num == 1 or Num == 3: Scramble.append(Move) else: if "'" in str(Move): Move = str(Move).replace("'", "") Scramble.append('{}2'.format(Move)) T = "" for moves in Scramble: T = T + " " + str(moves) return T
[ "christopherlambert106@gmail.com" ]
christopherlambert106@gmail.com
f46874aae652fa3eb63244fb046e91dd42da42aa
80e152f49b355b3e07faaab6b468ca8dda6aa097
/python/streamlit-sample/align-epub/epub.py
94f4c812edb5b0b8ffabe802589336488cf1e1ca
[]
no_license
Pitrified/snippet
13ad9222f584570b10abb23a122b010b088eb366
1d7e5657014b00612cde87b78d5506a9e8b6adfc
refs/heads/master
2023-05-25T16:14:42.133900
2023-04-19T18:20:32
2023-04-19T18:20:32
174,192,523
2
0
null
2023-05-01T23:48:48
2019-03-06T17:47:16
Python
UTF-8
Python
false
false
10,849
py
"""Class to load an EPub in memory and analyze it. Split in chapter, paragraph, sentences. Sentences are translated. """ import re import zipfile from collections import Counter from pathlib import Path from typing import IO, Literal, Union from bs4 import BeautifulSoup, Tag from spacy.language import Language from spacy.tokens import Doc, Span from cached_pipe import TranslationPipelineCache VALID_CHAP_EXT = [".xhtml", ".xml", ".html"] class Paragraph: """Paragraph class. Split the paragraph in sentences using spacy and translate them using huggingface. """ def __init__( self, p_tag: Tag, chapter: "Chapter", ) -> None: """Initialize a paragraph. TODO: Filter sentences that are too short? Do not split in sentences if the par is short. Merge short sentences. """ self.chapter = chapter self.nlp: dict[str, Language] = self.chapter.nlp self.pipe: dict[str, TranslationPipelineCache] = self.chapter.pipe self.lang_orig: str = self.chapter.lang_orig self.lang_dest: str = self.chapter.lang_dest self.lang_tr = f"{self.lang_orig}_{self.lang_dest}" self.p_tag = p_tag # MAYBE: move to method that does clean up well self.par_str = str(self.p_tag.string) # we want a str, not a NavigableString self.par_str = self.par_str.replace("\n\r", " ") self.par_str = self.par_str.replace("\n", " ") self.par_str = self.par_str.replace("\r", " ") self.par_doc = self.nlp[self.lang_orig](self.par_str) self.sents_orig = list(self.par_doc.sents) self.sents_tran: list[Doc] = [] for sent in self.sents_orig: str_tran = self.pipe[self.lang_tr](sent.text) # sent_tran = self.nlp[self.lang_dest](str_tran[0]["translation_text"]) sent_tran = self.nlp[self.lang_dest](str_tran) self.sents_tran.append(sent_tran) class Chapter: """Chapter class. Parse the chapter content to find the Paragraphs in <p> tags. """ def __init__( self, chap_content: bytes, chap_file_name: str, epub: "EPub", ) -> None: """Initialize a chapter. TODO: Pass lang tags? """ self.chap_file_name = chap_file_name self.epub = epub self.nlp: dict[str, Language] = self.epub.nlp self.pipe: dict[str, TranslationPipelineCache] = self.epub.pipe self.lang_orig: str = self.epub.lang_orig self.lang_dest: str = self.epub.lang_dest # parse the soup and get the body self.soup = BeautifulSoup(chap_content, features="html.parser") self.body = self.soup.body if self.body is None: print(f"No body found in chapter {self.chap_file_name} of book {'book'}.") return # find the paragraphs self.all_p_tag = self.body.find_all("p") if len(self.all_p_tag) == 0: print( f"No paragraphs found in chapter {self.chap_file_name} of book {'book'}." ) return # build the list of Paragraphs # self.paragraphs = [Paragraph(p_tag, self.nlp) for p_tag in self.all_p_tag] self.paragraphs = [] for p_tag in self.all_p_tag[:]: self.paragraphs.append(Paragraph(p_tag, self)) self.build_index() self.build_flat_sents() def build_index(self): """Build maps to go from ``sent_in_chap_id`` to ``(par_id, sent_in_par_id)`` and vice-versa.""" self.parsent_to_sent = {} self.sent_to_parsent = {} sc_id = 0 for p_id, par in enumerate(self.paragraphs): for sp_id, sent in enumerate(par.sents_orig): self.parsent_to_sent[(p_id, sp_id)] = sc_id self.sent_to_parsent[sc_id] = (p_id, sp_id) sc_id += 1 def build_flat_sents(self): """Build lists of sentences in the chapter, as Doc and text.""" # original sentences self.sents_text_orig = [] self.sents_doc_orig = [] for _, sent_orig in self.enumerate_sents(which_sent="orig"): self.sents_text_orig.append(sent_orig.text) self.sents_doc_orig.append(sent_orig) # translated sentences self.sents_text_tran = [] self.sents_doc_tran = [] for _, sent_tran in self.enumerate_sents(which_sent="tran"): self.sents_text_tran.append(sent_tran.text) self.sents_doc_tran.append(sent_tran) # the number of sentences in this chapter self.sents_num = len(self.sents_text_orig) def enumerate_sents(self, start_par: int = 0, end_par: int = 0, which_sent="orig"): """Enumerate all the sentences in the chapter, indexed as (par_id, sent_id).""" if end_par == 0: end_par = len(self.paragraphs) + 1 for i_p, par in enumerate(self.paragraphs[start_par:end_par]): for i_s, sent in enumerate(par.sents_orig): if which_sent == "orig": yield (i_p + start_par, i_s), sent elif which_sent == "tran": yield (i_p + start_par, i_s), par.sents_tran[i_s] def get_sent_with_parsent_id( self, par_id: int, sent_id: int, which_sent=Literal["orig", "tran"] ) -> Span: """Get the sentence in the chapter indexed as (par_id, sent_id).""" if which_sent == "orig": return self.paragraphs[par_id].sents_orig[sent_id] else: return self.paragraphs[par_id].sents_tran[sent_id] def get_sent_with_chapsent_id( self, chapsent_id: int, which_sent=Literal["orig", "tran"] ) -> Span: """Get the sentence in the chapter indexed as the sentence number in the chapter.""" par_id, sent_id = self.sent_to_parsent[chapsent_id] if which_sent == "orig": return self.paragraphs[par_id].sents_orig[sent_id] else: return self.paragraphs[par_id].sents_tran[sent_id] class EPub: """EPub class.""" def __init__( self, zipped_file: Union[str, IO[bytes], Path], nlp: dict[str, Language], pipe: dict[str, TranslationPipelineCache], lang_orig: str, lang_dest: str, ) -> None: """Initialize an epub. TODO: Pass file name? Yes, better debug. No can do with streamlit... But I'd rather pass a fake name inside streamlit, and the real one usually. """ self.nlp = nlp self.pipe = pipe self.lang_orig = lang_orig self.lang_dest = lang_dest # load the file in memory self.zipped_file = zipped_file self.input_zip = zipfile.ZipFile(self.zipped_file) # analyze the contents and find the chapter file names self.zipped_file_paths = [Path(p) for p in self.input_zip.namelist()] self.get_text_chapters() self.chap_file_names = [str(p) for p in self.chap_file_paths] # build a list of chapters # self.chapters = [ # Chapter(self.input_zip.read(chap_file_name), chap_file_name, self.nlp) # for chap_file_name in self.chap_file_names # ] self.chapters: list[Chapter] = [] for chap_file_name in self.chap_file_names[:6]: self.chapters.append( Chapter( self.input_zip.read(chap_file_name), chap_file_name, self, ) ) def get_text_chapters(self) -> None: """Find the chapters names that match a regex ``name{number}`` and sort on ``number``.""" # get the paths that are valid xhtml and similar self.chap_file_paths = [ f for f in self.zipped_file_paths if f.suffix in VALID_CHAP_EXT ] # stem gets the file name without extensions stems = [f.stem for f in self.chap_file_paths] # get the longest stem max_stem_len = max(len(c) for c in stems) # track the best regex' performances best_match_num = 0 best_stem_re = re.compile("") # iterate over the len, looking for the best match for num_kept_chars in range(max_stem_len): # keep only the beginning of the names stem_chops = [s[:num_kept_chars] for s in stems] # count how many names have common prefix stem_freqs = Counter(stem_chops) # if there are no chapters with common prefix skip if stem_freqs.most_common()[0][1] == 1: continue # try to match the prefix with re for stem_might, stem_freq in stem_freqs.items(): # compile a regex looking for name{number} stem_re = re.compile(f"{stem_might}(\\d+)") # how many matches this stem has good_match_num = 0 # track if a regex fails: it can have some matches and then fail failed = False for stem in stems: stem_ch = stem[:num_kept_chars] match = stem_re.match(stem) # if the regex does not match but the stem prefix does, fails if match is None and stem_ch == stem_might: failed = True break good_match_num += 1 # if this stem failed to match, don't consider it for the best if failed: continue # update info on best matching regex if good_match_num > best_match_num: best_stem_re = stem_re best_match_num = good_match_num # if the best match sucks keep all chapters if best_match_num <= 2: return # pair chapter name and chapter number chap_file_paths_id: list[tuple[Path, int]] = [] for stem, chap_file_path in zip(stems, self.chap_file_paths): # match the stem and get the chapter number match = best_stem_re.match(stem) if match is None: continue chap_id = int(match.group(1)) chap_file_paths_id.append((chap_file_path, chap_id)) # sort the list according to the extracted id self.chap_file_paths = [ cid[0] for cid in sorted(chap_file_paths_id, key=lambda x: x[1]) ] def get_chapter_by_name(self, chap_file_name: str) -> Chapter: """Get the chapter with the requested name.""" chap_id = self.chap_file_names.index(chap_file_name) print(chap_id) return self.chapters[chap_id]
[ "nobilipietro@gmail.com" ]
nobilipietro@gmail.com
6d20efd0a2f73ce1149cbb51844ba642ed36743f
2016147854b89b96154644e6c18d686e90f40450
/methods/exact_method.py
2b681356d244986578c297c07523cff0b6d86494
[]
no_license
ilshat-fatkhullin/differential_equations_assignment
2b3cc596504a1b5b71e9ebd0db56483757a71d6c
a9f680c4b2a10a8fa9e18c10d605397a2dfcddff
refs/heads/master
2020-04-01T11:38:06.083063
2018-11-01T16:41:55
2018-11-01T16:41:55
153,170,689
0
0
null
null
null
null
UTF-8
Python
false
false
403
py
from calculator import * class ExactMethod: @staticmethod def get_result(x0, b, n, y0): x = x0 step = (b - x0) / n x_rows = list() y_rows = list() while abs(b - x) >= abs(step): y = Calculator.get_general_solution(x, x0, y0) x_rows.append(x) y_rows.append(y) x += step return [x_rows, y_rows]
[ "ilshat.fatkhullin@gmail.com" ]
ilshat.fatkhullin@gmail.com
d727f6d92b367e32c9823e70668b9e985c4951f2
d18b6a5ba144d3c13450e07c12ccc8b80a3bc222
/main.py
6c46c009a6b7b3f9e2ed57aba87c46e3b1be2e32
[]
no_license
zhihuinang/SJTU-EE228-project1
b6270f14317136de2f1a1676714058019c4f430a
958c197bf56e52f66eb5ebd751f96219de012b5a
refs/heads/master
2023-05-26T03:08:20.931244
2021-06-16T06:15:46
2021-06-16T06:15:46
366,617,112
0
0
null
null
null
null
UTF-8
Python
false
false
8,591
py
import argparse import os import torch from tqdm import trange from torchvision.transforms import transforms import torch.utils.data as data import torch.nn as nn import torch.optim as optim import numpy as np from info import INFO from model import ResNet18,ResNet50 from utils import ACC,AUC from dataset import PathMNIST, ChestMNIST, DermaMNIST, OCTMNIST, PneumoniaMNIST, RetinaMNIST, \ BreastMNIST, OrganMNISTAxial, OrganMNISTCoronal, OrganMNISTSagittal def train(model,optimizer,loss,train_loader,device,task): model.train() for batch_idx, data in enumerate(train_loader): (inputs,labels) = data inputs = inputs.to(device) optimizer.zero_grad() outputs = model(inputs) if task == 'multi-label, binary-class': labels = labels.to(torch.float32).to(device) err = loss(outputs, labels) else: labels = labels.squeeze().long().to(device) err = loss(outputs, labels) err.backward() optimizer.step() def val(model, val_loader, device, val_auc_list, task, dir_path, epoch): model.eval() y_true = torch.tensor([]).to(device) y_score = torch.tensor([]).to(device) with torch.no_grad(): for batch_idx, (inputs, labels) in enumerate(val_loader): outputs = model(inputs.to(device)) if task == 'multi-label, binary-class': labels = labels.to(torch.float32).to(device) m = nn.Sigmoid() outputs = m(outputs).to(device) else: labels = labels.squeeze().long().to(device) m = nn.Softmax(dim=1) outputs = m(outputs).to(device) labels = labels.float().resize_(len(labels), 1) y_true = torch.cat((y_true, labels), 0) y_score = torch.cat((y_score, outputs), 0) y_true = y_true.cpu().numpy() y_pred = y_score.detach().cpu().numpy() auc = AUC(y_true, y_pred, task) val_auc_list.append(auc) state = { 'net': model.state_dict(), 'auc': auc, 'epoch': epoch, } print('Finish train epoch {}, AUC:{}'.format(epoch,auc)) path = os.path.join(dir_path, 'ckpt_%d_auc_%.5f.pth' % (epoch, auc)) torch.save(state, path) def test(model, split, data_loader, device, flag, task, output_root=None): model.eval() y_true = torch.tensor([]).to(device) y_score = torch.tensor([]).to(device) with torch.no_grad(): for batch_idx, (inputs, targets) in enumerate(data_loader): outputs = model(inputs.to(device)) if task == 'multi-label, binary-class': targets = targets.to(torch.float32).to(device) m = nn.Sigmoid() outputs = m(outputs).to(device) else: targets = targets.squeeze().long().to(device) m = nn.Softmax(dim=1) outputs = m(outputs).to(device) targets = targets.float().resize_(len(targets), 1) y_true = torch.cat((y_true, targets), 0) y_score = torch.cat((y_score, outputs), 0) y_true = y_true.cpu().numpy() y_score = y_score.detach().cpu().numpy() auc = AUC(y_true, y_score, task) acc = ACC(y_true, y_score, task) print('%s AUC: %.5f ACC: %.5f' % (split, auc, acc)) # if output_root is not None: # output_dir = os.path.join(output_root, flag) # if not os.path.exists(output_dir): # os.mkdir(output_dir) # output_path = os.path.join(output_dir, '%s.csv' % (split)) # save_results(y_true, y_score, output_path) def main(args): data_name = args.data_name.lower() input_root = args.input_root output_root = args.output_root num_epoch = args.num_epoch download = args.download model_type = args.model flag_to_class = { "pathmnist": PathMNIST, "chestmnist": ChestMNIST, "dermamnist": DermaMNIST, "octmnist": OCTMNIST, "pneumoniamnist": PneumoniaMNIST, "retinamnist": RetinaMNIST, "breastmnist": BreastMNIST, "organmnist_axial": OrganMNISTAxial, "organmnist_coronal": OrganMNISTCoronal, "organmnist_sagittal": OrganMNISTSagittal, } DataClass = flag_to_class[data_name] info = INFO[data_name] task = info['task'] n_channels = info['n_channels'] n_classes = len(info['label']) lr = 0.001 batch_size = 128 val_auc_list = [] dir_path = os.path.join(output_root, '%s_checkpoints' % (data_name+"_"+model_type)) if not os.path.exists(dir_path): os.makedirs(dir_path) print('doing data preprocessing......') transform = transforms.Compose( [transforms.ToTensor(), transforms.Normalize(mean=[.5], std=[.5])]) train_dataset = DataClass(root=input_root, split='train', transform=transform, download=download) train_loader = data.DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=True) val_dataset = DataClass(root=input_root, split='val', transform=transform, download=download) val_loader = data.DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=True) test_dataset = DataClass(root=input_root, split='test', transform=transform, download=download) test_loader = data.DataLoader(dataset=test_dataset, batch_size=batch_size, shuffle=True) print('data preprocessing done.....') device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") if model_type == 'ResNet18': model = ResNet18(in_ch=n_channels,class_num=n_classes) else: model = ResNet50(in_ch=n_channels,class_num=n_classes) model = model.to(device) if task == 'multi-label, binary-class': loss = nn.BCEWithLogitsLoss() else: loss = nn.CrossEntropyLoss() optimizer = optim.Adam(model.parameters(), lr=lr) for epoch in trange(0, num_epoch): train(model, optimizer, loss, train_loader, device, task) val(model, val_loader, device, val_auc_list, task, dir_path, epoch) auc_list = np.array(val_auc_list) index = auc_list.argmax() print('epoch %s is the best model' % (index)) print('==> Testing model...') restore_model_path = os.path.join( dir_path, 'ckpt_%d_auc_%.5f.pth' % (index, auc_list[index])) model.load_state_dict(torch.load(restore_model_path)['net']) test(model, 'train', train_loader, device, data_name, task, output_root=output_root) test(model, 'val', val_loader, device, data_name, task, output_root=output_root) test(model, 'test', test_loader, device, data_name, task, output_root=output_root) if __name__ == '__main__': parser = argparse.ArgumentParser( description='RUN Baseline model of MedMNIST') parser.add_argument('--data_name', default='pathmnist', help='subset of MedMNIST', type=str) parser.add_argument('--input_root', default='../../data', help='input root, the source of dataset files', type=str) parser.add_argument('--output_root', default='../output', help='output root, where to save models and results', type=str) parser.add_argument('--num_epoch', default=5, help='num of epochs of training', type=int) parser.add_argument('--download', default=True, help='whether download the dataset or not', type=bool) parser.add_argument('--model', default='ResNet18', help='model type', type=str) args = parser.parse_args() main(args)
[ "zhihuinang@126.com" ]
zhihuinang@126.com
f268e4ec3c301c496e6e87cfff9d394bdb45b105
85fa96e129cac68d1f7c52142207d80c43650cc8
/img_viewer.py
ef7d654feb38af027bec66ea3e7aca30e2aa7aa7
[]
no_license
hitarthsolanki/ADV-C164-165-IMAGE-VIEWER
bfebaa42f60708a91e9aa379a06e9438a5f93cbe
0704f49159e19a955dfe6a1328ebebc7317dd40e
refs/heads/main
2023-06-29T04:33:34.133567
2021-08-02T16:09:27
2021-08-02T16:09:27
392,012,098
0
0
null
null
null
null
UTF-8
Python
false
false
1,187
py
from tkinter import * from tkinter import filedialog from PIL import ImageTk,Image root=Tk() root.title("Planet Encyclopedia") root.geometry("600x600") root.configure(background="black") img_path="" def Open(): global img_path img_path=filedialog.askopenfilename(title = "Select Image File", filetypes= [("Image Files", "*.jpg *.gif *.png *.jpeg")]) print(img_path) img=ImageTk.PhotoImage(Image.open(img_path)) label_image.configure(image=img) label_image.image=img def rotate(): print("Rotate") print(img_path) im=Image.open(img_path) rotated_img=im.rotate(180) img=ImageTk.PhotoImage(rotated_img) label_image.configure(image=img) label_image.image=img btn_open=Button(root,text="Open Image",command=Open,relief="flat",font=("Times New Roman0",15),bg="#808080",fg="white") btn_open.place(relx=0.5,rely=0.08,anchor=CENTER) btn_rotate=Button(root,text="Rotate Image",command=rotate,relief="flat",font=("Times New Roman0",15),bg="#808080",fg="white") btn_rotate.place(relx=0.5,rely=0.8,anchor=CENTER) label_image=Label(root,text="royce",bg="black",fg="black") label_image.pack() root.mainloop()
[ "noreply@github.com" ]
noreply@github.com
2a742123549ed793dd03e532042a323592171d10
a2d36e471988e0fae32e9a9d559204ebb065ab7f
/huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/show_sp_res_response.py
f475eccd26c2ba4a71ea8a20576fbef3e88e9b9f
[ "Apache-2.0" ]
permissive
zhouxy666/huaweicloud-sdk-python-v3
4d878a90b8e003875fc803a61414788e5e4c2c34
cc6f10a53205be4cb111d3ecfef8135ea804fa15
refs/heads/master
2023-09-02T07:41:12.605394
2021-11-12T03:20:11
2021-11-12T03:20:11
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,331
py
# coding: utf-8 import re import six from huaweicloudsdkcore.sdk_response import SdkResponse from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class ShowSpResResponse(SdkResponse): """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ sensitive_list = [] openapi_types = { 'used_accounts_count': 'int' } attribute_map = { 'used_accounts_count': 'usedAccountsCount' } def __init__(self, used_accounts_count=None): """ShowSpResResponse - a model defined in huaweicloud sdk""" super(ShowSpResResponse, self).__init__() self._used_accounts_count = None self.discriminator = None if used_accounts_count is not None: self.used_accounts_count = used_accounts_count @property def used_accounts_count(self): """Gets the used_accounts_count of this ShowSpResResponse. 已用的企业并发数 :return: The used_accounts_count of this ShowSpResResponse. :rtype: int """ return self._used_accounts_count @used_accounts_count.setter def used_accounts_count(self, used_accounts_count): """Sets the used_accounts_count of this ShowSpResResponse. 已用的企业并发数 :param used_accounts_count: The used_accounts_count of this ShowSpResResponse. :type: int """ self._used_accounts_count = used_accounts_count def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: if attr in self.sensitive_list: result[attr] = "****" else: result[attr] = value return result def to_str(self): """Returns the string representation of the model""" import simplejson as json if six.PY2: import sys reload(sys) sys.setdefaultencoding("utf-8") return json.dumps(sanitize_for_serialization(self), ensure_ascii=False) def __repr__(self): """For `print`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, ShowSpResResponse): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
7cb6b8c630bf709694fc2422eae80020740c9721
e4814f60eefbc6ede78a91bd1a5717b225fbf1dd
/resizeeeeee.py
2c248b099548a7e8529320ab56e23c269830c1a6
[]
no_license
sukumargaonkar/MazeRunner
9c52ce606438c0d19f210de7a7908c02d8259107
584b0418ddb64582f04b78481890cf8614fb97d3
refs/heads/master
2020-03-29T18:01:05.522220
2018-10-08T01:55:43
2018-10-08T01:55:43
null
0
0
null
null
null
null
UTF-8
Python
false
false
647
py
import math import os from PIL import Image dim = 50 k = 600/dim print(k) j = math.ceil(k) size = j, j filename1 = 'mario.gif' filename2 = 'wall.gif' file_parts1 = os.path.splitext(filename1) file_parts2 = os.path.splitext(filename2) outfile1 = file_parts1[0] + "_" + file_parts1[1] outfile2 = file_parts2[0] + "_" + file_parts2[1] try: img = Image.open(filename1) img = img.resize(size, Image.ANTIALIAS) img.save(outfile1, "GIF") img = Image.open(filename2) img = img.resize(size, Image.ANTIALIAS) img.save(outfile2, "GIF") except IOError as e: print(" An exception occured '%s'" % e)
[ "noreply@github.com" ]
noreply@github.com
c31d6a0e04a28b132c1ee51440b80382e70f188b
9de26c31c5904387932c7467870e469abb7ec488
/test_case48/test_case19.py
4fbf6cbe3ae6c400bb02e5e3167c4bc4cb476a06
[]
no_license
wanghao-820/data_create
6b680e980fcbba1fcd55fe1189472718f4ef5a2b
ec774e3a5f9341f3bcdf5760e712cb9b0521684b
refs/heads/master
2023-06-13T01:00:28.099793
2021-07-08T15:53:20
2021-07-08T15:53:20
384,153,560
0
0
null
null
null
null
UTF-8
Python
false
false
2,164
py
from data_creater.utils import db_utils, str_utils from data_creater.apis import portal_apis from time import sleep from data_creater.controllers.renewal_controller import Renewal if __name__ == "__main__": # 测试用例, 学生未续报;调账号 """ A:春 → 调入秋 B:秋 A班主任:分子+1 pass B班主任:不变 pass """ to_uid = 473 # 春季班 clazz_ids = [1793] test = Renewal() print(test.get_clazz_master_info_field(clazz_id=1793, master_id=10706952, field='service_num,conversion_num')) print(test.get_clazz_master_info_field(clazz_id=1793, master_id=10706958,field='service_num,conversion_num')) for i in range(len(clazz_ids)): portal_apis.apply_clazz_student_nice(to_uid, clazz_id=clazz_ids[i]) sleep(1) # 先查询info表确定服务人数 service_num,conversion_num=test.get_clazz_master_info_field(clazz_id=1793, master_id=10706952, field='service_num,conversion_num') print(service_num, conversion_num) print(test.get_clazz_master_info_field(clazz_id=1793, master_id=10706958,field='service_num,conversion_num')) print("报班成功!") sleep(1) uid = 475 clazz_id = 1987 portal_apis.apply_clazz_student_nice(uid, clazz_id=clazz_id) sleep(1) # # # 报秋季班、五年级数学 order_id = test.get_order_id(uid,clazz_id) portal_apis.exchange_order_user(order_id=order_id, to_user_id=to_uid) sleep(1) # info表分母不变算惩罚,分子不变 new_service_num,new_conversion_num=test.get_clazz_master_info_field(clazz_id=1793, master_id=10706952, field='service_num,conversion_num') print(new_service_num, new_conversion_num) new_service_num,new_conversion_num=test.get_clazz_master_info_field(clazz_id=1793, master_id=10706958, field='service_num,conversion_num') print(new_service_num, new_conversion_num) # assert new_conversion_num-conversion_num == 0, "调小班后分子变化了" # assert new_service_num-service_num == 0, "调小班后分母变化了" # print("购课后调小班功能测试通过!")
[ "1427211856@qq.com" ]
1427211856@qq.com
5b370d6b432e10fca26598659c827a659c0d4f0e
3decd738a2f43e70c040644aca4e604b13fd7eb6
/tools/setup-deb-pkg.py
3c45692405a61768039fa30350e1a268033d25b5
[ "MIT" ]
permissive
mmarchini/libstapsdt
433ab727ca886ea51ffbff5612ca8574ba186afa
5a44c3a5e4b1cdb16e1c02e1cc2474f9ca56d4ff
refs/heads/main
2021-12-04T19:05:56.550352
2021-10-16T03:09:11
2021-10-16T03:09:11
417,709,808
1
0
MIT
2021-10-16T03:59:54
2021-10-16T03:59:53
null
UTF-8
Python
false
false
3,927
py
#!/usr/bin/env python3 import os import re from os import path import argparse import fileinput def inline_file_edit(filepath): return fileinput.FileInput(filepath, inplace=True) LIB_SHORT_DESCRIPTION = "Runtime USDT probes for Linux" LIB_LONG_DESCRIPTION = """ Library to give Linux runtime USDT probes capability """.strip() HEADERS_SHORT_DESCRIPTION = "Headers for libstapsdt" HEADERS_LONG_DESCRIPTION = """ Headers for libstapsdt, a library to give Linux runtime USDT probes capability """.strip() SITE = "https://github.com/sthima/libstapsdt" parser = argparse.ArgumentParser() parser.add_argument("codename", type=str) parser.add_argument("version", type=str) args = parser.parse_args() BASE = path.join("dist", "libstapsdt-{0}".format(args.version)) DEBIAN = path.join(BASE, "debian") print(args.version) print(args.codename) # Rename os.rename(path.join(DEBIAN, "libstapsdt1.install"), path.join(DEBIAN, "libstapsdt0.install")) os.rename(path.join(DEBIAN, "libstapsdt1.dirs"), path.join(DEBIAN, "libstapsdt0.dirs")) # Fix changelog with inline_file_edit(path.join(DEBIAN, "changelog")) as file_: for line in file_: if 'unstable' in line: line = line.replace('unstable', args.codename) elif 'Initial release' in line: line = " * Initial release\n" print(line, end="") # Fix control header = True with inline_file_edit(path.join(DEBIAN, "control")) as file_: for line in file_: if line.startswith("#"): continue if "3.9.6" in line: line = line.replace("3.9.6", "3.9.7") if "upstream URL" in line: line = line.replace("<insert the upstream URL, if relevant>", SITE) if "BROKEN" in line: line = line.replace("BROKEN", "0") if "debhelper (>=9)" in line: line = line.replace("\n", ", libelf1, libelf-dev\n") if "insert up" in line: if header: line = line.replace("<insert up to 60 chars description>", HEADERS_SHORT_DESCRIPTION) else: line = line.replace("<insert up to 60 chars description>", LIB_SHORT_DESCRIPTION) if "insert long" in line: if header: line = line.replace("<insert long description, indented with spaces>", HEADERS_LONG_DESCRIPTION) header = False else: line = line.replace("<insert long description, indented with spaces>", LIB_LONG_DESCRIPTION) print(line, end="") # Fix copyright header = True COPYRIGHT_LINE = "" copyright_regex = re.compile("Copyright: [0-9]") with open(path.join(DEBIAN, "copyright")) as file_: for line in file_.readlines(): if copyright_regex.match(line): COPYRIGHT_LINE = line with inline_file_edit(path.join(DEBIAN, "copyright")) as file_: for line in file_: if line.startswith("#"): continue if "url://example" in line: line = line.replace("<url://example.com>", SITE) if "<years>" in line: if "Copyright" in line: line = COPYRIGHT_LINE else: continue print(line, end="") # Fix installs with open(path.join(DEBIAN, "libstapsdt-dev.links"), "w+") as file_: file_.writelines(["usr/lib/libstapsdt.so.0 usr/lib/libstapsdt.so"]) with inline_file_edit(path.join(DEBIAN, "libstapsdt0.install")) as file_: for line in file_: print("usr/lib/lib*.so.*") break with inline_file_edit(path.join(DEBIAN, "libstapsdt-dev.install")) as file_: for line in file_: print("usr/include/*") break # Fix rules with inline_file_edit(path.join(DEBIAN, "rules")) as file_: for line in file_: if "DH_VERBOSE" in line: print("export DH_VERBOSE=1") print("export DEB_BUILD_OPTIONS=nocheck") continue else: print(line, end="")
[ "oss@mmarchini.me" ]
oss@mmarchini.me
e19aaa55db0692b20e430e06a921b19c03074b63
277540803d133c40b24733857fc553983a59d863
/src/SwarmBot/run.py
e3223401213853893a2341cf05feb803cdc3a14a
[ "MIT" ]
permissive
Dyex719/Battlecode
d3ddf518b66ba09fe5243e997b3b1d2cef4c912f
5ed0932b0ba18ce914725e90839a476328cb9460
refs/heads/master
2021-05-12T17:43:06.118059
2018-01-16T05:14:37
2018-01-16T05:14:37
117,052,193
0
0
null
null
null
null
UTF-8
Python
false
false
5,400
py
import battlecode as bc import random import sys import traceback print("pystarting") # A GameController is the main type that you talk to the game with. # Its constructor will connect to a running game. gc = bc.GameController() directions = list(bc.Direction) useful_dir = [bc.Direction.North,bc.Direction.Northeast,bc.Direction.East,bc.Direction.Southeast,bc.Direction.South,bc.Direction.Southwest,bc.Direction.West,bc.Direction.Northwest] tryRotate = [0,-1,1,-2,2] print("pystarted") # It's a good idea to try to keep your bots deterministic, to make debugging easier. # determinism isn't required, but it means that the same things will happen in every thing you run, # aside from turns taking slightly different amounts of time due to noise. random.seed(6137) # let's start off with some research! # we can queue as much as we want. gc.queue_research(bc.UnitType.Rocket) gc.queue_research(bc.UnitType.Worker) gc.queue_research(bc.UnitType.Knight) my_team = gc.team() global one_loc,enemy_start def invert(loc): inv_x = earth_map.width-loc.x inv_y = earth_map.height-loc.y return bc.MapLocation(bc.Planet.Earth,inv_x,inv_y) # Lets analyse the map # pm = bc.PlanetMap() pl = bc.Player() for planet in pl.planet: # This is ob wrong, I only want to run the code if it is earth, but it has to run before the main loop starts. We can use a function I guess. if gc.planet() == bc.Planet.Earth: earth_map = gc.starting_map(bc.Planet.Earth) one_loc = gc.my_units()[0].location.map_location() enemy_start = invert(one_loc) print("Enemy starts at" + str(enemy_start.x) +" " +str(enemy_start.y)) print("We start at" + str(one_loc.x) +" " +str(one_loc.y)) def mid_point(loc1,loc2): mid_x = int((loc1.x + loc2.x) / 2) mid_y = int((loc1.y + loc2.y) / 2) return bc.MapLocation(bc.Planet.Earth,mid_x,mid_y) # # def goto(unit,dest): # d = unit.location.map_location().direction_to(dest) # if gc.can_move(unit.id,d): # gc.move_robot(unit.id,d) def fuzzygoto(unit,dest): toward = unit.location.map_location().direction_to(dest) for tilt in tryRotate: d = rotate(toward,tilt) if gc.can_move(unit.id,d): gc.move_robot(unit.id,d) break def rotate(direc,amount): ind = directions.index(direc) return directions[(ind+amount)%8] swarm_loc = mid_point(one_loc,enemy_start) knight_count = 0 while True: # We only support Python 3, which means brackets around print() print('pyround:', gc.round()) # frequent try/catches are a good idea try: # walk through our units: for unit in gc.my_units(): # first, factory logic if unit.unit_type == bc.UnitType.Factory: garrison = unit.structure_garrison() if len(garrison) > 0: d = random.choice(directions) if gc.can_unload(unit.id, d): print('unloaded a knight!') gc.unload(unit.id, d) continue elif gc.can_produce_robot(unit.id, bc.UnitType.Knight): gc.produce_robot(unit.id, bc.UnitType.Knight) print('produced a knight!') knight_count += 1 continue # first, let's look for nearby blueprints to work on location = unit.location if location.is_on_map(): nearby = gc.sense_nearby_units(location.map_location(), 2) for other in nearby: if unit.unit_type == bc.UnitType.Worker and gc.can_build(unit.id, other.id): gc.build(unit.id, other.id) print('built a factory!') # move onto the next unit continue if other.team != my_team and gc.is_attack_ready(unit.id) and gc.can_attack(unit.id, other.id): print('attacked a thing!') gc.attack(unit.id, other.id) continue elif unit.unit_type == bc.UnitType.Knight and gc.is_move_ready(unit.id) and gc.round()<50: fuzzygoto(unit,swarm_loc) elif unit.unit_type == bc.UnitType.Knight and gc.is_move_ready(unit.id) and gc.round()>50: fuzzygoto(unit,enemy_start) # okay, there weren't any dudes around # pick a random direction: d = random.choice(directions) # or, try to build a factory: if gc.karbonite() > bc.UnitType.Factory.blueprint_cost() and gc.can_blueprint(unit.id, bc.UnitType.Factory, d): gc.blueprint(unit.id, bc.UnitType.Factory, d) # and if that fails, try to move elif gc.is_move_ready(unit.id) and gc.can_move(unit.id, d): gc.move_robot(unit.id, useful_dir) except Exception as e: print('Error:', e) # use this to show where the error was traceback.print_exc() # send the actions we've performed, and wait for our next turn. gc.next_turn() # these lines are not strictly necessary, but it helps make the logs make more sense. # it forces everything we've written this turn to be written to the manager. sys.stdout.flush() sys.stderr.flush()
[ "30334566+Dyex719@users.noreply.github.com" ]
30334566+Dyex719@users.noreply.github.com
749b6395b6d8726189553c6d5d199595a4229343
f9d564f1aa83eca45872dab7fbaa26dd48210d08
/huaweicloud-sdk-gaussdbfornosql/huaweicloudsdkgaussdbfornosql/v3/model/show_pause_resume_stutus_response.py
c5684b791851a26cc2626b0be1f8ff75fd7fc5a2
[ "Apache-2.0" ]
permissive
huaweicloud/huaweicloud-sdk-python-v3
cde6d849ce5b1de05ac5ebfd6153f27803837d84
f69344c1dadb79067746ddf9bfde4bddc18d5ecf
refs/heads/master
2023-09-01T19:29:43.013318
2023-08-31T08:28:59
2023-08-31T08:28:59
262,207,814
103
44
NOASSERTION
2023-06-22T14:50:48
2020-05-08T02:28:43
Python
UTF-8
Python
false
false
8,747
py
# coding: utf-8 import six from huaweicloudsdkcore.sdk_response import SdkResponse from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class ShowPauseResumeStutusResponse(SdkResponse): """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ sensitive_list = [] openapi_types = { 'master_instance_id': 'str', 'slave_instance_id': 'str', 'status': 'str', 'data_sync_indicators': 'NoSQLDrDateSyncIndicators', 'rto_and_rpo_indicators': 'list[NoSQLDrRpoAndRto]' } attribute_map = { 'master_instance_id': 'master_instance_id', 'slave_instance_id': 'slave_instance_id', 'status': 'status', 'data_sync_indicators': 'data_sync_indicators', 'rto_and_rpo_indicators': 'rto_and_rpo_indicators' } def __init__(self, master_instance_id=None, slave_instance_id=None, status=None, data_sync_indicators=None, rto_and_rpo_indicators=None): """ShowPauseResumeStutusResponse The model defined in huaweicloud sdk :param master_instance_id: 主实例id :type master_instance_id: str :param slave_instance_id: 备实例id :type slave_instance_id: str :param status: 容灾实例数据同步状态 - NA:实例尚未搭建容灾关系 - NEW:尚未启动的数据同步状态 - SYNCING:数据同步正常进行中 - SUSPENDING:正在暂停数据同步 - SUSPENDED:数据同步已暂停 - RECOVERYING:正在恢复数据同步 :type status: str :param data_sync_indicators: :type data_sync_indicators: :class:`huaweicloudsdkgaussdbfornosql.v3.NoSQLDrDateSyncIndicators` :param rto_and_rpo_indicators: 切换或倒换RPO和RTO值,仅当请求实例id为主实例时有值 :type rto_and_rpo_indicators: list[:class:`huaweicloudsdkgaussdbfornosql.v3.NoSQLDrRpoAndRto`] """ super(ShowPauseResumeStutusResponse, self).__init__() self._master_instance_id = None self._slave_instance_id = None self._status = None self._data_sync_indicators = None self._rto_and_rpo_indicators = None self.discriminator = None if master_instance_id is not None: self.master_instance_id = master_instance_id if slave_instance_id is not None: self.slave_instance_id = slave_instance_id if status is not None: self.status = status if data_sync_indicators is not None: self.data_sync_indicators = data_sync_indicators if rto_and_rpo_indicators is not None: self.rto_and_rpo_indicators = rto_and_rpo_indicators @property def master_instance_id(self): """Gets the master_instance_id of this ShowPauseResumeStutusResponse. 主实例id :return: The master_instance_id of this ShowPauseResumeStutusResponse. :rtype: str """ return self._master_instance_id @master_instance_id.setter def master_instance_id(self, master_instance_id): """Sets the master_instance_id of this ShowPauseResumeStutusResponse. 主实例id :param master_instance_id: The master_instance_id of this ShowPauseResumeStutusResponse. :type master_instance_id: str """ self._master_instance_id = master_instance_id @property def slave_instance_id(self): """Gets the slave_instance_id of this ShowPauseResumeStutusResponse. 备实例id :return: The slave_instance_id of this ShowPauseResumeStutusResponse. :rtype: str """ return self._slave_instance_id @slave_instance_id.setter def slave_instance_id(self, slave_instance_id): """Sets the slave_instance_id of this ShowPauseResumeStutusResponse. 备实例id :param slave_instance_id: The slave_instance_id of this ShowPauseResumeStutusResponse. :type slave_instance_id: str """ self._slave_instance_id = slave_instance_id @property def status(self): """Gets the status of this ShowPauseResumeStutusResponse. 容灾实例数据同步状态 - NA:实例尚未搭建容灾关系 - NEW:尚未启动的数据同步状态 - SYNCING:数据同步正常进行中 - SUSPENDING:正在暂停数据同步 - SUSPENDED:数据同步已暂停 - RECOVERYING:正在恢复数据同步 :return: The status of this ShowPauseResumeStutusResponse. :rtype: str """ return self._status @status.setter def status(self, status): """Sets the status of this ShowPauseResumeStutusResponse. 容灾实例数据同步状态 - NA:实例尚未搭建容灾关系 - NEW:尚未启动的数据同步状态 - SYNCING:数据同步正常进行中 - SUSPENDING:正在暂停数据同步 - SUSPENDED:数据同步已暂停 - RECOVERYING:正在恢复数据同步 :param status: The status of this ShowPauseResumeStutusResponse. :type status: str """ self._status = status @property def data_sync_indicators(self): """Gets the data_sync_indicators of this ShowPauseResumeStutusResponse. :return: The data_sync_indicators of this ShowPauseResumeStutusResponse. :rtype: :class:`huaweicloudsdkgaussdbfornosql.v3.NoSQLDrDateSyncIndicators` """ return self._data_sync_indicators @data_sync_indicators.setter def data_sync_indicators(self, data_sync_indicators): """Sets the data_sync_indicators of this ShowPauseResumeStutusResponse. :param data_sync_indicators: The data_sync_indicators of this ShowPauseResumeStutusResponse. :type data_sync_indicators: :class:`huaweicloudsdkgaussdbfornosql.v3.NoSQLDrDateSyncIndicators` """ self._data_sync_indicators = data_sync_indicators @property def rto_and_rpo_indicators(self): """Gets the rto_and_rpo_indicators of this ShowPauseResumeStutusResponse. 切换或倒换RPO和RTO值,仅当请求实例id为主实例时有值 :return: The rto_and_rpo_indicators of this ShowPauseResumeStutusResponse. :rtype: list[:class:`huaweicloudsdkgaussdbfornosql.v3.NoSQLDrRpoAndRto`] """ return self._rto_and_rpo_indicators @rto_and_rpo_indicators.setter def rto_and_rpo_indicators(self, rto_and_rpo_indicators): """Sets the rto_and_rpo_indicators of this ShowPauseResumeStutusResponse. 切换或倒换RPO和RTO值,仅当请求实例id为主实例时有值 :param rto_and_rpo_indicators: The rto_and_rpo_indicators of this ShowPauseResumeStutusResponse. :type rto_and_rpo_indicators: list[:class:`huaweicloudsdkgaussdbfornosql.v3.NoSQLDrRpoAndRto`] """ self._rto_and_rpo_indicators = rto_and_rpo_indicators def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: if attr in self.sensitive_list: result[attr] = "****" else: result[attr] = value return result def to_str(self): """Returns the string representation of the model""" import simplejson as json if six.PY2: import sys reload(sys) sys.setdefaultencoding("utf-8") return json.dumps(sanitize_for_serialization(self), ensure_ascii=False) def __repr__(self): """For `print`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, ShowPauseResumeStutusResponse): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
ee5f649704cbc12a6f353db6ecfd4a96c972f041
f8c183aa549f36808844f5e6304a6129a222f182
/lesson_01_slyusar_roman/02. task 2.py
26a49235298f3db5d06d1e6681b78a4d9a1e669a
[]
no_license
ITihiy/gb_algo_solutions
70f59a6b22412e7d7df1111c5506cf944245cd2a
faa94f916becca8524f55ca2630f134f3f4741de
refs/heads/master
2023-08-04T07:18:14.159191
2021-09-25T17:54:29
2021-09-25T17:54:29
403,243,335
1
5
null
2021-09-25T17:54:30
2021-09-05T07:27:03
Python
UTF-8
Python
false
false
1,269
py
"""" 2. Выполнить логические побитовые операции «И», «ИЛИ» и др. над числами 5 и 6. Выполнить над числом 5 побитовый сдвиг вправо и влево на два знака. Объяснить полученный результат. """ a = 5 b = 6 a_byte = format(a, 'b') b_byte = format(b, 'b') rez = [] print("Логическое \"И\": ") for i in range(len(a_byte)): rez.insert(i, int(a_byte[i]) and int(b_byte[i])) print("Результат: ", ''.join(str(e) for e in rez)) rez = [] print("Логическое \"ИЛИ\": ") for i in range(len(a_byte)): rez.insert(i, int(a_byte[i]) or int(b_byte[i])) print("Результат: ", ''.join(str(e) for e in rez)) print("Побитовый сдвиг числа 5 на два знака вправо: ") # Отрезаем у скиска два знака с конца и дописываем два нуля вначале list_to_right = [0, 0] + list(a_byte)[0:-2] print(''.join(str(e) for e in list_to_right)) print("Побитовый сдвиг числа 5 на два знака влево: ") list_to_left = list(a_byte)[2:len(a_byte)] + [0, 0] print(''.join(str(e) for e in list_to_left))
[ "slyusarrv@yandex.ru" ]
slyusarrv@yandex.ru
d66816d4187adc8ec829d96ab77ec309eb85a3dc
65d8d97a05ef63e0a43bdcb2ff6f683442d85b25
/venv/Scripts/django-admin.py
e45374fb41873a133de05ebf09b01be163c1745b
[]
no_license
philipko100/Ecommerce-Site
a1ba8e15b59ef3a5e66bada044a169198a292a2f
976268eb740ee664ee71b956b520697937271db2
refs/heads/main
2023-08-15T00:41:02.015798
2021-09-22T00:14:52
2021-09-22T00:14:52
405,302,940
0
0
null
null
null
null
UTF-8
Python
false
false
680
py
#!C:\Coding\ecommerce\venv\Scripts\python.exe # When the django-admin.py deprecation ends, remove this script. import warnings from django.core import management try: from django.utils.deprecation import RemovedInDjango40Warning except ImportError: raise ImportError( 'django-admin.py was deprecated in Django 3.1 and removed in Django ' '4.0. Please manually remove this script from your virtual environment ' 'and use django-admin instead.' ) if __name__ == "__main__": warnings.warn( 'django-admin.py is deprecated in favor of django-admin.', RemovedInDjango40Warning, ) management.execute_from_command_line()
[ "philip.ko.100@gmail.com" ]
philip.ko.100@gmail.com
7f23226f64137649209c8979392ca73a776cc6ed
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5738606668808192_0/Python/xulusko/CoinJam.py
2d99d9e5c0b0750367878956b22ae6d543d493aa
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
Python
false
false
697
py
from random import randint from pyprimes import nprimes N = 16 J = 50 jamcoins = set() somePrimes = list(nprimes(47))[1:] def findDiv(val): for p in somePrimes: if val % p == 0: return p return None def getDivisors(coin): divs = [] for base in range(2, 11): val = int(coin, base) div = findDiv(val) if not div: return None divs.append(div) return tuple(divs) while len(jamcoins) < J: coin = '' for i in range(N-2): coin += str(randint(0, 1)) coin = '1' + coin + '1' divs = getDivisors(coin) if divs: jamcoins.add((coin, divs)) print('Case #1:') for coin, divs in jamcoins: print(coin, ' '.join(map(str, divs)))
[ "alexandra1.back@gmail.com" ]
alexandra1.back@gmail.com
5973172ad98373f1365860f01f4fce3b89ba00f1
be81dc6b30ddfcb512a58aae2a592f5707b65479
/8월/swea_4839.py
0fcbd1792f442828f20b105382deff17b3b87d46
[]
no_license
mingddo/Algo
799082d2a9d8e2fa43a910ebf5e769e372774a70
6dee72aa3c99b59ada714bfe549b323dbdff2f30
refs/heads/master
2023-01-06T00:32:29.457676
2020-11-07T07:45:07
2020-11-07T07:45:07
281,081,195
3
0
null
null
null
null
UTF-8
Python
false
false
686
py
import sys T = int(input()) for tc in range(1, T + 1): num = list(map(int, input().split())) result = [] for i in range(2): start = 1 end = num[0] cnt = 0 page = num[i+1] while start <= end: c = (start + end) // 2 if c == page: break elif c < page: start = c cnt += 1 else: end = c cnt += 1 result.append(cnt) if result[0] < result[1]: print('#%d'%tc, 'A') elif result[0] == result[1]: print('#%d'%tc,'0') else: print('#%d'%tc,'B')
[ "dk.myeong@gmail.com" ]
dk.myeong@gmail.com
a27f8c7745fc850e88e726b1c9dea6b2f85427bf
844d9398f308362a88e1282f1c3c1963a1a93acd
/wordcount/urls.py
de041350b898e473ea6934e5293d0a37d529a5ba
[]
no_license
lcres7/wordcount-project
ea13f7b2c2e23d665e667878d7697720d75f80fc
9b8cd00862452a625f58e94c44b224049cbae9aa
refs/heads/master
2022-04-10T07:18:36.082882
2020-03-26T14:59:14
2020-03-26T14:59:14
250,291,176
0
0
null
null
null
null
UTF-8
Python
false
false
867
py
"""wordcount URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path from . import views urlpatterns = [ path('', views.home, name='home'), path('count/', views.count, name='count'), path('about/', views.about, name='about'), ]
[ "lukec@localhost.localdomain" ]
lukec@localhost.localdomain
57b50a91bccb5468120878e16db6c15f95c792be
e87e71e01a14d3469f3249a5dc546f9f7e5f6332
/api/blockchain/views.py
d2e4d7469e7440c82d438b051d6b2ee3e320d126
[]
no_license
jlmallas160190/challenge-ripio-be
7f4b55da67c45b1c5bbcea011376691f144a4a49
bf7354ed61372e80c31d6120f062db193a651db4
refs/heads/master
2023-05-30T18:58:10.139040
2021-06-14T15:14:40
2021-06-15T04:36:53
373,355,348
0
0
null
null
null
null
UTF-8
Python
false
false
5,174
py
from decimal import Decimal from app.blockchain.tasks import calculate_balance_task import logging from rest_framework.authtoken.models import Token from api.blockchain.serializers import (CoinSerializer, TransactionSerializer, WalletSerializer) from app.blockchain.models import Account, Coin, Transaction, Wallet from rest_framework import permissions, status, viewsets from rest_framework.decorators import action from rest_framework.response import Response class CoinViewSet(viewsets.ModelViewSet): """ API endpoint that allows coins to be viewed or edited. """ queryset = Coin.objects.all() serializer_class = CoinSerializer permission_classes = [permissions.IsAuthenticated] class WalletViewSet(viewsets.ModelViewSet): """ API endpoint that allows wallet to be viewed or edited. """ queryset = Wallet.objects.all() serializer_class = WalletSerializer permission_classes = [permissions.IsAuthenticated] def __authorize(self, request): auth_header = request.META['HTTP_AUTHORIZATION'] index = auth_header.find(' ') token = Token.objects.get(key=auth_header[index:].strip()) return Account.objects.get(user_id=token.user_id) def list(self, request, *args, **kwargs): try: account = self.__authorize(request=request) queryset = Wallet.objects.filter(account_id=account.id).all() serializer = WalletSerializer(queryset, many=True) return Response(serializer.data) except Exception as ex: logging.error(ex) return Response({ 'message': str(ex), 'status': status.HTTP_500_INTERNAL_SERVER_ERROR, }, status=status.HTTP_500_INTERNAL_SERVER_ERROR) def create(self, request, *args, **kwargs): try: account = self.__authorize(request=request) data = request.data data['account_id'] = account.id serializer = WalletSerializer(data=data) if serializer.is_valid(): serializer.save() return Response(serializer.data, status=status.HTTP_201_CREATED) except Exception as ex: logging.error(ex) return Response({ 'message': str(ex), 'status': status.HTTP_500_INTERNAL_SERVER_ERROR, }, status=status.HTTP_500_INTERNAL_SERVER_ERROR) def update(self, request, pk=None, *args, **kwargs): try: self.__authorize(request=request) wallet = Wallet.objects.get(id=pk) wallet.calculate_balance() data = request.data serializer = WalletSerializer(wallet, data=data) if serializer.is_valid(): serializer.save() return Response(serializer.data) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) except Exception as ex: logging.error(ex) return Response({ 'message': str(ex), 'status': status.HTTP_500_INTERNAL_SERVER_ERROR, }, status=status.HTTP_500_INTERNAL_SERVER_ERROR) @action(detail=True, methods=['GET', 'POST']) def transactions(self, request, pk=None, *args, **kwargs): try: account = self.__authorize(request=request) if request.method == 'GET': queryset = Transaction.objects.filter( sender_id=pk, sender__account_id=account.id).all() serializer = TransactionSerializer(queryset, many=True) return Response(serializer.data) if request.method == 'POST': data = request.data.copy() data['sender_id'] = pk wallet = Wallet.objects.get(pk=pk) wallet.calculate_balance() if request.user.is_superuser is False and wallet.balance < Decimal(data['amount']): return Response({ 'message': 'You have not money in your wallet for this transaction, your balance is {}'.format(wallet.balance), 'status': status.HTTP_400_BAD_REQUEST, }, status=status.HTTP_400_BAD_REQUEST) serializer = TransactionSerializer(data=data) if serializer.is_valid(): serializer.save() calculate_balance_task.delay( data['recipient'], 'recipient') if (request.user.is_superuser is False): calculate_balance_task.delay( data['sender_id'], 'sender_id') return Response(serializer.data, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) except Exception as ex: logging.error(ex) return Response({'status': status.HTTP_500_INTERNAL_SERVER_ERROR, 'message': str(ex)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
[ "jomasloja@gmail.com" ]
jomasloja@gmail.com
447ffb47be7aa30b0ecec7aad540537018d8f179
d6703af7ee5c1f711fa117145c614801c5199762
/lambda/pain_lambda.py
c63dd949fb764245e287e1b8c0536557f503e110
[ "MIT" ]
permissive
AdamMcCormick/share-the-pain
641b71a9af1608a83e5e23a75edddcf317717f0f
c7a7055723925dd36b42982b5d17c9f8ccf5b397
refs/heads/master
2021-09-01T11:56:46.637013
2017-12-26T21:17:03
2017-12-26T21:17:03
114,928,433
0
0
null
null
null
null
UTF-8
Python
false
false
2,691
py
from datetime import datetime import json import re import os import pyrebase firebase = pyrebase.initialize_app(os.environ) auth = firebase.auth() def resource(path, base = None) : base = base if base else firebase.database(); segment, subPath = re.sub(r'/+', '/', re.sub(r'^/', '', path)).partition('/')[::2] #print('"' + base.path + '"', '"' + segment + '"', '"' + subPath + '"') return base if not segment else resource(subPath, base.child(segment)) def getUserData(user) : return resource('users/' + user['localId'] + '/metadata'); def getCurrentReason(user) : userData = getUserData(user) if not userData : return None; metadata = userData.get().val() return metadata['currentReason'] if metadata and 'currentReason' in metadata else None; def failure(typeVal, event) : return lambda user, reason, note, isLearning: { 'isBase64Encoded': False, 'statusCode': 404, 'headers': { 'Content-Type': 'text/plain' }, 'body': 'Call failed, resource ' + typeVal + ' not found' } def pushMessage(user, type, reason = False, note = None, isLearning = False, date = None) : if type : message = { 'reason': reason if reason else 'unknown', 'note': note, 'isLearning': isLearning, 'type': type, 'date': (date if date else datetime.now()).isoformat() } userMessages = resource('users/' + user['localId'] + '/pain') userMessages.push(message) allMessage = message.copy() allMessage['user'] = user['localId'] allMessages = resource('pain') allMessages.push(allMessage) return { "isBase64Encoded": False, "statusCode": 200, "headers": {}, "body": None } def setReason(user, reason, note, isLearning = False) : current = getCurrentReason(user) if current : pushMessage(user, 'DUN', current, note, isLearning) getUserData(user).child('currentReason').set(reason) return pushMessage(user, 'MUX', reason, note, isLearning) def wtf(user, reason, note, isLearning) : return pushMessage(user, 'WTF', reason if reason else getCurrentReason(user), note) def yay(user, reason, note, isLearning) : return pushMessage(user, 'YAY', reason if reason else getCurrentReason(user), note) def handleRequest(event, context) : body = json.loads(event['body']) user = auth.sign_in_with_email_and_password(body['email'], body['password']) typeVal = body.get('type', event['path']) return { 'yay': yay, '/yay': yay, 'wtf': wtf, '/wtf': wtf, 'mux': setReason, '/mux': setReason }.get(typeVal.lower(), failure(typeVal, event))( user, body.get('reason', None), body.get('note', None), body.get('isLearning', None) )
[ "awMcCormick@sbgtv.com" ]
awMcCormick@sbgtv.com
3fea2dc185356ece549895fc3905f0ab08fbe826
eaae0c717cbb3189f84f64ec1e06c2b90184d6b2
/ai_moive_project/build_database.py
dd63d337863727591507cab629c0671a7ec2dea9
[]
no_license
ZhikunWei/AI_project_moive_conversation_agent
50c5701f36486d5beab25e01f5590f38fe8e076a
f7637223915a654d71909c532c117bb5cdaef8ef
refs/heads/master
2022-06-18T04:52:54.497144
2020-05-10T15:04:20
2020-05-10T15:04:20
262,812,079
0
0
null
null
null
null
UTF-8
Python
false
false
7,822
py
import rdflib from rdflib import Graph, Literal, BNode, Namespace, URIRef from rdflib import RDF, RDFS import pickle def buildGraph(): g = Graph() url_prefix = "http://example.org/" my_namespace = Namespace("http://example.org/") uriDict = {} # concepts moiveID = URIRef(url_prefix+'moiveID') rating = URIRef(url_prefix+'rating') year = URIRef(url_prefix+'year') title = URIRef(url_prefix+'title') director = URIRef(url_prefix+'director') actor = URIRef(url_prefix+'actor') writer = URIRef(url_prefix+'writer') person = URIRef(url_prefix+'person') genres = URIRef(url_prefix+'genres') uriDict['moiveID'] = moiveID uriDict['rating'] = rating uriDict['year'] = year uriDict['title'] = title uriDict['director'] = director uriDict['actor'] = actor uriDict['writer'] = writer uriDict['person'] = person uriDict['genres'] = genres # each concept is a RDFS.Class g.add((moiveID, RDF.type, RDFS.Class)) g.add((rating, RDF.type, RDFS.Class)) g.add((year, RDF.type, RDFS.Class)) g.add((title, RDF.type, RDFS.Class)) g.add((director, RDF.type, RDFS.Class)) g.add((actor, RDF.type, RDFS.Class)) g.add((writer, RDF.type, RDFS.Class)) g.add((person, RDF.type, RDFS.Class)) g.add((genres, RDF.type, RDFS.Class)) # concept label g.add((moiveID, RDFS.label, Literal('moiveID'))) g.add((rating, RDFS.label, Literal('rating'))) g.add((year, RDFS.label, Literal('year'))) g.add((title, RDFS.label, Literal('title'))) g.add((director, RDFS.label, Literal('director'))) g.add((actor, RDFS.label, Literal('actor'))) g.add((writer, RDFS.label, Literal('writer'))) g.add((person, RDFS.label, Literal('person'))) g.add((genres, RDFS.label, Literal('genres'))) # property ratedBy = URIRef(url_prefix+'ratedBy') hasTitle = URIRef(url_prefix+'hasTitle') showInYear = URIRef(url_prefix+'showInYear') belongsToGenre = URIRef(url_prefix+'belongsToGenre') directedBy = URIRef(url_prefix+'directedBy') writedBy = URIRef(url_prefix+'writedBy') starredBy = URIRef(url_prefix+'starredBy') getId = URIRef(url_prefix+'getId') involve = URIRef(url_prefix+'involve') uriDict['ratedBy'] = ratedBy uriDict['hasTitle'] = hasTitle uriDict['showInYear'] = showInYear uriDict['belongsToGenre'] = belongsToGenre uriDict['directedBy'] = directedBy uriDict['writedBy'] = writedBy uriDict['starredBy'] = starredBy uriDict['getId'] = getId uriDict['involve'] = involve # each property is a RDFS.Property g.add((ratedBy, RDF.type, RDF.Property)) g.add((hasTitle, RDF.type, RDF.Property)) g.add((showInYear, RDF.type, RDF.Property)) g.add((belongsToGenre, RDF.type, RDF.Property)) g.add((directedBy, RDF.type, RDF.Property)) g.add((writedBy, RDF.type, RDF.Property)) g.add((starredBy, RDF.type, RDF.Property)) g.add((getId, RDF.type, RDF.Property)) g.add((involve, RDF.type, RDF.Property)) # property lable g.add((ratedBy, RDFS.label, Literal('ratedBy'))) g.add((hasTitle, RDFS.label, Literal('hasTitle'))) g.add((showInYear, RDFS.label, Literal('showInYear'))) g.add((belongsToGenre, RDFS.label, Literal('belongsToGenre'))) g.add((directedBy, RDFS.label, Literal('directedBy'))) g.add((writedBy, RDFS.label, Literal('writedBy'))) g.add((starredBy, RDFS.label, Literal('starredBy'))) g.add((getId, RDFS.label, Literal('getId'))) g.add((involve, RDFS.label, Literal('involve'))) # subclass g.add((director, RDFS.subClassOf, person)) g.add((actor, RDFS.subClassOf, person)) g.add((writer, RDFS.subClassOf, person)) g.add((directedBy, RDFS.subClassOf, involve)) g.add((starredBy, RDFS.subClassOf, involve)) g.add((writedBy, RDFS.subClassOf, involve)) #domain & range g.add((hasTitle, RDFS.domain, moiveID)) g.add((ratedBy, RDFS.domain, title)) g.add((showInYear, RDFS.domain, title)) g.add((belongsToGenre, RDFS.domain, title)) g.add((directedBy, RDFS.domain, title)) g.add((writedBy, RDFS.domain, title)) g.add((starredBy, RDFS.domain, title)) g.add((getId, RDFS.domain, title)) g.add((hasTitle, RDFS.range, title)) g.add((ratedBy, RDFS.range, rating)) g.add((showInYear, RDFS.range, year)) g.add((belongsToGenre, RDFS.range, genres)) g.add((directedBy, RDFS.range, director)) g.add((writedBy, RDFS.range, writer)) g.add((starredBy, RDFS.range, actor)) g.add((getId, RDFS.range, moiveID)) ins_genres = {} ins_directors = {} ins_writers = {} ins_actors = {} with open('./imdb_data/moive_dict.pkl', 'rb') as f: moive_dict = pickle.load(f) for k in moive_dict: ins_moiveID = URIRef(url_prefix+'_'+k+'_moiveID') g.add((ins_moiveID, RDFS.label, Literal(k))) g.add((ins_moiveID, RDF.type, moiveID)) ins_rating = URIRef(url_prefix+'_'+k+'_rating') g.add((ins_rating, RDFS.label, Literal(moive_dict[k]['rating']))) g.add((ins_rating, RDF.type, rating)) g.add((ins_moiveID, ratedBy, ins_rating)) ins_title = URIRef(url_prefix+'_'+k+'_title') g.add((ins_title, RDFS.label, Literal(moive_dict[k]['primaryTitle']))) g.add((ins_title, RDF.type, title)) g.add((ins_moiveID, hasTitle, ins_title)) ins_year = URIRef(url_prefix+'_'+k+'_year') if moive_dict[k]['startYear'] != '\\N': g.add((ins_year, RDFS.label, Literal(int(moive_dict[k]['startYear'])))) g.add((ins_year, RDF.type, year)) g.add((ins_moiveID, showInYear,ins_year)) for gener_name in moive_dict[k]['genres'].split(','): if gener_name == r'\N': continue if gener_name not in ins_genres: ins_genres[gener_name] = URIRef(url_prefix+'_genres_'+gener_name.replace(' ', '_')) g.add((ins_genres[gener_name], RDF.type, genres)) g.add((ins_genres[gener_name], RDFS.label, Literal(gener_name))) g.add((ins_moiveID, belongsToGenre, ins_genres[gener_name])) for d in moive_dict[k]['directors']: if d not in ins_directors: ins_directors[d] = URIRef(url_prefix+'_director_'+d.replace(' ', '_')) g.add((ins_directors[d], RDF.type, director)) g.add((ins_directors[d], RDFS.label, Literal(d))) g.add((ins_moiveID, directedBy, ins_directors[d])) g.add((ins_moiveID, involve, ins_directors[d])) for w in moive_dict[k]['writers']: if w not in ins_writers: ins_writers[w] = URIRef(url_prefix+'_writer_'+w.replace(' ', '_')) g.add((ins_writers[w], RDF.type, writer)) g.add((ins_writers[w], RDFS.label, Literal(w))) g.add((ins_moiveID, writedBy, ins_writers[w])) g.add((ins_moiveID, involve, ins_writers[w])) if 'actors' in moive_dict[k]: for a in moive_dict[k]['actors']: if a not in ins_actors: ins_actors[a] = URIRef(url_prefix+'_actor_'+a.replace(' ', '_').replace('"', '')) g.add((ins_actors[a], RDF.type, actor)) g.add((ins_actors[a], RDFS.label, Literal(a))) g.add((ins_moiveID, starredBy, ins_actors[a])) g.add((ins_moiveID, involve, ins_actors[a])) g.bind("ns", my_namespace) g.serialize("imdb_data/moiveDatabase.ttl", format= "xml") if __name__ == '__main__': buildGraph()
[ "noreply@github.com" ]
noreply@github.com