content
stringlengths
1
1.05M
input_ids
listlengths
1
883k
ratio_char_token
float64
1
22.9
token_count
int64
1
883k
""" Purpose: Reads the hourly ACCESS files pulled from the BoM OPeNDAP site and concatenates them into a single file. This script file takes a control file name on the command line. The control file lists the sites to be processed and the variables to be processed. Normal usage is to process all files in a monthly sub-directory. Usage: python access_concat.py access_concat.txt Author: PRI Date: September 2015 """ # Python modules import configobj import datetime import glob import logging import netCDF4 import numpy import os import pytz import pdb from scipy.interpolate import interp1d import sys # since the scripts directory is there, try importing the modules sys.path.append('../scripts') # PFP import constants as c import meteorologicalfunctions as mf import qcio import qcutils # !!! classes !!! # !!! start of function definitions !!! def get_info_dict(cf,site): info = {} in_path = cf["Sites"][site]["in_filepath"] in_name = cf["Sites"][site]["in_filename"] info["in_filename"] = os.path.join(in_path,in_name) out_path = cf["Sites"][site]["out_filepath"] if not os.path.exists(out_path): os.makedirs(out_path) out_name = cf["Sites"][site]["out_filename"] info["out_filename"] = os.path.join(out_path,out_name) info["interpolate"] = True if not cf["Sites"][site].as_bool("interpolate"): info["interpolate"] = False info["site_name"] = cf["Sites"][site]["site_name"] info["site_timezone"] = cf["Sites"][site]["site_timezone"] info["site_tz"] = pytz.timezone(info["site_timezone"]) return info def get_datetime(ds_60minutes,f,info): valid_date = f.variables["valid_date"][:] nRecs = len(valid_date) valid_time = f.variables["valid_time"][:] dl = [datetime.datetime.strptime(str(int(valid_date[i])*10000+int(valid_time[i])),"%Y%m%d%H%M") for i in range(0,nRecs)] dt_utc_all = numpy.array(dl) time_step = numpy.array([(dt_utc_all[i]-dt_utc_all[i-1]).total_seconds() for i in range(1,len(dt_utc_all))]) time_step = numpy.append(time_step,3600) idx = numpy.where(time_step!=0)[0] dt_utc = dt_utc_all[idx] dt_utc = [x.replace(tzinfo=pytz.utc) for x in dt_utc] dt_loc = [x.astimezone(info["site_tz"]) for x in dt_utc] dt_loc = [x-x.dst() for x in dt_loc] dt_loc = [x.replace(tzinfo=None) for x in dt_loc] ds_60minutes.series["DateTime"] = {} ds_60minutes.series["DateTime"]["Data"] = dt_loc nRecs = len(ds_60minutes.series["DateTime"]["Data"]) ds_60minutes.globalattributes["nc_nrecs"] = nRecs return idx def set_globalattributes(ds_60minutes,info): ds_60minutes.globalattributes["time_step"] = 60 ds_60minutes.globalattributes["time_zone"] = info["site_timezone"] ds_60minutes.globalattributes["site_name"] = info["site_name"] ds_60minutes.globalattributes["xl_datemode"] = 0 ds_60minutes.globalattributes["nc_level"] = "L1" return def get_accessdata(cf,ds_60minutes,f,info): # latitude and longitude, chose central pixel of 3x3 grid ds_60minutes.globalattributes["latitude"] = f.variables["lat"][1] ds_60minutes.globalattributes["longitude"] = f.variables["lon"][1] # list of variables to process var_list = cf["Variables"].keys() # get a series of Python datetimes and put this into the data structure valid_date = f.variables["valid_date"][:] nRecs = len(valid_date) valid_time = f.variables["valid_time"][:] dl = [datetime.datetime.strptime(str(int(valid_date[i])*10000+int(valid_time[i])),"%Y%m%d%H%M") for i in range(0,nRecs)] dt_utc_all = numpy.array(dl) time_step = numpy.array([(dt_utc_all[i]-dt_utc_all[i-1]).total_seconds() for i in range(1,len(dt_utc_all))]) time_step = numpy.append(time_step,3600) idxne0 = numpy.where(time_step!=0)[0] idxeq0 = numpy.where(time_step==0)[0] idx_clipped = numpy.where((idxeq0>0)&(idxeq0<nRecs))[0] idxeq0 = idxeq0[idx_clipped] dt_utc = dt_utc_all[idxne0] dt_utc = [x.replace(tzinfo=pytz.utc) for x in dt_utc] dt_loc = [x.astimezone(info["site_tz"]) for x in dt_utc] dt_loc = [x-x.dst() for x in dt_loc] dt_loc = [x.replace(tzinfo=None) for x in dt_loc] flag = numpy.zeros(len(dt_loc),dtype=numpy.int32) ds_60minutes.series["DateTime"] = {} ds_60minutes.series["DateTime"]["Data"] = dt_loc ds_60minutes.series["DateTime"]["Flag"] = flag ds_60minutes.series["DateTime_UTC"] = {} ds_60minutes.series["DateTime_UTC"]["Data"] = dt_utc ds_60minutes.series["DateTime_UTC"]["Flag"] = flag nRecs = len(ds_60minutes.series["DateTime"]["Data"]) ds_60minutes.globalattributes["nc_nrecs"] = nRecs # we're done with valid_date and valid_time, drop them from the variable list for item in ["valid_date","valid_time","lat","lon"]: if item in var_list: var_list.remove(item) # create the QC flag with all zeros nRecs = ds_60minutes.globalattributes["nc_nrecs"] flag_60minutes = numpy.zeros(nRecs,dtype=numpy.int32) # get the UTC hour hr_utc = [x.hour for x in dt_utc] attr = qcutils.MakeAttributeDictionary(long_name='UTC hour') qcutils.CreateSeries(ds_60minutes,'Hr_UTC',hr_utc,Flag=flag_60minutes,Attr=attr) # now loop over the variables listed in the control file for label in var_list: # get the name of the variable in the ACCESS file access_name = qcutils.get_keyvaluefromcf(cf,["Variables",label],"access_name",default=label) # warn the user if the variable not found if access_name not in f.variables.keys(): msg = "Requested variable "+access_name msg = msg+" not found in ACCESS data" logging.error(msg) continue # get the variable attibutes attr = get_variableattributes(f,access_name) # loop over the 3x3 matrix of ACCESS grid data supplied for i in range(0,3): for j in range(0,3): label_ij = label+'_'+str(i)+str(j) if len(f.variables[access_name].shape)==3: series = f.variables[access_name][:,i,j] elif len(f.variables[access_name].shape)==4: series = f.variables[access_name][:,0,i,j] else: msg = "Unrecognised variable ("+label msg = msg+") dimension in ACCESS file" logging.error(msg) series = series[idxne0] qcutils.CreateSeries(ds_60minutes,label_ij,series, Flag=flag_60minutes,Attr=attr) return def get_variableattributes(f,access_name): attr = {} # following code for netCDF4.MFDataset() # for vattr in f.variables[access_name].ncattrs(): # attr[vattr] = getattr(f.variables[access_name],vattr) # following code for access_read_mfiles2() attr = f.varattr[access_name] attr["missing_value"] = c.missing_value return attr def changeunits_airtemperature(ds_60minutes): attr = qcutils.GetAttributeDictionary(ds_60minutes,"Ta_00") if attr["units"] == "K": for i in range(0,3): for j in range(0,3): label = "Ta_"+str(i)+str(j) Ta,f,a = qcutils.GetSeriesasMA(ds_60minutes,label) Ta = Ta - c.C2K attr["units"] = "C" qcutils.CreateSeries(ds_60minutes,label,Ta,Flag=f,Attr=attr) return def changeunits_soiltemperature(ds_60minutes): attr = qcutils.GetAttributeDictionary(ds_60minutes,"Ts_00") if attr["units"] == "K": for i in range(0,3): for j in range(0,3): label = "Ts_"+str(i)+str(j) Ts,f,a = qcutils.GetSeriesasMA(ds_60minutes,label) Ts = Ts - c.C2K attr["units"] = "C" qcutils.CreateSeries(ds_60minutes,label,Ts,Flag=f,Attr=attr) return def changeunits_pressure(ds_60minutes): attr = qcutils.GetAttributeDictionary(ds_60minutes,"ps_00") if attr["units"] == "Pa": for i in range(0,3): for j in range(0,3): label = "ps_"+str(i)+str(j) ps,f,a = qcutils.GetSeriesasMA(ds_60minutes,label) ps = ps/float(1000) attr["units"] = "kPa" qcutils.CreateSeries(ds_60minutes,label,ps,Flag=f,Attr=attr) return def get_windspeedanddirection(ds_60minutes): for i in range(0,3): for j in range(0,3): u_label = "u_"+str(i)+str(j) v_label = "v_"+str(i)+str(j) Ws_label = "Ws_"+str(i)+str(j) u,f,a = qcutils.GetSeriesasMA(ds_60minutes,u_label) v,f,a = qcutils.GetSeriesasMA(ds_60minutes,v_label) Ws = numpy.sqrt(u*u+v*v) attr = qcutils.MakeAttributeDictionary(long_name="Wind speed", units="m/s",height="10m") qcutils.CreateSeries(ds_60minutes,Ws_label,Ws,Flag=f,Attr=attr) # wind direction from components for i in range(0,3): for j in range(0,3): u_label = "u_"+str(i)+str(j) v_label = "v_"+str(i)+str(j) Wd_label = "Wd_"+str(i)+str(j) u,f,a = qcutils.GetSeriesasMA(ds_60minutes,u_label) v,f,a = qcutils.GetSeriesasMA(ds_60minutes,v_label) Wd = float(270) - numpy.ma.arctan2(v,u)*float(180)/numpy.pi index = numpy.ma.where(Wd>360)[0] if len(index)>0: Wd[index] = Wd[index] - float(360) attr = qcutils.MakeAttributeDictionary(long_name="Wind direction", units="degrees",height="10m") qcutils.CreateSeries(ds_60minutes,Wd_label,Wd,Flag=f,Attr=attr) return def get_relativehumidity(ds_60minutes): for i in range(0,3): for j in range(0,3): q_label = "q_"+str(i)+str(j) Ta_label = "Ta_"+str(i)+str(j) ps_label = "ps_"+str(i)+str(j) RH_label = "RH_"+str(i)+str(j) q,f,a = qcutils.GetSeriesasMA(ds_60minutes,q_label) Ta,f,a = qcutils.GetSeriesasMA(ds_60minutes,Ta_label) ps,f,a = qcutils.GetSeriesasMA(ds_60minutes,ps_label) RH = mf.RHfromspecifichumidity(q, Ta, ps) attr = qcutils.MakeAttributeDictionary(long_name='Relative humidity', units='%',standard_name='not defined') qcutils.CreateSeries(ds_60minutes,RH_label,RH,Flag=f,Attr=attr) return def get_absolutehumidity(ds_60minutes): for i in range(0,3): for j in range(0,3): Ta_label = "Ta_"+str(i)+str(j) RH_label = "RH_"+str(i)+str(j) Ah_label = "Ah_"+str(i)+str(j) Ta,f,a = qcutils.GetSeriesasMA(ds_60minutes,Ta_label) RH,f,a = qcutils.GetSeriesasMA(ds_60minutes,RH_label) Ah = mf.absolutehumidityfromRH(Ta, RH) attr = qcutils.MakeAttributeDictionary(long_name='Absolute humidity', units='g/m3',standard_name='not defined') qcutils.CreateSeries(ds_60minutes,Ah_label,Ah,Flag=f,Attr=attr) return def changeunits_soilmoisture(ds_60minutes): attr = qcutils.GetAttributeDictionary(ds_60minutes,"Sws_00") for i in range(0,3): for j in range(0,3): label = "Sws_"+str(i)+str(j) Sws,f,a = qcutils.GetSeriesasMA(ds_60minutes,label) Sws = Sws/float(100) attr["units"] = "frac" qcutils.CreateSeries(ds_60minutes,label,Sws,Flag=f,Attr=attr) return def get_radiation(ds_60minutes): for i in range(0,3): for j in range(0,3): label_Fn = "Fn_"+str(i)+str(j) label_Fsd = "Fsd_"+str(i)+str(j) label_Fld = "Fld_"+str(i)+str(j) label_Fsu = "Fsu_"+str(i)+str(j) label_Flu = "Flu_"+str(i)+str(j) label_Fn_sw = "Fn_sw_"+str(i)+str(j) label_Fn_lw = "Fn_lw_"+str(i)+str(j) Fsd,f,a = qcutils.GetSeriesasMA(ds_60minutes,label_Fsd) Fld,f,a = qcutils.GetSeriesasMA(ds_60minutes,label_Fld) Fn_sw,f,a = qcutils.GetSeriesasMA(ds_60minutes,label_Fn_sw) Fn_lw,f,a = qcutils.GetSeriesasMA(ds_60minutes,label_Fn_lw) Fsu = Fsd - Fn_sw Flu = Fld - Fn_lw Fn = (Fsd-Fsu)+(Fld-Flu) attr = qcutils.MakeAttributeDictionary(long_name='Up-welling long wave', standard_name='surface_upwelling_longwave_flux_in_air', units='W/m2') qcutils.CreateSeries(ds_60minutes,label_Flu,Flu,Flag=f,Attr=attr) attr = qcutils.MakeAttributeDictionary(long_name='Up-welling short wave', standard_name='surface_upwelling_shortwave_flux_in_air', units='W/m2') qcutils.CreateSeries(ds_60minutes,label_Fsu,Fsu,Flag=f,Attr=attr) attr = qcutils.MakeAttributeDictionary(long_name='Calculated net radiation', standard_name='surface_net_allwave_radiation', units='W/m2') qcutils.CreateSeries(ds_60minutes,label_Fn,Fn,Flag=f,Attr=attr) return def get_groundheatflux(ds_60minutes): for i in range(0,3): for j in range(0,3): label_Fg = "Fg_"+str(i)+str(j) label_Fn = "Fn_"+str(i)+str(j) label_Fh = "Fh_"+str(i)+str(j) label_Fe = "Fe_"+str(i)+str(j) Fn,f,a = qcutils.GetSeriesasMA(ds_60minutes,label_Fn) Fh,f,a = qcutils.GetSeriesasMA(ds_60minutes,label_Fh) Fe,f,a = qcutils.GetSeriesasMA(ds_60minutes,label_Fe) Fg = Fn - Fh - Fe attr = qcutils.MakeAttributeDictionary(long_name='Calculated ground heat flux', standard_name='downward_heat_flux_in_soil', units='W/m2') qcutils.CreateSeries(ds_60minutes,label_Fg,Fg,Flag=f,Attr=attr) return def get_availableenergy(ds_60miutes): for i in range(0,3): for j in range(0,3): label_Fg = "Fg_"+str(i)+str(j) label_Fn = "Fn_"+str(i)+str(j) label_Fa = "Fa_"+str(i)+str(j) Fn,f,a = qcutils.GetSeriesasMA(ds_60minutes,label_Fn) Fg,f,a = qcutils.GetSeriesasMA(ds_60minutes,label_Fg) Fa = Fn - Fg attr = qcutils.MakeAttributeDictionary(long_name='Calculated available energy', standard_name='not defined',units='W/m2') qcutils.CreateSeries(ds_60minutes,label_Fa,Fa,Flag=f,Attr=attr) return def perdelta(start,end,delta): curr = start while curr <= end: yield curr curr += delta # !!! end of function definitions !!! # !!! start of main program !!! # start the logger logging.basicConfig(filename='access_concat.log',level=logging.DEBUG) console = logging.StreamHandler() formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s', '%H:%M:%S') console.setFormatter(formatter) console.setLevel(logging.INFO) logging.getLogger('').addHandler(console) # get the control file name from the command line #cf_name = sys.argv[1] cf_name = qcio.get_controlfilename(path='../controlfiles',title='Choose a control file') # get the control file contents logging.info('Reading the control file') cf = configobj.ConfigObj(cf_name) # get stuff from the control file logging.info('Getting control file contents') site_list = cf["Sites"].keys() var_list = cf["Variables"].keys() # loop over sites #site_list = ["AdelaideRiver"] for site in site_list: info = get_info_dict(cf,site) logging.info("Processing site "+info["site_name"]) # instance the data structures logging.info('Creating the data structures') ds_60minutes = qcio.DataStructure() # get a sorted list of files that match the mask in the control file file_list = sorted(glob.glob(info["in_filename"])) # read the netcdf files logging.info('Reading the netCDF files for '+info["site_name"]) f = access_read_mfiles2(file_list,var_list=var_list) # get the data from the netCDF files and write it to the 60 minute data structure logging.info('Getting the ACCESS data') get_accessdata(cf,ds_60minutes,f,info) # set some global attributes logging.info('Setting global attributes') set_globalattributes(ds_60minutes,info) # check for time gaps in the file logging.info("Checking for time gaps") if qcutils.CheckTimeStep(ds_60minutes): qcutils.FixTimeStep(ds_60minutes) # get the datetime in some different formats logging.info('Getting xlDateTime and YMDHMS') qcutils.get_xldatefromdatetime(ds_60minutes) qcutils.get_ymdhmsfromdatetime(ds_60minutes) #f.close() # get derived quantities and adjust units logging.info("Changing units and getting derived quantities") # air temperature from K to C changeunits_airtemperature(ds_60minutes) # soil temperature from K to C changeunits_soiltemperature(ds_60minutes) # pressure from Pa to kPa changeunits_pressure(ds_60minutes) # wind speed from components get_windspeedanddirection(ds_60minutes) # relative humidity from temperature, specific humidity and pressure get_relativehumidity(ds_60minutes) # absolute humidity from temperature and relative humidity get_absolutehumidity(ds_60minutes) # soil moisture from kg/m2 to m3/m3 changeunits_soilmoisture(ds_60minutes) # net radiation and upwelling short and long wave radiation get_radiation(ds_60minutes) # ground heat flux as residual get_groundheatflux(ds_60minutes) # Available energy get_availableenergy(ds_60minutes) if info["interpolate"]: # interploate from 60 minute time step to 30 minute time step logging.info("Interpolating data to 30 minute time step") ds_30minutes = interpolate_to_30minutes(ds_60minutes) # get instantaneous precipitation from accumulated precipitation get_instantaneous_precip30(ds_30minutes) # write to netCDF file logging.info("Writing 30 minute data to netCDF file") ncfile = qcio.nc_open_write(info["out_filename"]) qcio.nc_write_series(ncfile, ds_30minutes,ndims=1) else: # get instantaneous precipitation from accumulated precipitation get_instantaneous_precip60(ds_60minutes) # write to netCDF file logging.info("Writing 60 minute data to netCDF file") ncfile = qcio.nc_open_write(info["out_filename"]) qcio.nc_write_series(ncfile, ds_60minutes,ndims=1) logging.info('All done!')
[ 37811, 198, 30026, 3455, 25, 198, 4149, 82, 262, 30160, 15859, 7597, 3696, 5954, 422, 262, 3248, 44, 440, 6435, 8575, 2969, 2524, 198, 290, 1673, 36686, 689, 606, 656, 257, 2060, 2393, 13, 198, 770, 4226, 2393, 2753, 257, 1630, 2393, ...
2.059388
9,177
# -*- coding: utf-8 -*- from django.http import HttpResponse from django.contrib.auth import login from django.shortcuts import redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from Aluno.views.utils import aluno_exist from annoying.decorators import render_to from django.contrib.auth.models import User from Avaliacao.models import * from Aluno.models import *
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 31077, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 1330, 17594, 198, 6738, 42625, 14208, 13, 19509, 23779, 1330...
3.206349
126
try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from django.conf import settings DEFAULT_NOSCR_ALLOWED_TAGS = 'strong:title b i em:title p:title h1:title h2:title h3:title h4:title h5:title ' + \ 'div:title span:title ol ul li:title a:href:title:rel img:src:alt:title dl td:title dd:title' + \ 'table:cellspacing:cellpadding thead tbody th tr td:title:colspan:rowspan br' def sanitize_html(text, add_nofollow = False, allowed_tags = getattr(settings, 'NOSCR_ALLOWED_TAGS', DEFAULT_NOSCR_ALLOWED_TAGS)): """ Cleans an html string: * remove any not-whitelisted tags - remove any potentially malicious tags or attributes - remove any invalid tags that may break layout * esca[e any <, > and & from remaining text (by bs4); this prevents > >> <<script>script> alert("Haha, I hacked your page."); </</script>script>\ * optionally add nofollow attributes to foreign anchors * removes comments :comment * optionally replace some tags with others: :arg text: Input html. :arg allowed_tags: Argument should be in form 'tag2:attr1:attr2 tag2:attr1 tag3', where tags are allowed HTML tags, and attrs are the allowed attributes for that tag. :return: Sanitized html. This is based on https://djangosnippets.org/snippets/1655/ """ try: from bs4 import BeautifulSoup, Comment, NavigableString except ImportError: raise ImportError('to use sanitize_html() and |noscr, you need to install beautifulsoup4') """ function to check if urls are absolute note that example.com/path/file.html is relative, officially and in Firefox """ is_relative = lambda url: not bool(urlparse(url).netloc) """ regex to remove javascript """ #todo: what exactly is the point of this? is there js in attribute values? #js_regex = compile(r'[\s]*(&#x.{1,7})?'.join(list('javascript'))) """ allowed tags structure """ allowed_tags = [tag.split(':') for tag in allowed_tags.split()] allowed_tags = {tag[0]: tag[1:] for tag in allowed_tags} """ create comment-free soup """ soup = BeautifulSoup(text) for comment in soup.findAll(text = lambda text: isinstance(text, Comment)): comment.extract() for tag in soup.find_all(recursive = True): if tag.name not in allowed_tags: """ hide forbidden tags (keeping content) """ tag.hidden = True else: """ whitelisted tags """ tag.attrs = {attr: val for attr, val in tag.attrs.items() if attr in allowed_tags[tag.name]} """ add nofollow to external links if requested """ if add_nofollow and tag.name == 'a' and 'href' in tag.attrs: if not is_relative(tag.attrs['href']): tag.attrs['rel'] = (tag.attrs['rel'] if 'rel' in tag.attrs else []) + ['nofollow'] """ return as unicode """ return soup.renderContents().decode('utf8')
[ 198, 28311, 25, 198, 197, 6738, 2956, 297, 571, 13, 29572, 1330, 19016, 29572, 198, 16341, 17267, 12331, 25, 198, 197, 6738, 19016, 29572, 1330, 19016, 29572, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 628, 198, 7206, 38865, 62, 45...
2.919916
949
from __future__ import division import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import matplotlib.ticker as mticker import gsd import gsd.fl import numpy as np import os import sys import datetime import time import pickle from shutil import copyfile import inspect import md_tools27 as md_tools from multiprocessing import Pool """ This script plots diffusion vs Gamma in log(D)-log(Gamma) or log(D)-gamma format. The data from a .dat file is used, must be precalculated by plotDiff_pG_parallel.py. Arguments: --cmfree, --cmfixed for the free-moving center of mass regime, and v_cm subtracted respectively. --sf <fubfolder>: subfolder to process (e.g. p32) --NP <number>: number of subprocesses to use for parallelization. Very efficient acceleration by a factor of <number>. """ #Use LaTex for text from matplotlib import rc rc('font',**{'family':'serif','serif':['Computer Modern Roman']}) rc('text', usetex=True) def OLS(x, y): '''OLS: x must be a vertical two-dimensional array''' X = np.hstack((np.reshape(np.ones(x.shape[0]), (-1,1)), x))#.transpose() Xpr = X.transpose() beta = np.dot(np.dot(np.linalg.inv(np.dot(Xpr, X)), Xpr), y) #Estimate errors sigma_sq = np.dot(y - np.dot(X, beta), y - np.dot(X, beta))/(len(y) - 1.) sigma_beta_sq = sigma_sq*np.linalg.inv(np.dot(Xpr, X)) return beta, sigma_beta_sq # = [f_0, df/d(A^2)] def diffusion_from_transport_gsd(folder_path, f_name, center_fixed = True, useframes = -1): """ Diffusion constant D is calculated from 4Dt = <(r(t) - r(0))^2>, or 2D_x*t = <(x(t) - x(0))^2>. The average is calculated over all particles and over different time origins. Time origins go from 0 to n_frames/2, and t goes from 0 to n_frames/2. This way, the data are always within the trajectory. center_fixed = True: eliminate oveall motion of center of mass return D_x, D_y D_x, D_y diffusion for x- and y-coordinates; """ params = read_log(folder_path) if folder_path[-1] != '/': folder_path = folder_path + '/' with gsd.fl.GSDFile(folder_path + f_name, 'rb') as f: n_frames = f.nframes box = f.read_chunk(frame=0, name='configuration/box') half_frames = int(n_frames/2) - 1 #sligtly less than half to avoid out of bound i if useframes < 1 or useframes > half_frames: useframes = half_frames t_step = f.read_chunk(frame=0, name='configuration/step') n_p = f.read_chunk(frame=0, name='particles/N') x_sq_av = np.zeros(useframes) y_sq_av = np.zeros(useframes) for t_origin in range(n_frames - useframes - 1): pos_0 = f.read_chunk(frame=t_origin, name='particles/position') mean_pos_0 = np.mean(pos_0, axis = 0) pos = pos_0 pos_raw = pos_0 for j_frame in range(useframes): pos_m1 = pos pos_m1_raw = pos_raw pos_raw = f.read_chunk(frame=j_frame + t_origin, name='particles/position') - pos_0 pos = md_tools.correct_jumps(pos_raw, pos_m1, pos_m1_raw, box[0], box[1]) if center_fixed: pos -= np.mean(pos, axis = 0) - mean_pos_0 #correct for center of mass movement x_sq_av[j_frame] += np.mean(pos[:,0]**2) y_sq_av[j_frame] += np.mean(pos[:,1]**2) x_sq_av /= (n_frames - useframes - 1) y_sq_av /= (n_frames - useframes - 1) # OLS estimate for beta_x[0] + beta_x[1]*t = <|x_i(t) - x_i(0)|^2> a = np.ones((useframes, 2)) # matrix a = ones(half_frames) | (0; dt; 2dt; 3dt; ...) a[:,1] = params['snap_period']*params['dt']*np.cumsum(np.ones(useframes), axis = 0) - params['dt'] b_cutoff = int(useframes/10) #cutoff to get only linear part of x_sq_av, makes results a bit more clean beta_x = np.linalg.lstsq(a[b_cutoff:, :], x_sq_av[b_cutoff:], rcond=-1) beta_y = np.linalg.lstsq(a[b_cutoff:, :], y_sq_av[b_cutoff:], rcond=-1) fig, ax = plt.subplots(1,1, figsize=(7,5)) ax.scatter(a[:,1], x_sq_av, label='$\\langle x^2\\rangle$') ax.scatter(a[:,1], y_sq_av, label='$\\langle y^2\\rangle$') ax.legend(loc=7) ax.set_xlabel('$t$') ax.set_ylabel('$\\langle r_i^2 \\rangle$') if center_fixed: center_fixed_str = 'cm_fixed' else: center_fixed_str = 'cm_free' fig.savefig(folder_path + 'r2_diff_' + f_name +'_' + center_fixed_str + '.png') plt.close('all') D_x = beta_x[0][1]/2 D_y = beta_y[0][1]/2 print('D_x = {}'.format(D_x)) print('D_y = {}'.format(D_y)) return (D_x, D_y) ## ======================================================================= # Units unit_M = 9.10938356e-31 # kg, electron mass unit_D = 1e-6 # m, micron unit_E = 1.38064852e-23 # m^2*kg/s^2 unit_t = np.sqrt(unit_M*unit_D**2/unit_E) # = 2.568638150515e-10 s epsilon_0 = 8.854187817e-12 # F/m = C^2/(J*m), vacuum permittivity hbar = 1.0545726e-27/(unit_E*1e7)/unit_t m_e = 9.10938356e-31/unit_M unit_Q = np.sqrt(unit_E*1e7*unit_D*1e2) # Coulombs unit_Qe = unit_Q/4.8032068e-10 # e, unit charge in units of elementary charge e e_charge = 1/unit_Qe # electron charge in units of unit_Q curr_fname = inspect.getfile(inspect.currentframe()) curr_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) ##======================================================================= # Make a list of folders we want to process cm_fixed = True #default that can be changed by --cmfree cm_fixed_str = 'cm_fixed' show_text = False Nproc = 1 selected_subfolders = [] folder_list = [] for i in range(len(sys.argv)): if os.path.isdir(sys.argv[i]): folder_list.append(sys.argv[i]) elif sys.argv[i] == '--sf': try: selected_subfolders.append(sys.argv[i+1]) except: raise RuntimeError('Could not recognize the value of --sf. argv={}'.format(argv)) elif sys.argv[i] == '--showtext': show_text = True elif sys.argv[i] == '--GC': gamma_c = float(sys.argv[i+1]) elif sys.argv[i] == '--help' or sys.argv[i] == '-h': print_help() exit() try: print('Gamma_c = {}'.format(gamma_c)) except: raise RuntimeError('Gamma_c not specified. Use --GC argument.') print('Selected subfolders: {}'.format(selected_subfolders)) # Make a list of subfolders p### in each folders subfolder_lists = [] for folder in folder_list: sf_list = [] for item in os.walk(folder): # subfolder name and contained files sf_list.append((item[0], item[2])) sf_list = sf_list[1:] subfolder_lists.append(sf_list) ##======================================================================= for ifold, folder in enumerate(folder_list): print('==========================================================') print(folder) print('==========================================================') # Keep only selected subfolders in the list is there is selection if len(selected_subfolders) > 0: sf_lists_to_go = [] for isf, sf in enumerate(subfolder_lists[ifold]): sf_words = sf[0].split('/') if sf_words[-1] in selected_subfolders: sf_lists_to_go.append(sf) else: sf_lists_to_go = subfolder_lists[ifold] for isf, sf in enumerate(sf_lists_to_go): sf_words = sf[0].split('/') print(sf_words[-1]) if sf_words[-1][0] != 'p': raise ValueError("Expected subfolder name to start with `p`, in {}".format(fname)) log_data = read_log(sf[0]) folder_name = folder.split('/')[-1] if sf[0][-1] == '/': sf[0] = sf[0][:-1] sf_name = sf[0].split('/')[-1] #Read Dx Dy vs Gamma from the .dat file #DxDy_data = {'Dx_arr':Dx_arr, 'Dy_arr':Dy_arr, 'Dx_arr_gauss': Dx_arr*cm2s_convert, 'Dy_arr_gauss':Dy_arr*cm2s_convert, \ # 'gamma_arr':gamma_arr, 'gamma_eff_arr':gamma_eff_arr} cm_fixed_str = 'cm_fixed' with open(sf[0] + '/DxDy_data_' + cm_fixed_str + '_' + sf_name + '_' + folder_name + '.dat', 'r') as ff: DxDy_data = pickle.load(ff) Dx_arr = DxDy_data['Dx_arr'] Dy_arr = DxDy_data['Dy_arr'] gamma_eff_arr = DxDy_data['gamma_eff_arr'] # Remove points where gamma > gamma_c clip_ind = np.where(gamma_eff_arr < gamma_c)[0] Dx_arr_clip = Dx_arr[clip_ind] Dy_arr_clip = Dy_arr[clip_ind] gamma_arr_clip = gamma_eff_arr[clip_ind] print('Dx_arr = {}'.format(Dx_arr_clip)) print('Dy_arr = {}'.format(Dy_arr_clip)) ## ====================================================================== ## Plot Dx,Dy vs effective G (calculated from data rather then read from the log) # in Gaussian units labelfont = 28 tickfont = labelfont - 4 legendfont = labelfont - 4 cm2s_convert = unit_D**2/unit_t*1e4 fig, ax1 = plt.subplots(1,1, figsize=(7,6)) scatter1 = ax1.scatter(gamma_arr_clip, np.log(Dx_arr_clip*cm2s_convert), label='$D_\\perp$', color = 'green', marker='o') ax1.set_xlabel('$\\Gamma$', fontsize=labelfont) ax1.set_ylabel('$\\log(D/D_0)$', fontsize=labelfont) scatter2 = ax1.scatter(gamma_arr_clip, np.log(Dy_arr_clip*cm2s_convert), label='$D_\\parallel$', color = 'red', marker='s') #ax1.set_xlim([np.min(gamma_eff_arr) - 2, np.max(gamma_eff_arr) + 2]) ax1.legend(loc=1, fontsize=legendfont) ax1.tick_params(labelsize= tickfont) ax1.locator_params(nbins=6, axis='y') formatter = mticker.ScalarFormatter(useMathText=True) formatter.set_powerlimits((-3,2)) ax1.yaxis.set_major_formatter(formatter) #Place text if show_text: text_list = ['$\\Gamma_c = {:.1f}$'.format(gamma_c)] y_lim = ax1.get_ylim() x_lim = ax1.get_xlim() h = y_lim[1] - y_lim[0] w = x_lim[1] - x_lim[0] text_x = x_lim[0] + 0.5*w text_y = y_lim[1] - 0.05*h if type(text_list) == list: n_str = len(text_list) for i_fig in range(n_str): ax1.text(text_x, text_y - 0.05*h*i_fig, text_list[i_fig]) elif type(text_list) == str: ax1.text(text_x, text_y, text_list) else: raise TypeError('text_list must be a list of strings or a string') #fig.patch.set_alpha(alpha=1) plt.tight_layout() fig.savefig(folder + '/' + 'DxDy_G_log_' + sf_name + '_' + folder_name + '_{:.2f}'.format(gamma_c) + '.pdf') #fig.savefig(sf[0] + '/' + 'DxDy_Geff_' + cm_fixed_str + '_' + sf_name + '_' + folder_name + '.png') #fig.savefig(sf[0] + '/' + 'DxDy_Geff_' + cm_fixed_str + '_' + sf_name + '_' + folder_name + '.eps') #fig.savefig(sf[0] + '/' + 'DxDy_Geff_' + cm_fixed_str + '_' + sf_name + '_' + folder_name + '.pdf') plt.close('all')
[ 6738, 11593, 37443, 834, 1330, 7297, 201, 198, 11748, 2603, 29487, 8019, 355, 285, 489, 201, 198, 76, 489, 13, 1904, 10786, 46384, 11537, 201, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 201, 198, 11748, 2603, 29487, ...
2.029266
5,638
import argparse import staticconf from backuppy.args import add_name_arg from backuppy.args import subparser from backuppy.manifest import lock_manifest from backuppy.manifest import Manifest from backuppy.stores import get_backup_store HELP_TEXT = ''' WARNING: this command is considered "plumbing" and should be used for debugging or exceptional cases only. You can render your backup store inaccessible if it is used incorrectly. Use at your own risk! '''
[ 11748, 1822, 29572, 198, 198, 11748, 9037, 10414, 198, 198, 6738, 736, 7211, 88, 13, 22046, 1330, 751, 62, 3672, 62, 853, 198, 6738, 736, 7211, 88, 13, 22046, 1330, 22718, 28198, 198, 6738, 736, 7211, 88, 13, 805, 8409, 1330, 5793, ...
3.537879
132
from abc import abstractmethod, ABCMeta import csv from datetime import datetime import funcy as fy from OnePy.barbase import Current_bar, Bar from OnePy.event import events, MarketEvent def __update_bar(self): """""" self.bar.set_instrument(self.instrument) self.bar.add_new_bar(self.cur_bar.cur_data) class CSVFeedBase(FeedMetabase): """CSVopenhighlowclosevolume""" dtformat = "%Y-%m-%d %H:%M:%S" tmformat = "%H:%M:%S" timeindex = None def __set_date(self): """datetime""" if self.fromdate: self.fromdate = datetime.strptime(self.fromdate, "%Y-%m-%d") if self.todate: self.todate = datetime.strptime(self.todate, "%Y-%m-%d") def __set_dtformat(self, bar): """""" date = bar["date"] dt = "%Y-%m-%d %H:%M:%S" if self.timeindex: date = datetime.strptime(str(date), self.dtformat).strftime("%Y-%m-%d") return date + " " + bar[self.timeindex.lower()] else: return datetime.strptime(str(date), self.dtformat).strftime(dt) def preload(self): """ fromdateloadpreload_bar_list fromdateload """ self.set_iteral_buffer(self.load_data()) # for indicator try: bar = _update() # dt = "%Y-%m-%d %H:%M:%S" if self.fromdate: while datetime.strptime(bar["date"], dt) < self.fromdate: bar = _update() self.preload_bar_list.append(bar) else: self.preload_bar_list.pop(-1) # bug elif self.fromdate is None: pass else: raise SyntaxError("Catch a Bug!") except IndexError: pass except StopIteration: print("???") self.preload_bar_list.reverse()
[ 6738, 450, 66, 1330, 12531, 24396, 11, 9738, 48526, 198, 198, 11748, 269, 21370, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 11748, 1257, 948, 355, 277, 88, 198, 198, 6738, 1881, 20519, 13, 5657, 8692, 1330, 9236, 62, 5657, 11,...
1.902584
1,006
#!/usr/bin/env python # -*- coding: utf-8 -*- from conans import ConanFile, CMake, tools from conans.errors import ConanException import os import shutil
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 369, 504, 1330, 31634, 8979, 11, 327, 12050, 11, 4899, 198, 6738, 369, 504, 13, 48277, 1330, 31634, 16922, ...
2.962264
53
import pytest from fastjsonschema import JsonSchemaException exc = JsonSchemaException('data must be null', value='{data}', name='data', definition='{definition}', rule='type')
[ 11748, 12972, 9288, 198, 198, 6738, 3049, 8457, 684, 2395, 2611, 1330, 449, 1559, 27054, 2611, 16922, 628, 198, 41194, 796, 449, 1559, 27054, 2611, 16922, 10786, 7890, 1276, 307, 9242, 3256, 1988, 11639, 90, 7890, 92, 3256, 1438, 11639, ...
3.396226
53
import boto3 import json
[ 11748, 275, 2069, 18, 201, 198, 11748, 33918, 201, 198, 201, 198, 201, 198 ]
2.214286
14
if __name__ =='__main__': main()
[ 198, 361, 11593, 3672, 834, 6624, 6, 834, 12417, 834, 10354, 198, 197, 12417, 3419, 198 ]
2.1875
16
import discord from discord.ext import commands from discord import Embed, Permissions from Util import logger import os import database # Import the config try: import config except ImportError: print("Couldn't import config.py! Exiting!") exit() # Import a monkey patch, if that exists try: import monkeyPatch except ImportError: print("DEBUG: No Monkey patch found!") bot = commands.Bot(command_prefix=os.getenv('prefix'), description='Well boys, we did it. Baddies are no more.', activity=discord.Game(name="with the banhammer")) startup_extensions = ["essentials", "moderation", "info", "listenerCog"] # Function to update the database on startup # Make sure appeal guild is set up properly if __name__ == '__main__': logger.setup_logger() # Load extensions for extension in startup_extensions: try: bot.load_extension(f"cogs.{extension}") except Exception as e: logger.logDebug(f"Failed to load extension {extension}. - {e}", "ERROR") bot.run(os.getenv('token'))
[ 11748, 36446, 198, 6738, 36446, 13, 2302, 1330, 9729, 198, 6738, 36446, 1330, 13302, 276, 11, 2448, 8481, 198, 6738, 7273, 346, 1330, 49706, 198, 11748, 28686, 198, 11748, 6831, 198, 198, 2, 17267, 262, 4566, 198, 28311, 25, 198, 220, ...
2.577878
443
# # This file is part of the Ingram Micro CloudBlue Connect EaaS Extension Runner. # # Copyright (c) 2021 Ingram Micro. All Rights Reserved. #
[ 2, 198, 2, 770, 2393, 318, 636, 286, 262, 44211, 4527, 10130, 14573, 8113, 412, 7252, 50, 27995, 21529, 13, 198, 2, 198, 2, 15069, 357, 66, 8, 33448, 44211, 4527, 13, 1439, 6923, 33876, 13, 198, 2, 628, 628 ]
3.65
40
from django.conf.urls import url from django.conf.urls.i18n import i18n_patterns from django.utils.translation import gettext_lazy as _ from django.views.generic import TemplateView view = TemplateView.as_view(template_name='dummy.html') app_name = 'account' urlpatterns = i18n_patterns( url(_(r'^register/$'), view, name='register'), )
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 19016, 201, 198, 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 13, 72, 1507, 77, 1330, 1312, 1507, 77, 62, 33279, 82, 201, 198, 6738, 42625, 14208, 13, 26791, 13, 41519, 1330, 651, 5...
2.70229
131
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import OrderedDict from moz_sql_parser import parse as parse_sql import pyparsing import re from six.moves.urllib import parse FROM_REGEX = re.compile(' from ("http.*?")', re.IGNORECASE) # Function to extract url from any sql statement def url_from_sql(sql): """ Extract url from any sql statement. :param sql: :return: """ try: parsed_sql = re.split('[( , " )]', str(sql)) for i, val in enumerate(parsed_sql): if val.startswith('https:'): sql_url = parsed_sql[i] return sql_url except Exception as e: print("Error: {}".format(e))
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 17268, 1330, ...
2.555556
315
# -*- coding:utf-8 -*- # Bot2Human # # Replaces messages from bots to humans # typically used in channels that are connected with other IMs using bots # # For example, if a bot send messages from XMPP is like `[nick] content`, # weechat would show `bot | [nick] content` which looks bad; this script # make weecaht display `nick | content` so that the messages looks like # normal IRC message # # Options # # plugins.var.python.bot2human.bot_nicks # space seperated nicknames to forwarding bots # example: teleboto toxsync tg2arch # # plugins.var.python.nick_content_re.X # X is a 0-2 number. This options specifies regex to match nickname # and content. Default regexes are r'\[(?P<nick>.+?)\] (?P<text>.*)', # r'\((?P<nick>.+?)\) (?P<text>.*)', and r'<(?P<nick>.+?)> (?P<text>.*)' # # plugins.var.python.nick_re_count # Number of rules defined # # Changelog: # 0.3.0: Add relayed nicks into nicklist, enabling completion # 0.2.2: Support ZNC timestamp # 0.2.1: Color filtering only applies on nicknames # More than 3 nick rules can be defined # 0.2.0: Filter mIRC color and other control seq from message # 0.1.1: Bug Fixes # 0.1: Initial Release # import weechat as w import re SCRIPT_NAME = "bot2human" SCRIPT_AUTHOR = "Justin Wong & Hexchain & quietlynn" SCRIPT_DESC = "Replace IRC message nicknames with regex match from chat text" SCRIPT_VERSION = "0.3.0" SCRIPT_LICENSE = "GPLv3" DEFAULTS = { 'nick_re_count': '4', 'nick_content_re.0': r'\[(?:\x03[0-9,]+)?(?P<nick>[^:]+?)\x0f?\] (?P<text>.*)', 'nick_content_re.1': r'(?:\x03[0-9,]+)?\[(?P<nick>[^:]+?)\]\x0f? (?P<text>.*)', 'nick_content_re.2': r'\((?P<nick>[^:]+?)\) (?P<text>.*)', 'nick_content_re.3': r'<(?:\x03[0-9,]+)?(?P<nick>[^:]+?)\x0f?> (?P<text>.*)', 'bot_nicks': "", 'znc_ts_re': r'\[\d\d:\d\d:\d\d\]\s+', } CONFIG = { 'nick_re_count': -1, 'nick_content_res': [], 'bot_nicks': [], 'znc_ts_re': None, } if __name__ == '__main__': w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, "", "") parse_config() w.hook_modifier("irc_in_privmsg", "msg_cb", "") w.hook_config("plugins.var.python."+SCRIPT_NAME+".*", "config_cb", "") # Glowing Bear will choke if a nick is added into a newly created group. # As a workaround, we add the group as soon as possible BEFORE Glowing Bear loads groups, # and we must do that AFTER EVERY nicklist reload. nicklist_nick_added satisfies both. # TODO(quietlynn): Find better signals to hook instead. w.hook_signal("nicklist_nick_added", "nicklist_nick_added_cb", "") # vim: ts=4 sw=4 sts=4 expandtab
[ 2, 532, 9, 12, 19617, 25, 40477, 12, 23, 532, 9, 12, 198, 2, 18579, 17, 20490, 198, 2, 198, 2, 18407, 2114, 6218, 422, 29641, 284, 5384, 198, 2, 6032, 973, 287, 9619, 326, 389, 5884, 351, 584, 8959, 82, 1262, 29641, 198, 2, 19...
2.373898
1,134
import xlrd import pandas as pd from openpyxl import load_workbook from xlrd import open_workbook import nltk from nltk.tree import Tree from nltk.parse.generate import generate from nltk.tree import * import os from nltk.tokenize import word_tokenize from nltk.tokenize import sent_tokenize import xml.etree.ElementTree as etree import xlrd import time import sys from nltk import induce_pcfg from nltk.parse import pchart from nltk import PCFG from nltk.draw.util import CanvasFrame import nltk import re import pandas sys.setrecursionlimit(5000) ##start = time.time() ##PERIOD_OF_TIME = 15 # 5min ##while True : sen = input("Enter your sentence: ") sent = word_tokenize(sen) #sen = " . . " ##for i in sent_tokenize(sen): ## print(i) ## ##gram =(""" ##S -> NP VP [1.0] ##NP -> ADJ [0.0041666667] | N [0.0041666667] | N N [0.3] | PN [0.0041666667] | ADJ N [0.0041666667] | AV N [0.0041666667] | N ADJ [0.1] | NU NU [0.5] | NU AP [0.0041666667] | ADJ AP [0.0041666667] | AV [0.0041666667] | ADJ AP [0.0041666667] | N PN [0.0041666667] | VP N [0.0041666667] | PN ADV [0.0041666667] | AV ADV [0.0041666667] | N VP [0.0041666667] | NU N [0.0041666667] | NU [0.0041666667] | V [0.0041666667] | AV AP [0.0041666667] | ADJ VP [0.0041666667] | N AP [0.0041666667] | ADJ AP [0.0041666667] | ADJ NP [0.0041666667] | N NP [0.0041666667] ##VP -> V AP [0.557] | ADJ V [0.05] | AP [0.00625] | NP [0.00625] | AV PN [0.056] | V ADV [0.00625] | V [0.00625] | AV AP [0.00625] | N ADV [0.00625] | N [0.00625] | NU N [0.1] | N V [0.0375] | ADJ AP [0.00625] | N AV [0.10] | V ADJ [0.00625] | ADJ NP [0.00625] | N AP [0.00625] | N NP [0.00625] | NP NP [0.00625] | AV VP [0.00625] | ADJ VP [0.00625] | N VP [0.00625] ##AP -> AV V [0.056] | V NP [0.166] | ADJ V [0.051] | NP VP [0.0142857143] | AV NP [0.0142857143] | PN NP [0.0142857143] | N V [0.037] | NU N [0.2] | AV N [0.2] | ADJ PN [0.066] | V VP [0.0142857143] | N ADV [0.0142857143] | PN AV [0.024] | ADJ VP [0.0142857143] | PN N [0.1] | AV ADV [0.0142857143] ##ADV -> ADV ADJ [0.4] | PN VP [0.025] | N AP [0.025] | AV AV [0.5] | V AP [0.025] | N V [0.025] ##""") #0.0769231 gram = (""" S -> NP NP RP VP RP NP PRP VP [0.0769230769] NP -> N [0.0294118] NP -> PRP N [0.0294118] VP -> V [0.05] NP -> N N [0.0294118] VP -> V [0.05] S -> NP RP POP NP NP PP ADJ VP [0.0769230769] NP -> PRP N [0.0294118] NP -> N [0.0294118] NP -> PRP N [0.0294118] PP -> NP POP [0.2] NP -> PRP N [0.0294118] VP -> V [0.05] S -> ADVP INT CO PP ADV INT RP ADJ PP NP ADV VP [0.0769230769] ADVP -> ADV NP [0.333333] NP -> N [0.0294118] PP -> NP POP [0.6] NP -> N [0.0294118] NP -> N [0.0294118] NP -> PRN [0.0294118] VP -> V [0.1] S -> NP PP NP NP VP [0.0769230769] NP -> N [0.0294118] PP -> PRP NP [0.2] NP -> PRP N [0.0294118] NP -> PRP N [0.0294118] NP -> PRP N N [0.0294118] VP -> V [0.05] S -> NP ADJP ADVP VP [0.0769230769] NP -> NP CO NP [0.0294118] NP -> PRP N [0.0294118] NP -> PRP N [0.0294118] ADJP -> ADJ ADJ NP [0.333333] NP -> N [0.0294118] ADVP -> ADV NP [0.333333] NP -> N [0.0294118] VP -> V [0.05] S -> PP VP CO NP VP [0.0769230769] NP -> N N [0.0294118] VP -> V [0.05] NP -> N [0.0294118] VP -> V [0.05] S -> NP NP NP VP VP [0.0769230769] NP -> PRN [0.0294118] NP -> PRP N N [0.0294118] NP -> PRP N [0.0294118] VP -> V [0.05] VP -> V [0.1] S -> NP NP VP [0.0769230769] NP -> PRN [0.0294118] NP -> N [0.0294118] VP -> V [0.05] S -> NP ADJP VP [0.0769230769] NP -> PRN [0.0294118] ADJP -> ADJ NP [0.333333] NP -> N N [0.0294118] VP -> V [0.05] S -> NP ADJP VP VP [0.0769230769] NP -> PRN [0.0294118] ADJP -> ADJ NP [0.333333] NP -> N [0.0294118] VP -> V [0.05] VP -> V [0.05] S -> NP ADJ VP VP [0.0769230769] NP -> PRN [0.0588235] VP -> V [0.1] S -> NP VP VP VP [0.0769230769] VP -> V [0.05] S -> NP ADVP VP [0.0769230769] NP -> PRN [0.0294118] ADVP -> PRP ADV RP [0.333333] VP -> V [0.05] """) ##gram =(""" ##S -> NP VP [1.0] ##NP -> ADJ [0] | N [0] | N N [0.4] | PN [0] | ADJ N [0] | AV N [0] | N ADJ [0.1] | NU NU [0.5] | NU AP [0] | ADJ AP [0] | AV [0] | ADJ AP [0] | N PN [0] | VP N [0] | PN ADV [0] | AV ADV [0] | N VP [0] | NU N [0] | NU [0] | V [0] | AV AP [0] | ADJ VP [0] | N AP [0] | ADJ AP [0] | ADJ NP [0] | N NP [0] ##VP -> V AP [0.557] | ADJ V [0.05] | AP [0.00625] | NP [0.00625] | AV PN [0.056] | V ADV [0.00625] | V [0.00625] | AV AP [0.00625] | N ADV [0.00625] | N [0.00625] | NU N [0.1] | N V [0.0375] | ADJ AP [0.00625] | N AV [0.10] | V ADJ [0.00625] | ADJ NP [0.00625] | N AP [0.00625] | N NP [0.00625] | NP NP [0.00625] | AV VP [0.00625] | ADJ VP [0.00625] | N VP [0.00625] ##AP -> AV V [0.056] | V NP [0.166] | ADJ V [0.051] | NP VP [0.0142857143] | AV NP [0.0142857143] | PN NP [0.0142857143] | N V [0.037] | NU N [0.2] | AV N [0.2] | ADJ PN [0.066] | V VP [0.0142857143] | N ADV [0.0142857143] | PN AV [0.024] | ADJ VP [0.0142857143] | PN N [0.1] | AV ADV [0.0142857143] ##ADV -> ADV ADJ [0.4] | PN VP [0.025] | N AP [0.025] | AV AV [0.5] | V AP [0.025] | N V [0.025] ##""") ## ## ## ##gram = (""" ##S -> NP VP [1.0] ##NP -> AV [0.5] | ADJ AP [0.5] ##VP -> AP [1.0] ##AP -> PN NP [0.5] | N V [0.5] ##AV -> "" [1.0] ##PN -> "" [1.0] ##ADJ -> "" [1.0] ##V -> "" [1.0] ##N -> "" [1.0] ##""") ## ##gram = (""" ##S -> NP VP ##NP -> NU | N N ##VP -> NP NP ## ##""") # ##gram =(""" ##S -> NP VP ##NP -> V ##VP -> N V ##""") ##dic = pandas.read_csv("dictionary.csv") ##doc = pandas.read_csv("corpus2.csv", quotechar='"', delimiter=',') #book = open_workbook("Pastho dictionary2.xlsx") ##for sheet in book.sheets(): ## for rowidx in range(sheet.nrows): ## row = sheet.row(rowidx) ## for i in sent: ## for colidx,cell in enumerate(row): ## if cell.value == i:#row value ## #print ("Found Row Element") ## #print(rowidx, colidx) ## #print(cell.value) ## print(row) ## print('\n') ## ##book = load_workbook("Pastho dictionary2.xlsx") ##worksheet = book.sheetnames ##sheet = book["Sheet1"] ##c=1 ##for i in sheet: ## d = sheet.cell(row=c, column=2) ## ## if(d.value is None): ## print(" Try Again ") ## ## ## elif (d.value == " Noun"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "N ->" + "'" + cell.value + "'" + " " + "[0.0000851934]" + "\n" ## ## ## elif (d.value == "Noun"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "N ->" + "'" + cell.value + "'" + " " + "[0.0000851934]" + "\n" ## ## ## elif (d.value == " Verb"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "V ->" + "'" + cell.value + "'" + " " + "[0.0005530973]" + "\n" ## ## ## elif (d.value == "Verb"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "V ->" + "'" + cell.value + "'" + " " + "[0.0005530973]" + "\n" ## ## ## elif (d.value == " Adjective"): ## ## cell = sheet.cell(row=c, column=1) ## gram = gram + "ADJ ->" + "'" + cell.value + "'" + " " + "[0.000280112]" + "\n" ## ## ## elif (d.value == "Adjective"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "ADJ ->" + "'" + cell.value + "'" + " " + "[0.000280112]" + "\n" ## ## ## elif (d.value == " Participles"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "PP ->" + "'" + cell.value + "'" + " " + "[0.0588235294]" + "\n" ## #print("hi") ## ## elif (d.value == " Adverb"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "AV ->" + "'" + cell.value + "'" + " " + "[0.0025380711]" + "\n" ## ## ## elif (d.value == "Adverb"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "AV ->" + "'" + cell.value + "'" + " " + "[0.0025380711]" + "\n" ## ## ## elif (d.value == " numerical"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "NU ->" + "'" + cell.value + "'" + " " + "[0.0222222222]" + "\n" ## ## ## elif (d.value == "numerical"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "NU ->" + "'" + cell.value + "'" + " " + "[0.0222222222]" + "\n" ## ## ## elif (d.value == " proNoun"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "PN ->" + "'" + cell.value + "'" + " " + "[0.0125]" + "\n" ## ## ## ## elif (d.value == " ProNoun"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "PN ->" + "'" + cell.value + "'" + " " + "[0.0125]" + "\n" ## ## ## ## elif (d.value == "ProNoun"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "PN ->" + "'" + cell.value + "'" + " " + "[0.0125]" + "\n" ## ## ## ## elif (d.value == " suffix"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "SA ->" + "'" + cell.value + "'" + " " + "[0.0476190476]" + "\n" ## ## ## ## elif (d.value == " Suffix"): ## cell = sheet.cell(row=c, column=1) ## gram = gram + "SA ->" + "'" + cell.value + "'" + " " + "[0.0476190476]" + "\n" ## c=c+1 #print(gram) grammar1 = nltk.PCFG.fromstring(gram) sr_parser = nltk.ViterbiParser(grammar1) #max=0 for tree in sr_parser.parse(sent): print(tree) ## ## with open("prob.txt", "a", encoding='utf-8') as output: ## output.write(str(tree)) ## output.write("\n") ## ## if (tree.prob() > max): ## max=tree.prob() ## max_tree=tree ## ##print(max) ##print(max_tree) ##sr_parser = nltk.parse.chart.ChartParser(grammar1) #sr_parser = nltk.RecursiveDescentParser(grammar1) #sr_parser = nltk.ShiftReduceParser(grammar1) ##for tree in sr_parser.parse(sent): ## #values = tree ## ## with open("test.txt", "a", encoding='utf-8') as output: ## output.write(str(tree)) ## output.write("\n") ## ## print(tree) ## #break ##
[ 11748, 2124, 75, 4372, 201, 198, 11748, 19798, 292, 355, 279, 67, 201, 198, 6738, 1280, 9078, 87, 75, 1330, 3440, 62, 1818, 2070, 201, 198, 6738, 2124, 75, 4372, 1330, 1280, 62, 1818, 2070, 201, 198, 11748, 299, 2528, 74, 201, 198, ...
1.847552
5,720
from RFEM.initModel import Model, clearAtributes
[ 6738, 20445, 3620, 13, 15003, 17633, 1330, 9104, 11, 1598, 2953, 7657, 198 ]
3.769231
13
#!/usr/bin/env python # coding: utf-8 import os import sys import string import unittest from uuid import uuid4 from unittest import mock from random import random, randint from datetime import datetime, timedelta pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa sys.path.insert(0, pkg_root) # noqa import dss from dss import Replica from dss.util.version import datetime_to_version_format from dss.storage.identifiers import UUID_REGEX, TOMBSTONE_SUFFIX from dss.storage.bundles import enumerate_available_bundles, get_tombstoned_bundles from dss.logging import configure_test_logging from tests.infra import testmode, MockStorageHandler if __name__ == '__main__': unittest.main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 4731, 198, 11748, 555, 715, 395, 198, 6738, 334, 27112, 1330, 334, 27112, 19, 198, 6738, 555, 7...
2.847656
256
#!/usr/local/bin/python # coding=utf-8 # Headless firefox title test for jenkins build. intro=""" ---------------------------------------------------------------- File : ches_prod_test_titles_headless.py Description : Headless firefox title test for ches prod sites. Author : Sherri Li ---------------------------------------------------------------- """ print(intro) from selenium import webdriver from xvfbwrapper import Xvfb import unittest import os import sys sys.path.append("..") import json import time import datetime import timeit import logging import write_log import check_status import create_log import spreadsheet # Generate log folder and file. # Default log level is INFO (everything). Go to create_log.py to change. folderName = create_log.createLog("ChesProdTitle") ################################### # HELPER FUNCTION ################# ################################### # def run_test(self,siteName,row): # with Xvfb() as xvfb: # try: # driver = webdriver.Firefox() # driver.implicitly_wait(30) # self.browser = driver # except: # write_log.logSetupError("firefox") # print("Unable to load firefox") # # assert(self.browser is not None) # assert(self.sites is not None) # browser = self.browser # print('\n') # # # Check that the site url exists. # try: # site = self.sites[siteName] # except: # write_log.logErrorMsg("your disk. Check to make sure the "+self.json_file+" is up to date.\n", "Test terminated prematurely. You are missing the "+siteName+" url") # print(self.ERRORCOLOR+"ERROR: "+self.DEFAULTCOLOR + siteName + " credentials not found on your disk.") # return # # site = self.sites[siteName] # # Populate spreadsheet with app name, class name, current date. # self.spreadsheet.write_cell(row,1,siteName) # self.spreadsheet.write_cell(row,2,type(self).__name__) # self.spreadsheet.write_cell(row,3,self.today[:16]) # # # Once the site is found, make sure HTTP status code is 200, 301, or 302. # # Call the function to get status code from file check_status.py. # result = check_status.checkStatus(site['url'], [200, 301, 302]) # if result==False: # self.spreadsheet.write_cell(row,5,"fail\ninvalid http response") # return # exit test # else: # #BEGIN TIME # self.timeStart = timeit.default_timer() # browser.get(site['url']) # write_log.logInfoMsg(siteName, "title test started") # print("Testing " + siteName)# + " with " + browser.name.capitalize() + " Found site['title'] " + browser.title) # browser.implicitly_wait(30) # # # You can also search for 'text' in browser.page_source rather than browser.title # if site['title'] not in browser.title: # self.spreadsheet.write_cell(row,5,site['title'] + " not found") # write_log.logErrorMsg(siteName+'\n', "Desired title '" + site['title'] + "' not found") # print(self.ERRORCOLOR+"ERROR:"+self.DEFAULTCOLOR+ "desired title '" + site['title'] + "' not found on " + siteName) # browser.save_screenshot(folderName+'/error_'+siteName+'.png') # else: # #END TIME # timeElapsed = timeit.default_timer() - self.timeStart # write_log.logSummary(self.browserType, timeElapsed) # # Populate spreadsheet with time and result. # self.spreadsheet.write_cell(row,4,round(timeElapsed, 5)) # self.spreadsheet.write_cell(row,5,"pass") # write_log.logSuccess(siteName+'\n', "title") # print(self.SUCCESSCOLOR+"passed:"+self.DEFAULTCOLOR+ "'" + site['title'] + "' found on " + siteName) # # Kick off the test! if __name__ == "__main__": #print("\n\u001b[33smAll test logs and screenshots will be saved to the following folder in your current directory:\n" + folderName + "\n\u001b[0m") unittest.main()
[ 2, 48443, 14629, 14, 12001, 14, 8800, 14, 29412, 198, 2, 19617, 28, 40477, 12, 23, 198, 198, 2, 7123, 1203, 2046, 12792, 3670, 1332, 329, 474, 268, 5331, 1382, 13, 198, 198, 600, 305, 2625, 15931, 198, 10097, 198, 8979, 220, 220, ...
2.284977
1,937
import numba import time from . import glob_var from . import structures # for some reason, caching of this function fails the run on Columbia HPC and it doesn't really affect the speed # since it only needs to compile once but it's getting called so many times # for some reason, caching of this function fails the run on Columbia HPC and it doesn't really affect the speed # since it only needs to compile once but it's getting called so many times # I have tried really hard to improve performance of this step with numba # the main problem is that I have a list of n_sequence objects and their size can vary # therefore, I can't pass them to function as a numpy array with any of the standard formats # I can mane a numpy array with an object dtyo (like dtype=structures.n_sequence) but Numba does not support it # for more detailed explanation, see https://stackoverflow.com/questions/14639496/how-to-create-a-numpy-array-of-arbitrary-length-strings # numba will deprecate standard python lists too # there is also numba typed list structure (from numba.typed import List) but it's an experimental feature so far so I don't want to rely on it # see here https://numba.pydata.org/numba-doc/dev/reference/pysupported.html # so there is no way to pass a bunch of variable-sized sequence objects to numba in the way that would make the iterations faster def calculate_profile_one_motif(motif, n_seqs_list, is_degenerate = False): start_time = time.time() current_profile = structures.w_profile(len(n_seqs_list)) for i, seq in enumerate(n_seqs_list): match = is_there_motif_instance(motif, seq, is_degenerate) if match: current_profile.values[i] = True end_time = time.time() time_spent = end_time - start_time return current_profile, time_spent def calculate_profiles_list_motifs(n_motifs_list, n_seqs_list, do_print=False, is_degenerate = False): profiles_list = [0] * len(n_motifs_list) for i, motif in enumerate(n_motifs_list): current_profile, time_spent = calculate_profile_one_motif(motif, n_seqs_list, is_degenerate) profiles_list[i] = current_profile.values if do_print: print("Motif number %d binds %d sequences. It took %.2f seconds" % (i, current_profile.sum(), time_spent)) return profiles_list
[ 11748, 997, 7012, 198, 11748, 640, 198, 198, 6738, 764, 1330, 15095, 62, 7785, 198, 6738, 764, 1330, 8573, 628, 198, 198, 2, 329, 617, 1738, 11, 40918, 286, 428, 2163, 10143, 262, 1057, 319, 9309, 367, 5662, 290, 340, 1595, 470, 110...
2.837647
850
"""Basic cleanup on lightcurves (trimming, sigma-clipping).""" import logging import numpy as np import matplotlib.pyplot as plt import k2spin.utils as utils from k2spin import detrend def trim(time, flux, unc_flux): """Remove infs, NaNs, and negative flux values. Inputs ------ time, flux, unc_flux: array_like Outputs ------- trimmed_time, trimmed_flux, trimmed_unc: arrays good: boolean mask, locations that were kept """ good = np.where((np.isfinite(flux)==True) & (flux>0) & (np.isfinite(unc_flux)==True) & (np.isfinite(time)==True) & (time>2061.5))[0] trimmed_time = time[good] trimmed_flux = flux[good] trimmed_unc = unc_flux[good] return trimmed_time, trimmed_flux, trimmed_unc, good def smooth_and_clip(time, flux, unc_flux, clip_at=3, to_plot=False): """Smooth the lightcurve, then clip based on residuals.""" if to_plot: plt.figure(figsize=(8,4)) ax = plt.subplot(111) ax.plot(time,flux,'k.',label="orig") # Simple sigma clipping first to get rid of really big outliers ct, cf, cu, to_keep = sigma_clip(time, flux, unc_flux, clip_at=clip_at) logging.debug("c len t %d f %d u %d tk %d", len(ct), len(cf), len(cu), len(to_keep)) if to_plot: ax.plot(ct, cf, '.',label="-1") # Smooth with supersmoother without much bass enhancement for i in range(3): det_out = detrend.simple_detrend(ct, cf, cu, phaser=0) detrended_flux, detrended_unc, bulk_trend = det_out # Take the difference, and find the standard deviation of the residuals # logging.debug("flux, bulk trend, diff") # logging.debug(cf[:5]) # logging.debug(bulk_trend[:5]) f_diff = cf - bulk_trend # logging.debug(f_diff[:5]) diff_std = np.zeros(len(f_diff)) diff_std[ct<=2102] = np.std(f_diff[ct<=2102]) diff_std[ct>2102] = np.std(f_diff[ct>2102]) # logging.debug("std %f %f",diff_std[0], diff_std[-1]) if to_plot: ax.plot(ct, bulk_trend) logging.debug("%d len tk %d diff %d", i, len(to_keep), len(f_diff)) # Clip outliers based on residuals this time to_keep = to_keep[abs(f_diff)<=(diff_std*clip_at)] ct = time[to_keep] cf = flux[to_keep] cu = unc_flux[to_keep] if to_plot: ax.plot(ct, cf, '.',label=str(i)) if to_plot: ax.legend() clip_time = time[to_keep] clip_flux = flux[to_keep] clip_unc_flux = unc_flux[to_keep] return clip_time, clip_flux, clip_unc_flux, to_keep def sigma_clip(time, flux, unc_flux, clip_at=6): """Perform sigma-clipping on the lightcurve. Inputs ------ time, flux, unc_flux: array_like clip_at: float (optional) how many sigma to clip at. Defaults to 6. Outputs ------- clipped_time, clipped_flux, clipped_unc: arrays to_keep: boolean mask of locations that were kept """ # Compute statistics on the lightcurve med, stdev = utils.stats(flux, unc_flux) # Sigma-clip the lightcurve outliers = abs(flux-med)>(stdev*clip_at) to_clip = np.where(outliers==True)[0] to_keep = np.where(outliers==False)[0] logging.debug("Sigma-clipping") logging.debug(to_clip) clipped_time = np.delete(time, to_clip) clipped_flux = np.delete(flux, to_clip) clipped_unc = np.delete(unc_flux, to_clip) # Return clipped lightcurve return clipped_time, clipped_flux, clipped_unc, to_keep def prep_lc(time, flux, unc_flux, clip_at=3): """Trim, sigma-clip, and calculate stats on a lc. Inputs ------ time, flux, unc_flux: array_like clip_at: float (optional) How many sigma to clip at. Defaults to 6. Set to None for no sigma clipping Outputs ------- clean_time, clean_flux, clean_unc: arrays """ # Trim the lightcurve, remove bad values t_time, t_flux, t_unc, t_kept = trim(time, flux, unc_flux) # Run sigma-clipping if desired, repeat 2X if clip_at is not None: c_time, c_flux, c_unc, c_kept = smooth_and_clip(t_time, t_flux, t_unc, clip_at=clip_at) else: c_time, c_flux, c_unc, c_kept = t_time, t_flux, t_unc, t_kept all_kept = t_kept[c_kept] # Calculate statistics on lightcurve c_med, c_stdev = utils.stats(c_flux, c_unc) # Return cleaned lightcurve and statistics return c_time, c_flux, c_unc, c_med, c_stdev, all_kept
[ 37811, 26416, 27425, 319, 1657, 22019, 1158, 357, 2213, 27428, 11, 264, 13495, 12, 565, 4501, 21387, 15931, 198, 198, 11748, 18931, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 1...
2.184336
2,094
a=int(input('enter a:')) b=int(input('enter b:')) c=int(input('enter c:')) min_value= a if a<b and a<c else b if b<c else c print(min_value)
[ 64, 28, 600, 7, 15414, 10786, 9255, 257, 32105, 4008, 198, 65, 28, 600, 7, 15414, 10786, 9255, 275, 32105, 4008, 198, 66, 28, 600, 7, 15414, 10786, 9255, 269, 32105, 4008, 198, 1084, 62, 8367, 28, 257, 611, 257, 27, 65, 290, 257, ...
2.295082
61
import asyncio import functools import time def timing(f): "Decorator to log" if asyncio.iscoroutinefunction(f): else: return wrap
[ 11748, 30351, 952, 198, 11748, 1257, 310, 10141, 198, 11748, 640, 628, 198, 198, 4299, 10576, 7, 69, 2599, 198, 220, 220, 220, 366, 10707, 273, 1352, 284, 2604, 1, 628, 220, 220, 220, 611, 30351, 952, 13, 2304, 273, 28399, 8818, 7, ...
2.637931
58
#!/usr/bin/env python # coding: utf-8 # BEGIN --- required only for testing, remove in real world code --- BEGIN import os import sys THISDIR = os.path.dirname(os.path.abspath(__file__)) APPDIR = os.path.abspath(os.path.join(THISDIR, os.path.pardir, os.path.pardir)) sys.path.insert(0, APPDIR) # END --- required only for testing, remove in real world code --- END # # See http://tools.cherrypy.org/wiki/ModWSGI # import cherrypy from pyjsonrpc.cp import CherryPyJsonRpc, rpcmethod # WSGI-Application application = cherrypy.Application(Root())
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 2, 347, 43312, 11420, 2672, 691, 329, 4856, 11, 4781, 287, 1103, 995, 2438, 11420, 347, 43312, 198, 11748, 28686, 198, 11748, 25064, 198, 43...
2.830769
195
import os import sys import io import time import zipfile import pydicom import numpy as np import scipy.interpolate import numba_interpolate from skimage import filters import nrrd import cv2 c_out_pixel_spacing = np.array((2.23214293, 2.23214293, 3.)) c_resample_tolerance = 0.01 # Only interpolate voxels further off of the voxel grid than this c_interpolate_seams = True # If yes, cut overlaps between stations to at most c_max_overlap and interpolate along them, otherwise cut at center of overlap c_correct_intensity = True # If yes, apply intensity correction along overlap c_max_overlap = 8 # Used in interpolation, any station overlaps are cut to be most this many voxels in size c_trim_axial_slices = 4 # Trim this many axial slices from the output volume to remove folding artefacts c_use_gpu = True # If yes, use numba for gpu access, otherwise use scipy on cpu c_store_mip = True # If yes, extract 2d mean intensity projections as .npy c_store_ff_slice = False # If If yes, extract single fat fraction slice with liver coverage c_store_volumes = False # If yes, extract 3d volumes as .nrrd ## # Extract mean intensity projection from input UK Biobank style DICOM zip # Generate mean intensity projection ## # Return, for S stations: # R: station start coordinates, shape Sx3 # R_end: station end coordinates, shape Sx3 # dims: station extents, shape Sx3 # # Coordinates in R and R_end are in the voxel space of the first station ## # Linearly taper off voxel values along overlap of two stations, # so that their addition leads to a linear interpolation. ## # Take mean intensity of slices at the edge of the overlap between stations i and (i+1) # Adjust mean intensity of each slice along the overlap to linear gradient between these means ## # Ensure that the stations i and (i + 1) overlap by at most c_max_overlap. # Trim any excess symmetrically # Update their extents in W and W_end ## # Station voxels are positioned at R to R_end, not necessarily aligned with output voxel grid # Resample stations onto voxel grid of output volume if __name__ == '__main__': main(sys.argv)
[ 11748, 28686, 198, 11748, 25064, 198, 11748, 33245, 198, 198, 11748, 640, 198, 198, 11748, 19974, 7753, 198, 11748, 279, 5173, 291, 296, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 629, 541, 88, 13, 3849, 16104, 378, 198, ...
3.243284
670
# From http://julip.co/2012/05/arduino-python-soundlight-spectrum/ # Python 2.7 code to analyze sound and interface with Arduino import pyaudio # from http://people.csail.mit.edu/hubert/pyaudio/ import serial # from http://pyserial.sourceforge.net/ import numpy # from http://numpy.scipy.org/ import audioop import sys import math import struct ''' Sources http://www.swharden.com/blog/2010-03-05-realtime-fft-graph-of-audio-wav-file-or-microphone-input-with-python-scipy-and-wckgraph/ http://macdevcenter.com/pub/a/python/2001/01/31/numerically.html?page=2 ''' MAX = 0 NUM = 20 if __name__ == '__main__': #list_devices() fft()
[ 2, 3574, 2638, 1378, 73, 377, 541, 13, 1073, 14, 6999, 14, 2713, 14, 446, 84, 2879, 12, 29412, 12, 23661, 2971, 12, 4443, 6582, 14, 198, 2, 11361, 362, 13, 22, 2438, 284, 16602, 2128, 290, 7071, 351, 27634, 198, 220, 198, 11748, ...
2.575397
252
# Copyright (c) 2021 NVIDIA Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== import numpy as np import os import logging import argparse import sys import warnings import sys import time import json import cudf from sklearn import metrics import pandas as pd import tritonclient.http as httpclient import tritonclient.grpc as grpcclient from tritonclient.utils import * from google.cloud import pubsub_v1 from google.protobuf.json_format import MessageToJson from google.pubsub_v1.types import Encoding if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('-u', '--triton_grpc_url', type=str, required=False, default='localhost:8001', help='URL to Triton gRPC Endpoint') parser.add_argument('-m', '--model_name', type=str, required=False, default='dcn_ens', help='Name of the model ensemble to load') parser.add_argument('-d', '--test_data', type=str, required=False, default='/crit_int_pq/day_23.parquet', help='Path to a test .parquet file. Default') parser.add_argument('-b', '--batch_size', type=int, required=False, default=64, help='Batch size. Max is 64 at the moment, but this max size could be specified when create the model and the ensemble.') parser.add_argument('-n', '--n_batches', type=int, required=False, default=1, help='Number of batches of data to send') parser.add_argument('-v', '--verbose', type=bool, required=False, default=False, help='Verbosity, True or False') parser.add_argument("--project_id", type=str, required=True, default="dl-tme", help="Google Cloud project ID") parser.add_argument("--topic_id", type=str, required=True, default="pubsub", help="Pub/Sub topic ID") args = parser.parse_args() logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO, datefmt='%d-%m-%y %H:%M:%S') logging.info(f"Args: {args}") # warnings can be disabled if not sys.warnoptions: warnings.simplefilter("ignore") try: triton_client = grpcclient.InferenceServerClient(url=args.triton_grpc_url, verbose=args.verbose) logging.info("Triton client created.") triton_client.is_model_ready(args.model_name) logging.info(f"Model {args.model_name} is ready!") except Exception as e: logging.error(f"Channel creation failed: {str(e)}") sys.exit() # Load the dataset CATEGORICAL_COLUMNS = ['C' + str(x) for x in range(1,27)] CONTINUOUS_COLUMNS = ['I' + str(x) for x in range(1,14)] LABEL_COLUMNS = ['label'] col_names = CATEGORICAL_COLUMNS + CONTINUOUS_COLUMNS col_dtypes = [np.int32]*26 + [np.int64]*13 logging.info("Reading dataset..") all_batches = cudf.read_parquet(args.test_data, num_rows=args.batch_size*args.n_batches) results=[] with grpcclient.InferenceServerClient(url=args.triton_grpc_url) as client: for batch in range(args.n_batches): logging.info(f"Requesting inference for batch {batch}..") start_idx = batch*args.batch_size end_idx = (batch+1)*(args.batch_size) # Convert the batch to a triton inputs current_batch = all_batches[start_idx:end_idx] columns = [(col, current_batch[col]) for col in col_names] inputs = [] for i, (name, col) in enumerate(columns): d = col.values_host.astype(col_dtypes[i]) d = d.reshape(len(d), 1) inputs.append(grpcclient.InferInput(name, d.shape, np_to_triton_dtype(col_dtypes[i]))) inputs[i].set_data_from_numpy(d) outputs = [] outputs.append(grpcclient.InferRequestedOutput("OUTPUT0")) response = client.infer(args.model_name, inputs, request_id=str(1), outputs=outputs) results.extend(response.as_numpy("OUTPUT0")) publish_batch(args.project_id, args.topic_id, current_batch, response.as_numpy("OUTPUT0")) logging.info(f"ROC AUC Score: {metrics.roc_auc_score(all_batches[LABEL_COLUMNS].values.tolist(), results)}")
[ 2, 15069, 357, 66, 8, 33448, 15127, 10501, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 35...
2.05521
2,735
""" throughput dialog """ import tkinter as tk from tkinter import ttk from typing import TYPE_CHECKING from core.gui.dialogs.colorpicker import ColorPickerDialog from core.gui.dialogs.dialog import Dialog from core.gui.themes import FRAME_PAD, PADX, PADY if TYPE_CHECKING: from core.gui.app import Application
[ 37811, 198, 9579, 1996, 17310, 198, 37811, 198, 11748, 256, 74, 3849, 355, 256, 74, 198, 6738, 256, 74, 3849, 1330, 256, 30488, 198, 6738, 19720, 1330, 41876, 62, 50084, 2751, 198, 198, 6738, 4755, 13, 48317, 13, 38969, 18463, 13, 804...
3
106
from django.test.client import BOUNDARY from api.tests.unit_tests.utils import *
[ 6738, 42625, 14208, 13, 9288, 13, 16366, 1330, 347, 15919, 13153, 198, 6738, 40391, 13, 41989, 13, 20850, 62, 41989, 13, 26791, 1330, 1635, 198 ]
3.24
25
import socket # get your phones IP by visiting https://www.whatismyip.com/ # then specify your IPv6 here like so UDP_IP = "2a01:30:2a04:3c1:c83c:2315:9d2b:9a40" # IPv6 UDP_PORT = 9999 print "UDP target IP:", UDP_IP print "UDP target port:", UDP_PORT print "" print "W, A, S, D - Move mouse" print "Space - Click" print "Q - Quit" # IPv6 sock = socket.socket(socket.AF_INET6, # Internet socket.SOCK_DGRAM) # UDP # IPv4 # sock = socket.socket(socket.AF_INET, # Internet # socket.SOCK_DGRAM) # UDP while True: key = ord(getch()) if key == 119: # W # print 'up' sock.sendto('0', (UDP_IP, UDP_PORT)) elif key == 97: # A # print 'left' sock.sendto('2', (UDP_IP, UDP_PORT)) elif key == 115: # S # print 'down' sock.sendto('1', (UDP_IP, UDP_PORT)) elif key == 100: # D # print 'right' sock.sendto('3', (UDP_IP, UDP_PORT)) elif key == 113: # Q break elif key == 32: # Space # print 'click' sock.sendto('4', (UDP_IP, UDP_PORT))
[ 11748, 17802, 628, 198, 2, 651, 534, 9512, 6101, 416, 10013, 3740, 1378, 2503, 13, 10919, 1042, 39666, 13, 785, 14, 198, 2, 788, 11986, 534, 25961, 21, 994, 588, 523, 198, 52, 6322, 62, 4061, 796, 366, 17, 64, 486, 25, 1270, 25, ...
2
550
from utils.security.auth import AccountAuthToken import falcon, uuid, datetime from routes.middleware import AuthorizeResource from utils.base import api_validate_form, api_message from utils.config import AppState
[ 6738, 3384, 4487, 13, 12961, 13, 18439, 1330, 10781, 30515, 30642, 198, 11748, 24215, 1102, 11, 334, 27112, 11, 4818, 8079, 198, 198, 6738, 11926, 13, 27171, 1574, 1330, 6434, 1096, 26198, 198, 6738, 3384, 4487, 13, 8692, 1330, 40391, 6...
3.661017
59
#!/Usr/bin/env python """ Akash and Vishal are quite fond of travelling. They mostly travel by railways. They were travelling in a train one day and they got interested in the seating arrangement of their compartment. The compartment looked something like So they got interested to know the seat number facing them and the seat type facing them. The seats are denoted as follows : Window Seat : WS Middle Seat : MS Aisle Seat : AS You will be given a seat number, find out the seat number facing you and the seat type, i.e. WS, MS or AS. INPUT: First line of input will consist of a single integer T denoting number of test-cases. Each test-case consists of a single integer N denoting the seat-number. OUTPUT: For each test case, print the facing seat-number and the seat-type, separated by a single space in a new line. CONSTRAINTS: 1 T 10^5 1 N 10^8 """ __author__ = "Cristian Chitiva" __date__ = "March 17, 2019" __email__ = "cychitivav@unal.edu.co" T = int(input()) while T > 0: N = int(input()) position = N % 12 section = N//12 if position == 1: word = str((position + 11) + 12*section) print(word + ' WS') elif position == 2: word = str((position + 9) + 12*section) print(word + ' MS') elif position == 3: word = str((position + 7) + 12*section) print(word + ' AS') elif position == 4: word = str((position + 5) + 12*section) print(word + ' AS') elif position == 5: word = str((position + 3) + 12*section) print(word + ' MS') elif position == 6: word = str((position + 1) + 12*section) print(word + ' WS') elif position == 7: word = str((position - 1) + 12*section) print(word + ' WS') elif position == 8: word = str((position - 3) + 12*section) print(word + ' MS') elif position == 9: word = str((position - 5) + 12*section) print(word + ' AS') elif position == 10: word = str((position - 7) + 12*section) print(word + ' AS') elif position == 11: word = str((position - 9) + 12*section) print(word + ' MS') else: word = str((position - 11) + 12*section) print(word + ' WS') T -= 1
[ 2, 48443, 5842, 81, 14, 8800, 14, 24330, 21015, 201, 198, 37811, 201, 198, 33901, 1077, 290, 36900, 282, 389, 2407, 16245, 286, 16574, 13, 1119, 4632, 3067, 416, 45247, 13, 1119, 547, 16574, 287, 257, 4512, 530, 1110, 290, 484, 1392, ...
2.459431
949
#!/usr/bin/env python3 import matplotlib matplotlib.use('pgf') import matplotlib.pyplot as plt import numpy as np from multi_isotope_calculator import Multi_isotope import plotsettings as ps plt.style.use('seaborn-darkgrid') plt.rcParams.update(ps.tex_fonts()) def figure1(): """Compare data to Sharp paper (tails U234 vs product U235)""" data = np.genfromtxt("../data/sharp_fig1.csv", delimiter=",") data = data[np.argsort(data[:,0])] composition = {'234': 5.5e-3, '235': (0.72, 3, 0.2)} calculator = Multi_isotope(composition, feed=1, process='diffusion', downblend=False) results = np.empty(shape=data.shape, dtype=float) for i, xp in enumerate(data[:,0]): calculator.set_product_enrichment(xp*100) calculator.calculate_staging() results[i,0] = calculator.xp[3] results[i,1] = calculator.xt[2] data *= 100 results *= 100 pulls = 100 * (data[:,1]-results[:,1]) / data[:,1] ylims = (1e299, 0) for values in (data, results): ylims = (min(ylims[0], min(values[:,1])), max(ylims[1], max(values[:,1]))) return data, results, pulls def figure5(): """Compare data to Sharp paper (tails qty vs product qty)""" sharp = np.genfromtxt("../data/sharp_fig5.csv", delimiter=",") sharp = sharp[np.argsort(sharp[:,0])] calc = Multi_isotope({'235': (0.711, 5, 0.2)}, max_swu=15000, process='diffusion', downblend=False) results = np.empty(shape=sharp.shape, dtype=float) for i, xp in enumerate(sharp[:,0]): calc.set_product_enrichment(xp*100) calc.calculate_staging() results[i,0] = calc.xp[3] * 100 results[i,1] = calc.t sharp[:,0] *= 100 pulls = 100 * (sharp[:,1]-results[:,1]) / sharp[:,1] return sharp, results, pulls if __name__=='__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 2603, 29487, 8019, 198, 6759, 29487, 8019, 13, 1904, 10786, 6024, 69, 11537, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 299, 32152, 355, ...
2.1693
886
print("--------------------------------------------------") firulais = Perro("Firulais") firulais.comer() firulais.dormir() firulais.ladrar() print("--------------------------------------------------")
[ 4798, 7203, 47232, 438, 4943, 201, 198, 69, 343, 4712, 271, 796, 2448, 305, 7203, 37, 343, 4712, 271, 4943, 201, 198, 69, 343, 4712, 271, 13, 785, 263, 3419, 201, 198, 69, 343, 4712, 271, 13, 67, 579, 343, 3419, 201, 198, 69, 34...
3.551724
58
import random import torch from torch import nn from torch.nn import functional as F
[ 11748, 4738, 198, 11748, 28034, 198, 6738, 28034, 1330, 299, 77, 198, 6738, 28034, 13, 20471, 1330, 10345, 355, 376, 628, 628, 198 ]
3.869565
23
from fman import DirectoryPaneCommand, show_alert import os import zipfile from fman.url import as_human_readable from fman.url import as_url
[ 6738, 277, 805, 1330, 27387, 47, 1531, 21575, 11, 905, 62, 44598, 201, 198, 11748, 28686, 201, 198, 11748, 19974, 7753, 201, 198, 6738, 277, 805, 13, 6371, 1330, 355, 62, 10734, 62, 46155, 201, 198, 6738, 277, 805, 13, 6371, 1330, 3...
3.040816
49
import boto3 client = boto3.client('rds')
[ 11748, 275, 2069, 18, 198, 198, 16366, 796, 275, 2069, 18, 13, 16366, 10786, 4372, 82, 11537, 198 ]
2.388889
18
import re from Smell import Smell from SmellCategory import SmellCategory from Reference import Reference SMELL = "\[smell\]" SMELL_ID = "\[smell-id\]" SMELL_NAME = "\[smell-name\]" SMELL_END = "\[smell-end\]" SMELL_DES = "\[smell-description\]" SMELL_AKA = "\[smell-aka\]" SMELL_CATEGORY = "\[smell-category\]" SMELL_SUBCATEGORY = "\[smell-subcategory\]" SMELL_REF = "\[smell-ref\]" SCAT = "\[define-smell-category\]" SCAT_ID = "\[smell-category-id\]" SCAT_NAME = "\[smell-category-name\]" SCAT_PARENT = "\[smell-category-parent\]" SCAT_END = "\[define-smell-category-end\]" REF = "\[reference\]" REF_ID = "\[ref-id\]" REF_TEXT = "\[ref-text\]" REF_IMAGE = "\[ref-image\]" REF_URL = "\[ref-url\]" REF_END = "\[ref-end\]"
[ 11748, 302, 198, 6738, 2439, 695, 1330, 2439, 695, 198, 6738, 2439, 695, 27313, 1330, 2439, 695, 27313, 198, 6738, 20984, 1330, 20984, 198, 198, 50, 11682, 3069, 796, 37082, 58, 5796, 695, 59, 30866, 198, 50, 11682, 3069, 62, 2389, 79...
2.286164
318
from YorForger import REDIS # AFK # Helpers
[ 198, 6738, 42453, 1890, 1362, 1330, 23848, 1797, 628, 198, 2, 12341, 42, 628, 628, 198, 198, 2, 10478, 364, 198 ]
2.47619
21
import threading
[ 11748, 4704, 278, 628 ]
4.5
4
# -*- coding: utf-8 -*- """Various utility functions for handling geometry etc.""" import math from statistics import mean from typing import Tuple, Union, Iterable, Generator, Mapping import logging MODULE_MATPLOTLIB_AVAILABLE = True try: import matplotlib.pyplot as plt import matplotlib.lines as lines except ImportError as e: MODULE_MATPLOTLIB_AVAILABLE = False log = logging.getLogger(__name__) def __ccw__(vertices, star, link): """Sort the link in CounterClockWise order around the star""" x, y, z = 0, 1, 2 localized = [(vertices[v][x] - vertices[star][x], vertices[v][y] - vertices[star][y]) for v in link] rev_lookup = {localized[i]: a for i, a in enumerate(link)} return rev_lookup, sorted(localized, key=lambda p: math.atan2(p[1], p[0])) def distance(a,b) -> float: """Distance between point a and point b""" x,y = 0,1 return math.sqrt((a[x] - b[x])**2 + (a[y] - b[y])**2) def orientation(a: Tuple[float, float], b: Tuple[float, float], c: Tuple[float, float]): """ Determine if point (p) is LEFT, RIGHT, COLLINEAR with line segment (ab). :param a: Point 1 :param b: Point 2 :param c: Point which orientation to is determined with respect to (a,b) :return: 1 if (a,b,p) is CCW, 0 if p is collinear, -1 if (a,b,p) is CW >>> orientation((0.0, 0.0), (1.0, 0.0), (2.0, 0.0)) 0 >>> orientation((0.0, 0.0), (1.0, 0.0), (0.5, 0.0)) 0 >>> orientation((0.0, 0.0), (1.0, 0.0), (0.5, 1.0)) 1 >>> orientation((0.0, 0.0), (1.0, 0.0), (0.5, -1.0)) -1 """ x,y = 0,1 re = ((a[x] - c[x]) * (b[y] - c[y])) - ((a[y] - c[y]) * (b[x] - c[x])) if re > 0: return 1 elif re == 0: return 0 else: return -1 def is_between(a,c,b) -> bool: """Return True if point c is on the segment ab Ref.: https://stackoverflow.com/a/328193 """ return math.isclose(distance(a,c) + distance(c,b), distance(a,b)) def in_bbox(tri: Tuple, bbox: Tuple) -> bool: """Evaluates if a triangle is in the provided bounding box. A triangle is in the BBOX if it's centorid is either completely within the BBOX, or overlaps with the South (lower) or West (left) boundaries of the BBOX. :param tri: A triangle defined as a tuple of three cooridnates of (x,y,z) :param bbox: Bounding Box as (minx, miny, maxx, maxy) """ if not bbox or not tri: return False x,y,z = 0,1,2 minx, miny, maxx, maxy = bbox # mean x,y,z coordinate of the triangle centroid = (mean(v[x] for v in tri), mean(v[y] for v in tri)) within = ((minx < centroid[x] < maxx) and (miny < centroid[y] < maxy)) on_south_bdry = is_between((minx, miny), centroid, (maxx, miny)) on_west_bdry = is_between((minx, miny), centroid, (minx, maxy)) return any((within, on_south_bdry, on_west_bdry)) def bbox(polygon) -> Tuple[float, float, float, float]: """Compute the Bounding Box of a polygon. :param polygon: List of coordinate pairs (x,y) """ x,y = 0,1 vtx = polygon[0] minx, miny, maxx, maxy = vtx[x], vtx[y], vtx[x], vtx[y] for vtx in polygon[1:]: if vtx[x] < minx: minx = vtx[x] elif vtx[y] < miny: miny = vtx[y] elif vtx[x] > maxx: maxx = vtx[x] elif vtx[y] > maxy: maxy = vtx[y] return minx, miny, maxx, maxy def get_polygon(feature): """Get the polygon boundaries from a GeoJSON feature.""" if not feature['geometry']['type'] == 'Polygon': log.warning(f"Feature ID {feature['properties']['id']} is not a Polygon") else: return feature['geometry']['coordinates'][0] def find_side(polygon: Iterable[Tuple[float, ...]], neighbor: Iterable[Tuple[float, ...]], abs_tol: float = 0.0) ->\ Union[Tuple[None, None], Tuple[str, Tuple[Tuple[float, float], Tuple[float, float]]]]: """Determines on which side does the neighbor polygon is located. .. warning:: Assumes touching BBOXes of equal dimensions. :param polygon: The base polygon. A list of coordinate tuples. :param neighbor: The neighbor polygon. :param abs_tol: Absolute coordinate tolerance. Passed on to `:math.isclose` :returns: One of ['E', 'N', 'W', 'S'], the touching line segment """ minx, miny, maxx, maxy = 0,1,2,3 bbox_base = bbox(polygon) bbox_nbr = bbox(neighbor) if math.isclose(bbox_nbr[minx], bbox_base[maxx], abs_tol=abs_tol) \ and math.isclose(bbox_nbr[miny], bbox_base[miny], abs_tol=abs_tol): return 'E', ((bbox_base[maxx], bbox_base[miny]), (bbox_base[maxx], bbox_base[maxy])) elif math.isclose(bbox_nbr[minx], bbox_base[minx], abs_tol=abs_tol) \ and math.isclose(bbox_nbr[miny], bbox_base[maxy], abs_tol=abs_tol): return 'N', ((bbox_base[maxx], bbox_base[maxy]), (bbox_base[minx], bbox_base[maxy])) elif math.isclose(bbox_nbr[maxx], bbox_base[minx], abs_tol=abs_tol) \ and math.isclose(bbox_nbr[maxy], bbox_base[maxy], abs_tol=abs_tol): return 'W', ((bbox_base[minx], bbox_base[maxy]), (bbox_base[minx], bbox_base[miny]), ) elif math.isclose(bbox_nbr[maxx], bbox_base[maxx], abs_tol=abs_tol) \ and math.isclose(bbox_nbr[maxy], bbox_base[miny], abs_tol=abs_tol): return 'S', ((bbox_base[minx], bbox_base[miny]), (bbox_base[maxx], bbox_base[miny]), ) else: return None,None def plot_star(vid, stars, vertices): """Plots the location of a vertex and its incident vertices in its link. :Example: plot_star(1, stars, vertices) :param vid: Vertex ID :param stars: List with the Link of the vertex :param vertices: List with vertex coordinates (used as lookup) :return: Plots a plot on screen """ if not MODULE_MATPLOTLIB_AVAILABLE: raise ModuleNotFoundError("matplotlib is not installed, cannot plot") plt.clf() pts = [vertices[vid]] + [vertices[v] for v in stars[vid]] r = list(zip(*pts)) plt.scatter(*r[0:2]) labels = [vid] + stars[vid] # zip joins x and y coordinates in pairs for i, e in enumerate(labels): if e == vid: plt.annotate(e, # this is the text (pts[i][0], pts[i][1]), # this is the point to label textcoords="offset points", # how to position the text xytext=(0, 10), # distance from text to points (x,y) ha='center', # horizontal alignment can be left, right or center color='red') else: plt.annotate(e, # this is the text (pts[i][0], pts[i][1]), textcoords="offset points", xytext=(0, 10), ha='center') plt.show() def mean_coordinate(points: Iterable[Tuple]) -> Tuple[float, float]: """Compute the mean x- and y-coordinate from a list of points. :param points: An iterable of coordinate tuples where the first two elements of the tuple are the x- and y-coordinate respectively. :returns: A tuple of (mean x, mean y) coordinates """ mean_x = mean(pt[0] for pt in points) mean_y = mean(pt[1] for pt in points) return mean_x, mean_y # Computing Morton-code. Reference: https://github.com/trevorprater/pymorton --- def __part1by1_64(n): """64-bit mask""" n &= 0x00000000ffffffff # binary: 11111111111111111111111111111111, len: 32 n = (n | (n << 16)) & 0x0000FFFF0000FFFF # binary: 1111111111111111000000001111111111111111, len: 40 n = (n | (n << 8)) & 0x00FF00FF00FF00FF # binary: 11111111000000001111111100000000111111110000000011111111, len: 56 n = (n | (n << 4)) & 0x0F0F0F0F0F0F0F0F # binary: 111100001111000011110000111100001111000011110000111100001111, len: 60 n = (n | (n << 2)) & 0x3333333333333333 # binary: 11001100110011001100110011001100110011001100110011001100110011, len: 62 n = (n | (n << 1)) & 0x5555555555555555 # binary: 101010101010101010101010101010101010101010101010101010101010101, len: 63 return n def interleave(*args): """Interleave two integers""" if len(args) != 2: raise ValueError('Usage: interleave2(x, y)') for arg in args: if not isinstance(arg, int): print('Usage: interleave2(x, y)') raise ValueError("Supplied arguments contain a non-integer!") return __part1by1_64(args[0]) | (__part1by1_64(args[1]) << 1) def morton_code(x: float, y: float): """Takes an (x,y) coordinate tuple and computes their Morton-key. Casts float to integers by multiplying them with 100 (millimeter precision). """ return interleave(int(x * 100), int(y * 100)) def rev_morton_code(morton_key: int) -> Tuple[float, float]: """Get the coordinates from a Morton-key""" x,y = deinterleave(morton_key) return float(x)/100.0, float(y)/100.0 # Compute tile range ----------------------------------------------------------- def tilesize(tin_paths) -> Tuple[float, float]: """Compute the tile size from Morton-codes for the input TINs. .. note:: Assumes regular grid. :returns: The x- and y-dimensions of a tile """ centroids = [] for i, morton_code in enumerate(tin_paths): if i == 2: break else: centroids.append(rev_morton_code(morton_code)) return abs(centroids[0][0] - centroids[1][0]), abs(centroids[0][1] - centroids[1][1]) def __in_bbox__(point, range): """Check if a point is within a BBOX."""
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 40009, 10361, 5499, 329, 9041, 22939, 3503, 526, 15931, 198, 198, 11748, 10688, 198, 6738, 7869, 1330, 1612, 198, 6738, 19720, 1330, 309, 29291, 11, 4479, 11, ...
2.210407
4,420
#!/usr/bin/env python # Copyright 2020 Richard Maynard (richard.maynard@gmail.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import struct import sys import click from tfworker import constants as const from tfworker.commands import CleanCommand, RootCommand, TerraformCommand from tfworker.commands.root import get_platform from tfworker.commands.version import VersionCommand def validate_deployment(ctx, deployment, name): """Validate the deployment is no more than 16 characters.""" if len(name) > 16: click.secho("deployment must be less than 16 characters", fg="red") raise SystemExit(2) return name def validate_host(): """Ensure that the script is being run on a supported platform.""" supported_opsys = ["darwin", "linux"] supported_machine = ["amd64"] opsys, machine = get_platform() if opsys not in supported_opsys: click.secho( f"this application is currently not known to support {opsys}", fg="red", ) raise SystemExit(2) if machine not in supported_machine: click.secho( f"this application is currently not known to support running on {machine} machines", fg="red", ) if struct.calcsize("P") * 8 != 64: click.secho( "this application can only be run on 64 bit hosts, in 64 bit mode", fg="red" ) raise SystemExit(2) return True if __name__ == "__main__": cli()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 15069, 12131, 6219, 1737, 40542, 357, 7527, 446, 13, 11261, 40542, 31, 14816, 13, 785, 8, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, ...
2.92522
682
import wx from wx.lib.agw.floatspin import FloatSpin from shs.input.fdf_options import ChoiceLine, MeasuredLine, NumberLine, ThreeNumberLine try: from geom import Geom except ImportError: from shs.geom import Geom
[ 11748, 266, 87, 198, 6738, 266, 87, 13, 8019, 13, 363, 86, 13, 48679, 1381, 11635, 1330, 48436, 4561, 259, 198, 198, 6738, 427, 82, 13, 15414, 13, 69, 7568, 62, 25811, 1330, 18502, 13949, 11, 2185, 34006, 13949, 11, 7913, 13949, 11,...
2.82716
81
#!/usr/bin/env python ######################################### # Title: Rocksat Data Server Class # # Project: Rocksat # # Version: 1.0 # # Date: August, 2017 # # Author: Zach Leffke, KJ4QLP # # Comment: Initial Version # ######################################### import socket import threading import sys import os import errno import time import binascii import numpy import datetime as dt from logger import *
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 29113, 7804, 2, 198, 2, 220, 220, 11851, 25, 34243, 265, 6060, 9652, 5016, 220, 220, 220, 1303, 198, 2, 4935, 25, 34243, 265, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,...
2.433333
210
#!/usr/bin/env python3 import datetime import time import os import matplotlib.pyplot as plt import matplotlib.dates as md import numpy as np # Test: if __name__ == '__main__': hd = handle_data() #hd.clean_file() hd.update_graph('./static/data_log.png')
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 4818, 8079, 198, 11748, 640, 198, 11748, 28686, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 2603, 29487, 8019, 13, 19581, 355, 45243, 198, 11748,...
2.653061
98
import math total_fuel = 0 total_fuel_recursive = 0 with open("input.txt", "r") as fp: for line in fp: total_fuel += fuel_needed(line) total_fuel_recursive += fuel_needed_recursive(line) print("Total fuel: " + str(total_fuel)) print("Total fuel recursive: " + str(total_fuel_recursive))
[ 11748, 10688, 198, 198, 23350, 62, 25802, 796, 657, 198, 23350, 62, 25802, 62, 8344, 30753, 796, 657, 198, 198, 4480, 1280, 7203, 15414, 13, 14116, 1600, 366, 81, 4943, 355, 277, 79, 25, 198, 220, 220, 220, 329, 1627, 287, 277, 79, ...
2.583333
120
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt4 (Qt v4.8.7) # # WARNING! All changes made in this file will be lost! from PySide import QtCore qt_resource_data = "\ \x00\x00\x03\x97\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x16\x00\x00\x00\x16\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\ \x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\ \x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\ \x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\ \x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\ \x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x03\x14\x49\x44\ \x41\x54\x38\x8d\x9d\x95\x4f\x68\x1c\x55\x1c\xc7\x3f\x6f\x66\x76\ \x36\x59\xdb\x22\x68\x0e\x36\x20\x45\x89\x50\x04\x0f\x1e\xa4\xb5\ \x88\x7f\xd0\x3d\x88\x47\x11\x64\x4c\x73\xf2\x56\xcf\x1e\xbd\x8a\ \x78\xea\x45\xeb\x41\x44\xcc\xa9\x67\xc1\x28\x88\x42\x6a\x6d\x83\ \xff\xb0\x17\xcd\xa1\x96\x6c\x43\x9a\xad\x49\x37\xdd\x9d\x9d\x79\ \xf3\x7b\xbf\x9f\x87\xdd\x6e\x77\xd3\xa8\x49\xbf\xf0\x98\xf9\x31\ \xcc\xe7\x7d\xdf\xf7\xfd\xe6\x8d\xcb\xb2\x8c\xff\x52\x15\xca\xc2\ \x39\x17\x9b\x99\x73\xce\x01\x70\xe7\x26\xad\xa5\x7f\xf4\xf3\xf2\ \xf9\x34\x4d\xdb\xbb\xdf\x4b\x00\xbc\xf7\xf1\xec\xec\xec\xe1\xbd\ \xc0\xeb\x1b\xad\xfa\x67\x9f\x7e\x8e\x73\x6e\x62\x00\x2c\x2e\x7e\ \x71\x7c\xe9\x9b\xa5\x15\xe0\x29\x60\xe7\x1e\xf0\xdc\xdc\xdc\xef\ \xce\xb9\xc7\x01\xdb\x0d\x36\x33\xd6\xd6\xd6\x28\xcb\x72\x54\x87\ \x10\x50\x55\x4e\x9f\x5e\xa0\xd3\xe9\x3c\xba\xf2\xd3\xca\x85\xb2\ \xef\x9f\x49\xd3\xb4\x3f\x01\x16\x91\xe3\xf3\xf3\xf3\x84\x10\x30\ \x33\x54\x15\x00\x55\xe5\x83\x0f\xdf\x27\x8a\x22\x2e\x5d\xbe\x34\ \x31\xe1\xc9\x13\x27\x00\x38\x73\xe6\x1d\x77\xee\x93\x8f\x9f\x5c\ \xbe\xb0\x7c\x16\xe3\xed\xdd\x60\x13\x11\xd7\x6a\xb5\x10\x11\x54\ \x15\x55\xc5\xcc\x70\xce\x91\xa6\x29\xcd\x57\x9a\x98\xd9\xc8\x35\ \x40\xbb\xdd\x46\x44\x78\xf6\xe4\x29\x77\xf1\xc7\x1f\xde\x50\xd9\ \x05\x0e\x21\x98\xaa\x3a\x11\x19\x2d\xf3\xce\x00\x48\x92\x84\xa5\ \xaf\xbf\x22\x84\x30\x72\xfc\xe2\x0b\x2f\xe1\xbd\x1f\x14\x0e\x54\ \x35\x82\x68\x32\x63\x91\xca\x44\x2a\x42\x08\xf8\xea\x2e\x58\x44\ \xc0\xc5\xe0\x62\x9a\xcd\x57\x27\xdc\x8e\x5f\x93\xa4\x8e\x59\xa4\ \xeb\xb5\x97\xa7\xbe\x3b\x76\xcd\x67\xab\xab\xea\xb2\x2c\xa3\xd1\ \x68\xc8\xc2\xc2\x42\x7c\xf1\x4a\x8b\xf3\xbf\x08\x51\x74\x77\x66\ \x33\x23\x72\x63\xf5\xae\xfd\x1d\xf2\x87\xab\x73\xc1\x39\xd7\xbe\ \x7c\xee\xcd\xa3\xa3\x8c\x43\x08\x6c\xde\x56\x9e\x7b\xfa\x18\xaf\ \x9d\x7a\x62\xf4\x02\xc0\xb0\xbb\xf6\xd4\xf8\xa3\xdc\x4b\xfc\xde\ \x47\xdf\xce\x64\xd9\x5b\x36\xca\x58\x44\xc8\x4b\x63\x66\xba\xce\ \x66\xa7\xe0\xfa\x56\xff\x5f\x50\x7b\x6b\xaa\x16\xf3\xf0\xe1\x1a\ \x51\x1c\x75\x61\xb2\x2b\xe8\x55\xf0\xd8\x03\x75\x30\x48\xc6\xe2\ \xd8\x8f\xd4\xa0\xf4\x81\xc8\x45\x9d\x11\xb8\xaa\x06\x9b\x97\x57\ \x8e\x23\x8d\x3a\x66\x90\xc4\xfb\x07\xf7\x0a\x61\x3a\x8d\xf1\x5e\ \x70\x11\xdb\x23\xf0\x20\x8a\x40\xee\xe1\x50\xa3\x06\x40\xb2\x0f\ \x6e\x50\x23\x2f\x03\x12\x94\xe9\xb4\x46\xd1\xf7\x00\x37\xc7\x1d\ \x13\x42\xa0\xa8\x00\x1c\x5e\xf4\x1e\x80\x1a\xc3\xaf\x72\x50\x7b\ \x51\xd4\x26\x3b\xa4\xd3\x2b\x31\xb5\x1b\xe3\x8e\x55\x44\xe8\x7b\ \xc3\x07\xa3\x5b\x04\x7a\xa5\xe0\x45\xf7\x04\xec\x19\x47\x19\xb3\ \x79\x2b\x47\x54\xd7\x27\x1c\x57\x22\xf8\x60\x6c\x77\x2b\x5a\x5b\ \x7d\x82\xfe\x3f\x6c\x5c\x3b\xb5\x88\xad\x4e\x51\x59\xd0\xcd\x11\ \x18\xd0\xbc\x0c\xd4\x6b\x31\xb7\xfa\x82\x1c\x10\x0a\x50\x56\xc6\ \x76\xb7\xf4\x38\xf7\xf7\x38\x98\x6e\xa1\x3c\xf2\xd0\x11\x1e\x6c\ \x24\x1c\x9a\x3a\x58\xab\x01\x44\xce\xd1\xeb\x95\x62\x6a\x5b\x00\ \xc9\xe2\xe2\x62\xd2\x6c\x36\xed\xcf\x8d\x92\x9b\x9d\x82\xef\x7f\ \xbe\x7a\x60\x28\x40\x30\xa5\xdb\xcb\x53\xe9\x6d\x5f\x23\x1e\x38\ \xae\xe7\x79\xfe\xe5\xaf\xab\xed\xd7\xab\x46\x3d\xb9\xdd\x2b\xee\ \x03\xeb\xcc\xcc\xa4\xdc\xd9\x58\xbe\x72\xfe\xdd\xab\xbf\x0d\x4f\ \x81\x1a\x70\x14\x98\x61\x2c\x9a\xfb\x90\x32\xf8\x3d\xfd\x95\x65\ \x59\x91\x00\x02\x5c\x07\x6e\x30\x79\xa6\x1c\x54\x36\x84\x57\x00\ \xff\x00\xf1\x00\xf2\xbe\xa6\x77\x61\xc0\x00\x00\x00\x00\x49\x45\ \x4e\x44\xae\x42\x60\x82\ \x00\x00\x04\x3c\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x16\x00\x00\x00\x16\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\ \x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\ \x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\ \x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\ \x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\ \x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x03\xb9\x49\x44\ \x41\x54\x38\x8d\x8d\x95\xcf\x6b\x1d\x55\x14\xc7\x3f\xf7\xde\x99\ \x3b\xf3\x7e\x98\xa6\x79\x4d\x8a\x3e\x42\x63\x4c\x84\xb6\x21\xa5\ \x92\x55\x0b\xba\x68\x8c\xb8\x0b\xb4\x22\x2d\x6a\x31\x58\xc1\x8d\ \x74\xd9\x14\x04\x37\x21\x42\x71\x53\xf5\x1f\xa8\x88\x88\x5d\xb9\ \x10\x5c\x25\x8b\x4a\xba\x68\x5a\x5c\x34\xd0\x52\x5e\xc1\x1a\xac\ \xf0\x12\x5f\x26\xef\xe7\x9d\x1f\xd7\xc5\xfb\xe1\x7b\xc9\x0b\x7a\ \xe0\x30\xc3\xcc\xe1\x33\xdf\x7b\xe6\xfc\x10\xd6\x5a\xfe\x87\x09\ \x40\x02\x4e\xeb\x0a\x60\x81\x08\x88\x5b\xf7\x3d\xe6\x00\xbc\xf7\ \xc1\xa5\x25\x63\xcc\xf5\x83\xa8\x4a\x29\xd2\xe9\x34\x03\x03\x87\ \xf0\x3d\x0f\x80\x30\x0a\x71\x5d\x7d\x73\x79\xe9\x8b\x6b\x40\x7d\ \x2f\xdc\x01\x30\xc6\x5c\x7f\xe7\xfc\xbb\x14\x0a\x05\xaa\xd5\x2a\ \xb5\x5a\x8d\x5a\xad\x86\x31\x06\x63\x0c\x52\x4a\xa6\xa7\xa6\xb9\ \x72\xe5\x23\xa4\x6c\x0a\xae\xd7\x6b\x7c\xf5\xcd\xd7\x9f\x02\x4b\ \x80\x69\x29\xef\x05\x03\x78\x9e\x87\xd6\x9a\x30\x0c\x89\xa2\x88\ \x38\x8e\x49\x92\x04\x00\xad\x35\x43\x43\x43\x28\xa5\x50\x4a\x01\ \x90\x4e\x67\x18\x19\x1e\x06\x48\x03\xdb\x7d\x53\x01\xe0\xfb\x3e\ \x5a\x6b\xa2\x28\x22\x49\x12\xda\xb9\x37\xc6\xe0\x79\x1e\x99\x4c\ \x06\x21\x24\x42\x34\x15\x0b\x01\x5a\x7b\x3d\x8c\xbe\x60\xad\x35\ \xbe\xef\xf7\x40\x85\x10\x48\x29\xd1\x5a\xe3\xb5\x72\xdb\x6d\xad\ \xb4\x88\x7e\x60\xd9\x1d\xe4\x38\x0e\x9e\xe7\xe1\xfb\x3e\xbe\xef\ \xe3\x79\x5e\xc7\xb5\xd6\x88\xbe\x08\xf8\x21\x9b\x7d\xe3\x7b\x21\ \x6e\xf5\x55\x2c\xa5\xec\xb8\x52\x0a\xc7\x71\x98\x98\x98\x20\x8e\ \x63\x8a\xc5\x22\xae\xeb\xf6\x85\xfe\x3c\x3d\x7d\xf1\xf0\xd4\xd4\ \xf5\xe0\xd1\x23\xf5\x9d\x10\x1f\xb7\x1e\x47\x1d\xc5\xed\x63\x77\ \xfb\xe6\xe6\x26\xbe\xef\x33\x39\x39\xd9\xf9\x69\x6d\xb3\x49\x82\ \x73\xeb\x5b\xb2\xf9\xfc\xe2\x6b\x57\xaf\x7a\x4a\xa9\x48\x2a\x55\ \x96\x8e\x53\x16\x50\xec\x49\xfc\x5e\xb0\xb5\x96\x42\xa1\xc0\xa9\ \x53\xa7\x30\xc6\x74\xe2\xc2\x20\xe0\xce\xfc\x3c\xe3\xc3\xc3\x8c\ \x9f\x3d\xeb\xdb\x52\x89\xd7\x6f\xdc\xf0\xdb\xef\x7f\x59\x58\xf0\ \x7b\xc0\x7b\x55\x67\x32\x19\x66\x66\x66\xb8\x7b\xf7\x2e\xc7\x8f\ \x1f\x07\xa0\xf2\xf4\x29\xab\x73\x73\x8c\xce\xcc\x30\x3c\x3a\xca\ \xee\xca\x0a\x58\x8b\x50\x0a\x9b\x24\x0c\xcc\xce\x22\xa4\x64\x9f\ \x62\x21\x44\xe7\x03\x27\x4e\x9c\xe0\xd9\xb3\x67\x94\x4a\x25\x52\ \xa9\x14\x00\xbf\x5e\xb8\xc0\x91\x91\x11\x06\x7d\x9f\xdd\xd5\x55\ \x6c\x14\x91\x54\x2a\x24\x95\x0a\x32\x95\x22\x75\xf2\x24\x08\xc1\ \x81\x8a\xf3\xf9\x3c\xd5\x6a\x95\x87\x0f\x1f\x92\xcd\x66\x71\x9c\ \x66\xe8\xe9\x9b\x37\xb9\x33\x3f\x8f\x63\x0c\x2f\x00\xf5\x8d\x0d\ \x6c\xab\x91\x00\x1a\x4f\x9e\x60\xe3\x78\x7f\x71\xb7\xc1\x5b\x5b\ \x5b\xec\xec\xec\x90\x4e\xa7\xd1\x5a\x03\x90\x24\x09\x47\xce\x9c\ \xe1\xcd\xb5\x35\x56\xce\x9d\xe3\x70\x36\xc3\xd1\xd3\xa7\x91\x03\ \x03\xcd\x8e\x51\x8a\xb8\x5a\x05\xfa\x74\x4d\x1b\x1c\x86\x61\xa7\ \xc4\xa4\x94\x14\x0a\x05\xa4\x94\x8c\x8d\x8d\x91\x7b\x65\x9c\xd9\ \x7b\xf7\xf8\xe9\xec\x19\xea\x9b\x9b\xf5\x51\xc7\xf1\x7f\x5b\x5b\ \x33\xf6\xdf\xbe\xf8\x5b\x1e\x04\xee\xae\x67\xc7\x71\x28\x95\x4a\ \xec\x04\x3b\x54\x2a\x65\xe2\x38\x46\x0d\x1e\xa2\xb1\x78\x8d\x72\ \xad\xb6\xf2\x78\x63\xa3\x66\x21\xb9\x64\xad\xdb\xf2\x17\xf7\x81\ \xdb\x70\xa5\x14\x5a\x6b\x8a\xc5\x22\xeb\xf7\xd7\xd1\x9e\x26\xff\ \x52\x9e\x5c\x2e\x47\x14\x45\x18\x63\xa8\x9a\x06\xe7\xb7\xb7\x3f\ \xa9\x95\xcb\x5f\x0a\x78\xdc\xcd\xe8\x3b\x40\xb4\xd6\x04\x41\xc0\ \xfa\xfa\x3d\x5e\x1e\x1f\xe3\xf2\xe5\xf7\x39\x76\x6c\xac\x39\xfd\ \xa2\x90\x30\x0a\x89\xe3\x98\x60\x77\x17\xa0\x71\x31\x8a\x3e\x07\ \x3e\xeb\x0b\xb6\xd6\xa2\x94\xc2\x5a\xcb\x83\x07\xf7\x39\x34\x38\ \xc0\x87\x0b\x97\xc9\xe5\x72\xb8\xae\x4b\x1c\x87\xd4\xea\x11\x02\ \xb0\x16\x92\x24\x26\x08\x02\x80\x06\x07\x6d\x90\x38\x8e\x91\x52\ \xf2\xfc\xaf\xe7\x08\x2c\x6f\xbd\x3d\x47\x2a\xe5\xe3\xba\x6e\x73\ \xd8\x87\x61\xcf\x08\xb3\x34\x5b\xfa\x3f\xc1\xc1\x4e\xc0\x1f\x7f\ \xfe\xce\xc4\xab\xcd\xe3\x22\x2c\x8d\x46\x9d\x86\x69\x34\x81\x1d\ \xaa\xe8\x30\x92\xc4\x52\xa9\x94\xa1\xb9\x3d\xfa\x83\x47\x8e\x8e\ \x2c\xdf\xfe\xf1\xf6\x62\x77\xe7\x89\x83\x66\x64\x57\xea\xb4\xd6\ \xcb\xec\x59\x49\x6d\xfb\x07\xe7\xa5\x7a\x91\x9a\x1b\x94\x49\x00\ \x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ \x00\x00\x02\xb4\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x16\x00\x00\x00\x16\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\ \x00\x00\x00\x06\x62\x4b\x47\x44\x00\xfc\x00\xe9\x00\x4f\x34\xd7\ \xb1\x0d\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\ \x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\ \xd5\x02\x12\x0e\x25\x30\xca\x43\x26\x09\x00\x00\x02\x41\x49\x44\ \x41\x54\x38\xcb\xad\x95\xcd\x6b\x13\x61\x10\x87\x9f\x99\xdd\x54\ \x9a\xe2\x07\x4d\x9b\x35\x08\x9e\x3c\x88\x78\x12\xc4\x56\xf0\x1f\ \xf0\xd2\x83\x27\x6f\xe2\xd5\xb3\x08\x62\x2f\xa2\xe2\xc7\x3f\xe1\ \xc1\x8b\x78\x90\xdc\x45\x11\x04\x35\xa5\x17\x0b\x7a\xb2\xb9\xd4\ \x90\x18\x28\x22\x31\xa6\xd9\x64\xc7\xc3\x7e\x66\x53\xed\x6a\x7d\ \x21\x64\x77\xd8\xf7\x79\x67\x7e\xbf\x99\x5d\x61\x9f\x6b\xd4\x59\ \x11\xa0\x04\xf8\xae\x57\xb7\x38\x2e\xf1\xc5\xfd\x87\x77\x6f\x03\ \xab\x7f\x03\x55\x09\xa8\x1c\x19\x50\x5b\xec\xe1\xa8\xb1\x33\xd4\ \xc7\x17\x2f\x34\xaf\xb9\x5e\xbd\xef\x66\x9e\x5b\xbd\x71\xfd\x66\ \x61\xa8\x99\x0f\xfe\x47\x82\xfe\x4b\x7c\xab\x60\x94\xd9\xfe\xfa\ \xe9\x8a\xe1\xbc\x1a\x75\x56\x9e\xba\xf9\x0d\xcd\x66\x13\xc7\x71\ \x30\x33\x44\x04\x91\xb0\xa8\xec\x35\x18\x25\x69\x51\xd6\x17\x38\ \xa5\x59\x6c\xe6\x12\xe2\xcc\x73\x68\xe1\x35\x16\x3c\xbb\x2c\xf6\ \x6d\x5d\xf3\xe0\x18\x10\x43\xcc\x0c\xcc\x30\x33\x2c\x30\xcc\x00\ \xc6\xa8\xf4\x10\xd9\xc1\x64\x01\x74\x1e\x50\xe0\x00\x30\x2e\x03\ \x87\xf7\x04\x23\x40\x1c\x53\x41\x15\x44\x1c\x02\x39\x48\xc0\x22\ \x32\xda\x04\xff\x0d\x04\x1d\x86\x83\x06\x62\x3f\x36\x80\xed\xdf\ \x82\x55\x35\xfc\x17\x41\x44\xd3\xc3\x44\x51\x71\x08\x38\xca\x80\ \x65\x86\x76\x02\x86\x6b\xb8\xfe\x73\x36\x3f\x6f\x21\x04\x4f\x80\ \x96\xbb\x1b\x58\x55\x53\x8d\x11\x90\xac\xc6\x02\x2a\x08\x33\x98\ \x1c\xc3\xa7\xc2\x98\x53\xcc\xce\x95\x68\x6c\x7c\xe7\xcc\xc9\xd6\ \x07\xe0\xe7\x54\xc6\x6b\xeb\x8d\x49\xb3\x32\xd9\x27\x3f\xe2\x2a\ \x1c\x4c\xe7\x30\xe7\x38\x32\x73\x9a\x5e\xbf\x84\xeb\xd5\xfb\xae\ \x57\xb7\x29\xf0\xb9\xb3\x4b\xd4\x6a\xb5\x9c\xa6\xa4\x72\xa8\x44\ \xf7\x51\x75\xa2\x61\x55\x93\x63\xc1\xae\x52\xb4\xdb\xed\x70\x93\ \x69\x28\x43\x52\x3e\x49\x15\x91\xa7\x44\x0f\x4c\x2d\xf7\x4f\x5d\ \x61\x62\x49\x76\xf9\x5e\x4e\x0e\x10\x41\x29\x00\x4e\x36\x01\x1a\ \x99\x15\x6a\x0a\xa2\xd1\x7d\x1c\x8f\x92\x0d\xe3\xb9\x71\xcf\x07\ \xde\xbd\x7f\x3b\x95\x91\x48\x28\x45\x0c\xcd\x6a\x2c\xb1\x09\x7b\ \x81\x97\x97\xce\x53\xad\x56\xd3\x1e\xd6\xc8\x44\x34\x32\x4e\x10\ \x14\xd5\x6c\x97\x68\x31\x8d\xbb\xdd\xee\x44\xbb\x31\xf1\x9e\x90\ \xe4\x80\x6c\x65\x85\x34\x4e\x4f\xd1\x8c\x79\x11\x90\x78\xc4\x49\ \xf4\x2f\x0c\x4e\xb2\xd1\xd4\xb8\x88\x17\x5b\x99\x4e\xa3\x49\xa6\ \x8f\x0b\x66\x9c\xb8\x1e\x8f\x36\x93\xc6\x85\x55\x50\x2c\x63\xcf\ \xf3\xf8\x1f\x2b\x01\x07\x41\x70\xe7\xc1\xa3\x7b\xb7\xf6\x03\xfb\ \xb2\xd5\xba\x3a\xf5\xcd\xcb\xab\xf0\x8f\xec\xe4\x63\xfa\x0b\x23\ \xfb\x93\xa3\x4d\x98\xb6\xe0\x00\x00\x00\x00\x49\x45\x4e\x44\xae\ \x42\x60\x82\ \x00\x00\x04\x7e\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x16\x00\x00\x00\x16\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\ \x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\ \xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\ \x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\ \xd5\x0b\x0a\x0d\x34\x15\x48\x65\x72\x06\x00\x00\x04\x0b\x49\x44\ \x41\x54\x38\xcb\xad\x95\x5d\x6c\x14\x55\x14\xc7\x7f\x33\xfb\x39\ \x9d\x6d\xbb\xd3\x65\x97\xdd\xd6\x65\x59\x3e\x96\x22\x05\xda\x92\ \x56\x8b\x1f\x58\x13\x1f\x30\x42\x34\x46\x7c\xd0\x17\xd3\xf8\x00\ \x35\x48\x55\x52\x03\xfa\x20\x46\x02\x18\x8b\x69\x6c\x1f\x44\x1f\ \x34\x8a\x92\xc8\x8b\x0f\x68\x0c\x31\x36\xc6\x88\x34\x41\x54\xac\ \x25\xb4\xb5\x36\xc5\xd6\xdd\xb6\xd3\x76\xbf\x67\x67\x77\x7c\x68\ \x77\x6c\xa9\x50\x4c\xfc\x27\x37\xe7\xe6\x9e\x73\xfe\xf7\x7f\xcf\ \x3d\x33\x57\x60\x01\x9e\x7b\xa3\xfd\xfd\x3f\x12\x95\x8f\xc6\xa6\ \xb4\x8a\x85\xeb\x92\xcd\x48\xfa\x5c\xf1\xbe\x95\xf2\x6f\x6d\x9d\ \xaf\x7e\xf6\x1d\xb7\x01\xa1\x38\xe9\xfa\xa0\xad\xf6\xec\x8f\xe1\ \x8b\xab\x23\x1b\xb3\xa1\x95\x3e\x31\x9e\x13\x9d\x55\x65\x4e\xf1\ \xcf\xb8\xc6\x54\x3a\xcb\xf4\xd5\xf3\x43\xa9\x64\xc6\x11\x56\xfa\ \xdb\xbb\x5f\x3b\xfd\xf1\x72\xc4\x96\x22\xe9\xf9\xfe\xc0\xd9\x55\ \x5b\x1e\x70\x0f\x0f\xf4\xdb\x07\x87\x87\x6d\x23\xbf\x0f\x8a\x23\ \x13\x93\xd8\x4a\x2b\x50\x9c\x76\x9c\xde\x75\xca\x74\xba\x50\x76\ \x3d\xe6\xdc\xb9\xeb\x11\xcf\xa5\x8b\xdf\xfc\x3a\x70\x2b\x62\x11\ \xe0\x87\x6b\xce\xe3\x77\xac\xb0\x0e\x27\x06\xbe\xba\xda\xe8\xbd\ \xf0\x74\x4f\xc7\x3e\xf1\xbe\x50\xef\xce\xdc\xcc\xf5\xd9\xd1\xc1\ \x2b\x46\x74\x36\x4e\x3c\x99\x40\xf1\x05\x90\x7d\x41\xc7\x2f\xb1\ \xad\x9f\xbe\xf4\xfa\x2e\x79\x59\x62\x35\x25\xad\xb3\xe4\x13\x33\ \xf7\xaf\x1f\x7d\xe8\xe8\x8b\xef\x7d\x02\x70\xec\xe0\x47\x5f\x36\ \x04\x47\x8f\x24\x54\x55\x48\xce\x4e\xa1\x65\x52\x00\xf8\x82\xeb\ \x45\xaf\xac\x8d\x4c\x68\xe1\xee\x65\x6b\xfc\xd4\xa1\x17\x3e\x0f\ \x3b\x72\x3f\xcf\xaa\x85\xc3\x0b\x9d\x0e\x49\xe0\xdb\xa9\x10\xab\ \x37\xd5\x2f\x4a\x72\xa7\xfb\x98\xf8\x6b\x9c\xca\xc2\xf4\x8d\x7c\ \xed\x9d\x6f\x77\x9d\x00\xb0\x02\x04\xcb\xe2\x5f\xa4\x26\xed\xdd\ \xc7\x8e\xbe\xb9\x64\xe7\x07\xdb\xba\x96\xac\x65\x3c\x77\x31\x3a\ \xd4\xc3\x87\x27\x17\xe9\xe0\xe5\x43\x07\x8f\x03\x27\xcc\x52\xa4\ \xc6\xed\xd7\x14\xb7\x97\x54\x6a\xee\xb8\xc9\x64\xd2\x1c\x26\x59\ \xfa\x9f\xb9\xc5\x66\x5f\x14\x37\x32\x3a\x42\x32\x99\xc4\xeb\xf5\ \xb2\xff\x40\x6b\xad\xa9\x18\x58\xeb\xf7\x07\x00\x48\x24\x13\xb8\ \x64\xd7\xbf\x2a\x2d\xc2\x28\x14\x00\x78\xec\xc8\x69\x74\x4d\xe3\ \xcc\xe1\x3d\x00\x28\x8a\x42\x2c\x16\x8b\x00\x97\xc5\xf9\xd8\xdd\ \x75\x5b\xeb\x49\xa7\xd3\x08\x08\xa6\xd2\xea\x86\x1d\x54\x37\xec\ \xa0\x5c\xf1\x02\x90\xcd\x66\xe6\x6c\x3a\xce\xba\xda\xbb\x59\x53\ \xd3\x00\x40\x89\x54\x02\xc0\x3d\x4d\xf7\x02\x6c\x36\x4b\x01\x3c\ \x5c\x59\x59\xb5\x48\xd5\xbb\xcf\x37\x33\xf0\xd3\xf7\x00\x8c\x8d\ \x0e\x81\x61\x90\xd7\x73\x64\xd2\x49\xe2\x33\x2a\x00\x43\x57\x7a\ \x79\x67\xdf\x76\x33\x27\x18\x0c\x01\xbc\x02\x20\xee\x3f\xd0\x5a\ \x2b\x49\x25\xd8\xed\x76\x3c\x1e\x8f\x19\x14\xf0\x86\xe8\x68\xd9\ \x46\x7f\x6f\x0f\x15\xde\x4a\x0a\x86\x31\x5f\x07\x83\x32\xb7\x87\ \x81\xcb\x17\xe8\x68\xd9\x46\xa8\x32\x02\x80\x2c\xcb\xf3\xe5\xf0\ \xb0\xff\x40\x6b\xad\x08\x44\x56\xfa\xfc\x00\xa8\xaa\x8a\x2c\xcb\ \xc8\xb2\x8c\x28\x8a\x84\xab\x36\xd0\xb9\xb7\xc9\x24\x17\x05\x01\ \x57\x79\x05\x03\x97\x2f\xd0\xb9\xb7\x89\x70\xd5\x06\x33\x5e\x55\ \xe7\x4e\x51\x5e\x56\x0e\x10\x11\x81\xcd\x77\x6e\xdc\x44\x2e\x97\ \x33\xac\x56\x0b\x33\x33\x33\xa8\xaa\x8a\x24\x49\xc8\xb2\x4c\x4d\ \xa4\x9e\x53\x6d\xcd\xf4\xf7\xf6\xe0\x5e\x11\x60\xb8\xef\x12\xa7\ \xda\x9a\xa9\x89\xd4\x9b\x84\xaa\xaa\x92\xcf\xeb\x24\x12\x09\x63\ \xed\x9a\xb5\x00\x4d\x62\x36\x9b\xdd\xe2\xf7\xfb\x71\xb9\x5c\x82\ \xae\xe7\x29\xcc\xdf\x78\x31\x41\x55\x55\x2a\x4a\x03\x74\x3c\xdb\ \x40\x7f\x6f\x0f\x6f\x3d\x53\x4f\x45\x69\xc0\xf4\x01\xe4\xf3\x3a\ \x08\xa0\x28\x8a\x10\x0c\xae\x22\x93\xc9\x96\x5a\x1d\x0e\xc7\xee\ \x48\x24\x62\xb6\xcb\xcd\xa0\x28\x8d\x7c\x7d\xb2\x71\xd9\xdf\x65\ \x75\x75\x35\x4e\xa7\xa3\xc5\x0a\x10\x8b\xc5\x98\x9c\x9c\xbc\x79\ \xdf\x16\x2f\xee\x36\x7c\x5e\xef\x5c\x6b\x16\x3f\x10\x34\x4d\xc3\ \xe3\xf1\x70\xee\xdc\x39\x1c\x0e\x07\xb2\xab\x84\x52\x57\x19\xa2\ \x28\x22\x49\x12\x82\x20\x20\x49\x12\x2e\x97\x0b\x55\x55\xf1\xf9\ \x7c\x44\xa3\xd1\x25\xb6\x48\x2c\x2e\xdc\x4d\xd7\x75\x2c\x16\x0b\ \x86\x61\x20\x0a\x16\xb2\xd9\x2c\x9a\xa6\x61\x18\x06\x36\x9b\xed\ \x96\xca\x6f\x84\xa9\x58\x10\x04\xd2\xe9\x34\x75\x75\xb5\xe8\x7a\ \x1e\x8b\xc5\x82\xae\xeb\x66\xa0\xdd\x6e\xe7\xbf\xc0\x0a\x10\x8d\ \x46\x0d\xbf\xdf\x3f\xff\x4c\x79\x96\x4d\x72\xbb\xdd\x00\x84\xc3\ \xe1\x25\x76\x6c\x6c\xcc\x00\x04\xe1\x89\x27\x1f\xdf\x13\x08\xf8\ \xcf\xf0\x3f\x62\x6c\x6c\x7c\xfb\xdf\xe7\x60\x9f\x53\x70\x22\xd1\ \x6a\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ \x00\x00\x04\xd5\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x16\x00\x00\x00\x16\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\ \x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\ \x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\ \x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\ \x67\x9b\xee\x3c\x1a\x00\x00\x04\x67\x49\x44\x41\x54\x38\x8d\xa5\ \x93\x7d\x68\xd5\x55\x1c\xc6\x3f\xe7\xf7\x7a\xef\xfd\xdd\xdd\x3b\ \xb7\xb6\xb9\x79\xa7\x6d\xbe\xcd\x19\xe9\x72\x58\x62\x43\x7b\x93\ \x62\x25\x46\x82\x34\xc8\x7f\xf2\x6a\x50\xa9\x11\x44\x21\xcd\x5c\ \x85\x95\x98\x53\x4a\x21\x15\x35\x19\x51\x52\x19\x68\x8a\x60\x66\ \x8a\xba\x4d\xa7\xd3\xcd\x97\x4d\x45\xd7\x72\x2f\x6d\x73\x6f\xf7\ \xde\xdd\x97\xdf\xef\xf4\x47\x57\xc9\x5a\xa0\xf8\x85\x87\x73\xe0\ \x70\x3e\xe7\xe1\xe1\x39\x62\xdd\xcb\x8a\x1f\x58\xa4\x08\xb1\x5c\ \x0a\x91\x2a\xa4\xb3\x61\x69\x95\xbd\x82\xfb\x1c\x45\x08\xde\xcd\ \x19\x53\xf8\xf1\xac\xb9\xc1\xc0\x93\xa5\xaf\x78\x3d\xbe\x11\xcb\ \x2a\xcb\xd4\x05\xf7\x0d\x56\x55\x3d\x58\x58\x3c\xdb\x0c\x5f\x3b\ \x48\xbc\xf7\x0a\x53\x1f\x9d\x63\x29\x82\x75\x95\x65\xaa\x7e\x5f\ \x60\xc7\x8e\xc7\x9c\x44\x02\x45\x35\x18\x6c\x3b\x8b\x65\x79\xc8\ \x1a\x35\xd6\x0f\x2c\xd9\xba\x52\xbc\xb0\xe3\x23\xf3\xd8\x57\x4b\ \xc4\x3d\x3f\xa2\x00\xdb\xcf\xd5\x1c\x88\xf8\xf2\x67\x63\x65\x4d\ \xa6\xbf\xa5\x86\x82\xa2\x12\x8f\x99\xc6\x1a\xc3\x95\xf2\xad\x94\ \x4c\x13\x39\xe4\xdd\xbb\x63\xc9\x8a\xee\xf6\x6b\x95\x47\xf6\x7f\ \x33\xa4\x8d\x98\x80\x99\xf6\x20\x2d\x9d\x47\x48\x1b\x9b\xee\x9a\ \xb7\x70\xb9\x3b\x3b\x77\x5c\x54\x24\x78\xf8\x5e\xc1\x42\x4a\x09\ \x40\x65\x99\x3a\x5f\xd3\xb5\xaf\xd3\x27\x7a\xdd\xbe\x0c\x8b\x19\ \x4f\x3d\x87\xcb\xf0\x72\xe6\xad\x3d\xf4\xfc\xd4\x6c\x0b\x5b\x6c\ \x2a\xb5\xed\x37\xef\xda\xf1\xad\x8d\x7f\xa2\x53\xe7\xce\x8b\xf5\ \x3d\x10\x30\x65\xd1\x8c\xc9\x44\x7e\x3f\x45\xcd\xb3\xdb\xe0\x70\ \x27\x85\x23\x03\xaa\xad\xc8\xd7\x36\x97\x8b\x85\x9b\xcb\xef\x2e\ \x6f\x05\x60\x6b\xb9\x98\x29\xa1\xae\x70\xea\xb8\x8c\x49\x53\x0b\ \x44\x6f\x6d\x13\x0d\xf3\xce\x92\xd6\xad\x13\xb0\x52\xb9\xf8\xe7\ \x0d\x52\x17\x17\x68\x39\xb9\xb9\x1b\x55\x4d\x5c\xdf\x5c\x2e\xe6\ \xdf\x55\x14\xdb\x56\x89\xbd\x52\xe8\x73\x52\xd3\xfc\x61\x4f\x63\ \xcc\xe3\xec\x08\x69\x05\x19\xa3\x18\x8a\xc7\xb8\xda\xd7\xc5\x98\ \x4f\xc6\x93\xf5\x4c\x00\x77\x4a\x31\x7d\x3d\xed\xd4\xfe\xb6\x3f\ \xdc\xd7\xd3\xd1\x18\x8f\x3b\x65\xc1\x0a\x79\xf9\x7f\xc1\x00\x5b\ \x56\x89\x00\x0e\x93\x46\x7e\xa6\x7c\x37\x21\x6d\x64\x6a\x77\x34\ \x44\xb7\x16\x25\x6f\xbd\xc4\x33\x5a\xc5\x34\x3d\xe8\x86\x85\xcb\ \xfb\x08\x9a\xa7\x88\x3f\xae\x5d\x90\xc7\x0f\xee\x09\xc7\xa2\x83\ \xab\x1d\x47\x7e\x1a\xac\x90\x89\x61\xc1\xb7\x66\xaf\xaa\xbe\x6f\ \xab\xf2\x83\x94\x59\xf9\x22\xe7\x9d\xeb\x42\x71\x49\x34\xcd\xc4\ \x34\x3d\x18\xa6\x07\x4d\x33\xd1\x35\x2f\xba\x35\x8d\xb8\xcc\xe7\ \x74\xf5\x2f\x91\x2b\x0d\x47\x7a\x63\xb1\xe8\x2a\x60\x7b\xb0\x42\ \x46\x87\x05\x03\x6c\x59\x29\xa2\xa5\x65\xaf\x1b\xa1\xae\x9d\x48\ \x27\x84\xa6\x19\x98\xa6\x85\x61\x5a\xe8\x7a\x1a\xc8\x28\x6e\xb7\ \x07\x55\x4f\x05\xb3\x88\xfe\x01\x8b\xfa\xea\x7d\xe1\xab\x17\x6a\ \xe3\x52\x3a\x6b\x1d\x87\x35\xca\x7f\xa8\x80\xa2\xd2\x1a\x1e\xec\ \x46\x35\x32\x01\x90\x52\x22\xf9\xdb\x80\xa2\x0c\xa1\x99\x01\x22\ \xa1\x28\xd2\x8e\x21\xa2\x27\xf1\xbb\xea\x79\xfc\xe9\x52\xcf\xf3\ \x65\xcb\xfc\x52\x28\x2b\x6e\xb7\xe2\xdf\x23\x1d\x76\x77\xb5\xb5\ \x38\x86\x6b\x3c\x20\x49\xc4\x13\x48\xdb\x01\x4c\xec\x84\x8d\xae\ \x86\xd0\x3d\x13\xe9\xed\xe9\xc7\x91\x06\x20\x51\x54\x2f\x97\x1b\ \xab\xa3\x9a\x42\x55\xb0\x42\x0e\x0d\x0b\x76\x1c\xbe\x6f\x3e\x7f\ \x26\xac\xbb\x27\x20\x84\x0b\x29\x1d\x62\xb1\x04\x52\x4a\x6c\x27\ \x85\x48\xa8\x17\x97\x5b\xc1\xe5\x2b\xa4\xb3\xad\x0f\x5b\x2f\xe1\ \x62\xfd\xf1\x44\xd3\xb9\xea\x96\x78\xdc\x79\x63\x58\xc7\x42\x08\ \x65\xf1\x87\xd4\x47\x42\xe1\x4b\x1d\xad\x4d\xd2\xf0\x4e\x41\x51\ \x21\x11\xb7\x89\x86\x7b\xd1\x5d\xe9\x0c\x45\x24\xe1\xde\x2b\x78\ \xfc\xf9\xb8\xfc\x25\xd4\x1e\xda\x19\x3f\xf1\xeb\x8f\x97\x7a\x7a\ \xed\x92\x60\x85\x8c\xdc\x01\x16\x42\x28\x42\x08\x1f\x90\x05\x64\ \x1f\x3e\xc9\xda\xb3\xb5\xd5\x51\xd3\x2a\x46\xd5\x33\x31\x3c\x99\ \x84\x07\x87\x88\x85\xaf\x92\x92\x31\x9d\xee\x6e\x95\x81\x7e\xc9\ \xf1\xc3\x7b\xa2\xa7\xeb\x1a\x4f\xac\xdc\x98\x58\xf0\xf6\xe7\x28\ \x42\x08\x9f\x10\x42\x28\x49\xa8\x00\xac\xa4\x52\x00\x5f\xd5\xcf\ \xdc\x68\xef\xe8\x69\xb8\x50\x77\x20\x61\xa5\xcf\xc5\x71\xe2\xb8\ \x7d\x63\xe9\xbb\x09\xaa\x91\x87\x61\x8d\x63\xff\xae\xf5\xb1\x93\ \xa7\x9a\xf6\x2d\x5d\x1d\x2f\x6f\xed\xc0\x4c\xde\xb5\x00\xeb\x76\ \xdd\x84\x10\xde\xe4\x81\x37\xa9\x94\x40\x16\x59\xef\xbd\xca\x17\ \x8f\xcd\x7a\x22\x23\x3b\x37\x53\x18\xae\x6c\xfa\xda\x1b\x69\xbd\ \xde\x6c\x5f\x3c\xdf\x12\xde\x77\xd4\xd9\xb0\xfb\x10\xc7\x80\x41\ \x60\x20\xb9\x0e\x02\x5d\x77\xf4\x58\x08\xe1\x02\xfc\x80\x27\x29\ \x77\x71\x21\xa3\x83\x2f\x89\x6d\x33\xe7\xcc\x4b\x89\x45\xda\x38\ \x53\x5d\x1b\xeb\xec\x72\x8e\xae\xaf\x92\x1b\xda\xba\xb8\x09\x44\ \x92\x0a\x03\x37\x81\x01\x29\xa5\x3d\xec\x07\x49\x46\x64\x00\x2e\ \xc0\x58\xf4\x22\x53\xa6\x3f\xc4\x0f\x71\x9b\x53\x0d\xcd\x7c\xb9\ \x69\x17\x35\x40\x1c\x88\x01\x43\x40\x14\x48\xc8\x7f\xc0\xfe\x02\ \xac\xc3\xe6\x28\xcc\x5c\x0b\x9f\x00\x00\x00\x00\x49\x45\x4e\x44\ \xae\x42\x60\x82\ \x00\x00\x04\x49\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x16\x00\x00\x00\x16\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\ \x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\ \xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\ \x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\ \xd5\x0b\x0a\x0d\x39\x23\x32\x71\x99\xd2\x00\x00\x03\xd6\x49\x44\ \x41\x54\x38\xcb\xad\x94\x5f\x4c\x5b\x55\x1c\xc7\x3f\xf7\x52\xfa\ \x87\x0b\x94\xdb\xae\xa5\x2d\x56\x56\x60\x1d\x73\x6c\x43\x96\x4e\ \x99\x7f\x26\x26\x3e\xcc\xb8\x45\x63\x9c\x0f\x1a\x63\xc2\xd3\xc6\ \x02\xd4\x6d\x62\x36\x7d\x70\xea\x1c\xd3\x30\x25\x42\x8c\xe8\x83\ \x46\xa7\x4b\xdc\x8b\x2f\x1a\xb3\x07\x89\x31\xe2\x48\x26\xea\x44\ \xb6\x41\xc5\xa6\x13\xa4\x8c\x0b\xf4\x7f\x0b\xbd\x3e\xb4\x54\xea\ \xdc\xc0\x84\x6f\x72\x73\xce\x3d\xe7\xfb\xfb\x9e\xef\xf9\xde\x73\ \xae\xc0\x32\x1c\x7c\xad\xe3\x83\x3f\xc2\x8e\x47\x83\x33\x49\xd3\ \xf2\x71\x43\xa1\x1a\xb1\x16\x87\x86\xcb\xa5\xdf\xbc\xdd\x2f\x7d\ \xfe\x1d\xab\x80\xb0\xd4\xe9\xf9\xd0\x5b\x7f\xee\x47\xd7\x85\xf5\ \xee\x4d\x89\xca\x72\xab\x18\x4a\x89\xfa\x8a\x52\xbd\xf8\x67\x28\ \xc9\x4c\x2c\xc1\xec\xe5\xf3\xbe\x68\x24\xae\x73\xc9\x23\x1d\xbd\ \x2f\x9f\xf9\x64\x25\xe1\x82\x25\xd1\xf3\x23\xf6\x73\xb7\x6f\x7d\ \xa0\x6c\x7c\x74\x44\x3b\x36\x3e\x5e\xe8\xff\x7d\x4c\xf4\x4f\x5f\ \xa7\xb0\xc4\x84\xac\xd7\xa2\xb7\xd4\xc8\xb3\xb1\x74\xe9\xb5\xa0\ \x7e\xf7\x9e\x47\xcc\x17\x2f\x7c\xf3\xeb\xe8\xad\x84\x45\x80\x1f\ \xae\xea\x3b\x6f\x5b\xa7\x19\x0f\x8f\x7e\x7d\x79\x87\x65\xe0\xe9\ \xfe\xae\x03\xe2\x7d\x95\x83\xbb\x53\x73\xd7\xe6\x03\x63\x97\xd4\ \xa9\xf9\x10\xa1\x48\x18\xd9\x6a\x47\xb2\x3a\x75\xbf\x04\xb7\x7d\ \x76\xf8\x95\x3d\xd2\x8a\xc2\x4a\xd4\x50\x53\xb0\x18\x9e\xbb\x7f\ \x43\xe0\xa1\x13\x87\xde\xff\x14\xe0\xe4\x91\x8f\xbf\xf2\x38\x03\ \xc7\xc3\x8a\x22\x44\xe6\x67\x48\xc6\xa3\x00\x58\x9d\x1b\x44\x8b\ \x94\xf4\x4f\x27\x5d\xbd\x2b\x66\xfc\xd4\xd1\xe7\xbe\x70\xe9\x52\ \x3f\xcf\x2b\xe9\x63\xcb\x27\x75\x06\x81\x6f\x67\x2a\x59\xbf\xb9\ \x21\xaf\xa8\x2c\x36\xcc\xf4\x5f\x93\x38\xd2\xb3\xff\xd6\xeb\xe8\ \x7e\xab\xe7\x14\x80\x06\xc0\x59\x1a\xfa\x32\x7a\x5d\xdb\x7b\xf2\ \xc4\x1b\x37\xac\xfc\xa0\xb7\xe7\x86\xb1\xb8\xf9\x2e\x02\xbe\x7e\ \x3e\x3a\x9d\xe7\x83\x17\x8e\x1e\xe9\x04\x4e\xe5\xa2\x88\x4e\x6a\ \xaf\xca\x65\x16\xa2\xd1\xcc\x76\x23\x91\x48\xee\xc9\x89\xc5\xfe\ \xe9\x17\x14\x6a\xf3\x78\xfe\x80\x9f\x48\x24\x82\xc5\x62\xa1\xb5\ \xbd\xa5\x3e\xe7\x18\xa8\xb6\xd9\xec\x00\x84\x23\x61\x8a\xa5\xe2\ \xff\x74\xba\x04\x35\x9d\x06\xe0\xb1\xe3\x67\x58\x48\x26\x39\x7b\ \x6c\x1f\x00\xb2\x2c\x13\x0c\x06\xdd\xc0\x90\x98\xe5\xee\xbd\x73\ \x5b\x03\xb1\x58\x0c\x01\x21\xe7\xb4\xd6\xb3\x8b\x5a\xcf\x2e\x8c\ \xb2\x05\x80\x44\x22\x9e\x69\x63\x21\x6a\xea\xef\xa6\xaa\xce\x03\ \x40\x91\xa1\x08\x80\x7b\x1a\xef\x05\xd8\x92\x8b\x02\x78\xd8\xe1\ \xa8\xc8\x73\xf5\x5e\x5b\x13\xa3\x3f\x7d\x0f\xc0\x44\xc0\x07\xaa\ \xca\xe2\x42\x8a\x78\x2c\x42\x68\x4e\x01\xc0\x77\x69\x90\x77\x0e\ \xec\xcc\xd5\x38\x9d\x95\x00\x2f\x02\x88\xad\xed\x2d\xf5\x06\x43\ \x11\x5a\xad\x16\xb3\xd9\x9c\x23\xd9\x2d\x95\x74\x35\x6f\x67\x64\ \xb0\x1f\x93\xc5\x41\x5a\x55\xb3\x39\xa8\x94\x96\x99\x19\x1d\x1a\ \xa0\xab\x79\x3b\x95\x0e\x37\x00\x92\x24\x65\xe3\x30\xd3\xda\xde\ \x52\x2f\x02\xee\x72\xab\x0d\x00\x45\x51\x90\x24\x09\x49\x92\x10\ \x45\x11\x57\xc5\x46\xba\xf7\x37\xe6\xc4\x45\x41\xa0\xd8\x68\x62\ \x74\x68\x80\xee\xfd\x8d\xb8\x2a\x36\xe6\xf8\x8a\x92\xd9\x85\xb1\ \xd4\x08\xe0\x16\x81\x2d\x77\x6c\xda\x4c\x2a\x95\x52\x35\x9a\x02\ \xe6\xe6\xe6\x50\x14\x05\x83\xc1\x80\x24\x49\xd4\xb9\x1b\xe8\xf3\ \x36\x31\x32\xd8\x4f\xd9\x3a\x3b\xe3\xc3\x17\xe9\xf3\x36\x51\xe7\ \x6e\xc8\x09\x2a\x8a\xc2\xe2\xe2\x02\xe1\x70\x58\xad\xae\xaa\x06\ \x68\xd4\x24\x12\x89\xad\x36\x9b\x8d\xd7\x3b\x5f\x15\x6e\x75\x93\ \x3c\x25\x49\x06\x07\x61\x47\xc9\x15\xfa\xde\xbd\x72\xd3\x0b\xf7\ \xec\x33\xcd\xc4\xe3\x89\x12\x8d\x4e\xa7\xdb\xeb\x76\x67\x72\x6a\ \x6f\x3b\x8c\xa0\xaa\xa8\x08\x80\x0a\x82\x00\xaa\xba\xd4\x64\x4b\ \x85\x2c\x07\xaa\xaa\xaa\xf0\xf9\x7c\x08\x42\xe6\x12\x9f\x7e\xfb\ \x4d\x6a\x6b\x6b\xd1\xeb\x75\xcd\x1a\x80\x60\x30\x98\x3d\x36\x06\ \xfc\x7e\xff\x6a\x7e\xb7\xd4\xd4\xd4\x00\x60\x32\xc9\xd9\xc3\x95\ \x59\x79\x49\x4b\x5c\x4e\x36\xc9\x26\x56\x0b\x59\x96\x33\x1f\xcb\ \x58\x86\xd1\x58\x8a\xd1\x68\xcc\x9b\xd7\x2c\x7f\x29\xd4\x16\xe2\ \xf1\x78\x58\x0b\xe4\x09\xb7\x79\x0f\xfe\xaf\xe2\xd6\xf6\x96\x9b\ \xd6\x68\x00\xa6\xa6\xa6\xd4\x43\xde\xe7\x85\xb5\x70\x3a\x31\x31\ \xa1\x02\x82\xf0\xc4\x93\x8f\xef\xb3\xdb\x6d\x67\x59\x43\x4c\x4c\ \x4c\xee\xfc\x1b\x0f\xd8\x70\x1b\x27\x6e\xb0\x4a\x00\x00\x00\x00\ \x49\x45\x4e\x44\xae\x42\x60\x82\ \x00\x00\x05\xd0\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x16\x00\x00\x00\x16\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\ \x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\ \xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\ \x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\ \xd6\x01\x05\x0d\x1e\x16\x2a\x40\x95\xcd\x00\x00\x05\x5d\x49\x44\ \x41\x54\x38\xcb\x8d\x95\x5d\x6c\x54\xc7\x15\xc7\x7f\x33\xf7\xde\ \xfd\x5e\x7b\xd7\x4b\xfc\xb1\xc4\x26\x36\x35\xb8\x24\xc1\xc1\x5e\ \x27\x0d\x21\x98\xd0\xa4\x69\x95\x14\x35\x44\x4d\xa5\xc4\x4d\x8b\ \x88\xa5\x7e\xa8\xe9\x53\xfa\x56\x59\x4d\x9e\xe8\x53\x55\xa9\x6a\ \x25\x2b\xb4\x2e\x8b\xd2\x56\x6d\x20\xa1\x2f\xc5\x0a\x15\x6d\x6a\ \x0a\xac\x1d\x30\x06\x4c\x83\x03\x98\x85\xf5\xae\xd7\xbb\x5e\xef\ \xf7\xbd\xbb\xf7\xf6\x21\xbb\xc6\x4e\xab\xaa\xe7\x69\x74\x66\xce\ \xef\xfc\x75\xce\x9c\x19\xc1\xff\x61\x3b\x5f\xfe\x69\x5c\x77\x07\ \x9b\xd7\xb8\xe2\x91\xd1\xa1\xd6\xff\x15\xa3\x7e\xd6\x11\x1a\x0e\ \xf7\x03\x44\x46\x87\x26\xeb\x3e\xdd\x1d\x6c\x7e\xe9\xd1\x66\xf2\ \xc5\x12\x7a\x41\x67\x7c\xae\xd4\xf2\x99\xf3\x47\x81\x57\xd6\xc6\ \xc8\x75\xd0\xd7\x8e\x7c\x13\x3d\x7f\x6e\x53\xb3\xeb\x5c\x68\x38\ \x7c\x60\x7d\x4a\x93\x1b\xd1\x24\x46\x45\x5f\x05\x86\x86\xc3\x03\ \xc2\x28\xfc\xe5\x41\xbf\xd9\x0d\x9c\xac\x8b\x02\x10\xab\xd0\x83\ \x63\x03\x4d\x32\xfb\xe1\x1b\xaf\x0e\xda\xe6\xa3\x71\x7e\x79\x6a\ \x61\x15\xf9\xc5\x1d\xed\x6c\x09\x28\x9c\x3a\x7b\x8d\x87\xba\x36\ \xf0\xa7\x8b\xd9\x7b\x7b\x9d\x82\x4d\xf7\x05\x88\xa6\x8a\x9c\xbc\ \x9e\x5f\x89\x8c\x0e\x35\xae\x07\x1f\x38\x9c\xf9\xfa\xae\x76\x6f\ \x57\xd0\x2f\x02\x3e\x0f\xc2\x32\x51\xa5\xc5\xcd\xd8\x0a\xa9\xe5\ \x3c\x91\x99\x5b\x08\x21\xd0\x54\x85\xe6\x26\x2f\xb9\x95\x14\xfe\ \xc0\x06\x12\xc9\x2c\x5d\x6d\x4d\xb4\x78\xed\x1c\x9d\x4a\x1a\xa9\ \x42\xe5\xf1\xc8\xe8\xd0\xe4\xbd\x52\xa8\xb6\xef\xff\xf9\xf4\xd5\ \xf4\x06\x9f\x13\xb0\x58\xce\x96\x49\xa4\x4b\x4c\xcd\xdc\x66\x7a\ \xf6\x0e\x0e\x4d\xc3\xa1\x69\x68\x52\x21\x93\x29\x62\x09\x17\xe9\ \x74\x91\x56\x7f\x03\x7a\xc5\xe2\xed\x33\x0b\x66\x1d\xba\x4e\xf1\ \xa7\x35\xfe\x6d\x28\xe0\x30\xcf\x8d\x1c\xd8\x25\x92\xe9\x3c\x4b\ \xe9\x1c\x97\x66\xef\xd0\x11\xf4\xd3\xd5\x71\x1f\x00\xa5\xb2\x41\ \x22\x99\xe5\xc6\xed\x24\x52\x08\x3a\x83\x01\x4e\x4c\xce\x5b\x8b\ \xba\x3a\x12\x19\x1d\x7a\xeb\xbf\x36\x4f\x29\x2e\x05\x37\xb5\x78\ \xb0\x4c\x0b\x55\x91\x78\xdd\x0e\x76\x0f\x74\xe3\x73\x49\xeb\x83\ \x0f\xa7\xaa\xff\x8c\xcc\x90\x4e\x2d\xe3\xb0\x69\x3c\xd6\xdb\x89\ \x43\xd3\x48\x65\x0a\x0c\x6e\x76\x0b\xaa\x95\x57\xd6\xb2\x44\x68\ \x38\xfc\x77\x60\x17\x40\x4f\x47\x13\x2f\x0f\x76\xa2\x58\x26\xd9\ \x5c\x89\x72\xb9\x42\x26\x93\x34\xc7\x4e\x47\xcf\x54\x35\xf7\xf3\ \x91\xd1\xa1\xe5\xbd\xfb\x7e\xf8\xd2\xd7\xbe\xfa\x74\xd8\xeb\xf1\ \x6b\x8a\x22\x29\x14\x74\xda\x9a\xbd\xbc\x75\xec\xea\x5a\xee\x9b\ \x4a\xb0\x7f\xff\xe1\xd7\xbf\xb4\x91\x67\x7a\x5b\x78\x6a\x7b\x10\ \x01\xc4\xe2\x19\x0a\x85\x32\x5b\x3a\x03\xfc\xfc\xf7\x13\xc5\xb2\ \xcd\x1f\x8a\x8c\x0e\x2d\x03\xdc\xb8\x76\xf6\xb2\xea\xb8\xbf\xf5\ \xd1\xfe\xed\x03\xdb\xb6\x6e\xc4\xed\xb4\x63\xd7\x34\xb6\xb7\xb8\ \xd8\x11\x74\xb2\x23\x68\x63\x32\x5a\x1c\x94\x00\x1d\xc1\x20\x86\ \xa1\x12\x4f\x16\xb8\x3e\x97\x60\x71\x31\xcb\xc2\xc2\x0a\x96\x69\ \x92\x57\x1a\x1d\x75\x68\xdd\xb2\x99\xa5\x23\x85\x42\x8e\xc6\x06\ \x27\xa5\x82\xc1\xb5\x7f\xc5\x59\x59\xd1\xa9\x56\x54\x7c\x8d\x81\ \x7b\x35\x9e\xba\x30\x6b\xc5\x62\x8b\x2c\xa5\xf2\xa4\xd2\x79\xaa\ \x15\x13\xbb\x4d\x45\x48\x81\xcd\x2c\x19\xa1\xe1\xb0\x6f\x2d\xd8\ \xe5\xf5\x3f\xbe\x6d\xeb\x03\xe8\xe5\x0a\xb1\xd8\x32\x1e\xb7\x9d\ \x06\x8f\xc4\x32\xf3\x56\x3c\x7e\xd7\x04\x50\x82\x7d\x2f\xf4\x5c\ \x8a\xeb\x0f\x5f\xbc\x5b\x24\x72\x73\x99\x3d\x3d\x2d\x58\x55\x0b\ \x4d\x51\xf0\x35\x78\x70\x92\x53\x67\x13\x95\x50\xb0\xff\xc5\x13\ \x77\xa7\xde\x2d\xed\xdc\xff\xe3\xcd\x4f\x86\x7a\xfe\xf8\x58\xff\ \x83\xda\x9d\x68\x9a\x62\xde\xc0\xeb\x71\x70\xf8\xbd\xf1\xfc\xdf\ \xe2\x76\xdb\xc5\x05\x5d\x00\x6f\xae\xbb\x6e\xcf\xbd\xf0\xfa\x3e\ \xfb\xe6\x9d\xc7\xbf\xbc\xad\x4d\x48\x21\x90\x42\xf0\x48\x6f\x3b\ \xff\x98\x9a\xe1\xe4\xc4\xac\xe5\x75\xd9\x45\x5f\x77\x90\xfd\xcf\ \x3f\x89\x94\x82\xf3\xe7\x6e\x22\x85\x20\xbe\xb4\xc0\xd8\x99\xe8\ \xcc\xd9\xb1\xef\x3c\xfc\x1f\x23\x5d\x7b\x2b\x3e\xd8\x11\x74\xee\ \xf9\x4a\x5f\xa7\x2c\xe4\x74\xa4\x10\x08\x21\xb8\xbf\xdd\x4f\x6b\ \x4b\x23\x52\x0a\xf2\xb9\x32\xd5\x8a\x09\x40\xf4\x76\x1a\x4d\x53\ \x38\x7f\x79\x86\xf7\x3e\xae\x64\x2d\xab\xba\x77\xf2\xed\x6f\x4f\ \x02\xd6\x2a\xb8\xff\xb5\x23\xa7\x7c\x2e\x75\xd7\x77\xf7\x3e\xa0\ \x08\xc3\x26\x2d\xd3\x5a\x05\x4b\x29\x6a\x6b\x50\x15\xc9\xa6\xce\ \x00\x20\x88\xde\x4a\x21\x85\xa0\x8a\xce\xf4\x27\x51\x7e\x37\x9d\ \x31\xcc\x4a\xf9\x89\xa9\x5f\x1f\x8c\xa8\x00\xfd\x07\x7f\x13\x12\ \x96\xb9\xfb\x5b\x4f\x74\x08\xb7\xe6\x91\x86\x59\xc1\xe3\xb3\x23\ \x85\xa4\x54\x30\x3e\xed\x72\x0d\x2e\x85\x20\xbd\x54\xa4\xb5\xad\ \x01\xd3\x2a\xe3\x75\x35\x62\x59\x76\x9a\x1b\x1c\xc8\x6a\x42\x35\ \xf4\x92\x02\x08\x05\x10\xb1\x8f\x8e\x2f\xb4\xf5\x3e\xf7\x85\xb9\ \x78\x6e\xf3\x9e\xcf\xb7\x8b\x7c\x29\xcb\xc8\xfb\x57\x38\x3f\x3d\ \x9d\x5a\x5c\xc9\x39\xfa\xba\x83\xc2\xa6\xa8\xa8\x52\x62\xb3\x49\ \xa6\xe6\xa2\xd6\xc8\xd1\x09\x7d\xfc\x72\x34\xe7\xd2\xb0\xd9\x9c\ \x0e\x31\x39\x3d\x53\xfd\x38\x59\xfc\x45\xd5\x28\x5d\x4d\x5c\x19\ \xbf\xab\xd4\xea\xac\xc4\x2e\x9c\x38\xd6\xb8\xe5\xa9\xed\x91\xf9\ \xec\xd6\x6b\xf1\x02\x4b\xe9\xd4\x47\x13\x63\x3f\xf8\x5e\xae\xf1\ \x21\xfe\x7a\x4b\xef\x7d\x71\xa0\x0b\x2c\x81\x40\x72\xec\xc2\x1d\ \x31\x3b\x33\xf1\xb3\x2b\xc7\x47\x0e\xc5\xbd\xbd\xbe\x4b\xf3\x8b\ \xdd\x97\xe6\x93\xe1\xe9\x3f\xbc\x71\x28\x71\x65\xfc\x06\x50\xad\ \x37\x50\x01\xdc\x40\x5b\xcf\xbe\x91\x1f\x3d\xf2\xea\xaf\xce\x03\ \x83\xc0\x33\xc0\xb3\xa1\xe1\xb0\x35\x77\x3d\x61\x45\x4e\x7f\x62\ \xcd\x5d\x4f\x58\xa1\xe1\xb0\x05\x3c\x0b\x3c\x0d\xec\x06\xfa\x80\ \xcf\x01\xad\x40\x03\x60\xab\x7f\x4d\x16\x50\x51\x34\x67\x69\xf6\ \xfd\x9f\xbc\x03\x9c\x00\x1c\x80\xbd\x96\x14\x00\xff\x46\xcf\xba\ \x01\xac\x29\xd3\x81\x3c\x50\x00\x4a\x40\x05\x30\xd5\x1a\x14\xa0\ \x52\x35\x8a\x45\xa0\x2a\x55\xbb\x6e\x73\x37\x39\x4b\x99\x98\x04\ \x64\x79\x65\xf1\xdd\x6f\x1c\x3a\xb9\xbf\x4e\x34\x0a\x99\x77\x80\ \x78\x5d\x50\x0d\x58\xae\x25\x31\x00\xf3\xdf\xf0\x11\x56\x82\x70\ \x21\x0b\x3b\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ \x00\x00\x04\x7f\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x16\x00\x00\x00\x16\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\ \x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\ \xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x11\x00\x00\ \x0b\x11\x01\x7f\x64\x5f\x91\x00\x00\x00\x07\x74\x49\x4d\x45\x07\ \xd5\x09\x1a\x0b\x18\x25\x79\xd9\x51\x49\x00\x00\x04\x0c\x49\x44\ \x41\x54\x38\xcb\xa5\x95\x7f\x4c\x94\x75\x1c\xc7\x5f\xcf\x71\x02\ \x29\xe0\xa1\x96\x72\x84\x88\xcd\x69\x56\xc2\x09\xa3\x0d\xee\x16\ \x85\xb8\x16\x0a\xce\x65\x69\xb2\xa6\x16\xcb\x6a\xfd\xe1\x58\x0b\ \x19\xee\xdb\x93\xc4\x51\xff\xd0\x06\xe4\xc8\xd6\x9a\x63\x2d\xcc\ \x2d\x73\xda\x26\xb1\x69\x2d\xd8\x94\x1f\x67\x3b\xa9\x43\x25\x76\ \xbb\x38\x90\x1e\x91\x2e\x40\xb8\x3b\x9e\xa7\x3f\xe4\xb9\x1d\xe7\ \x41\x6d\x7d\xb7\x67\x7b\x3e\xcf\xbe\xcf\x6b\xef\xef\xe7\xf3\x7e\ \x3f\x8f\x44\xc4\x12\x42\x08\xe0\xfd\xb9\xf2\x3d\xa0\x57\x96\xe5\ \x76\xfe\xef\x12\x42\x68\xa3\xb7\x47\xb4\x99\x99\x69\xcd\xe5\xfa\ \x4d\x13\x42\x68\x15\x15\x15\xc5\x80\xf4\x2f\xaf\x4a\x80\x41\x2f\ \x0c\x51\x36\x98\x9b\x3e\x3d\x81\xa6\xaa\xa4\x9a\xcd\xec\xdb\xb7\ \x97\x84\x84\x84\xf3\x80\xb6\x10\x3c\xa7\xbc\x25\xe5\x83\x13\xe7\ \xd4\x9c\xf2\x96\x53\x91\x60\x49\x08\x91\x05\x20\xcb\xf2\x30\x60\ \xb6\xd7\x7d\xc4\xcc\xf4\x3d\x32\x32\x32\x22\x55\x45\x42\xb3\x00\ \xef\xb1\xc3\x3b\x31\x2f\x67\x4d\x4e\x79\x4b\xbb\x0e\x96\xaa\xab\ \xab\x65\xc0\x21\x84\x38\xae\xc3\xad\x56\x2b\x92\xf4\xc0\x81\xd4\ \x28\x82\x1d\x5d\x9f\xed\xa7\xa7\xa7\x87\x83\xf9\xcb\x0a\x2d\xe9\ \xf1\x85\x00\x46\x60\x49\x4c\x4c\xcc\xb1\x37\x0f\x97\x63\x88\x89\ \x7d\x17\xa8\xde\xb2\x65\x0b\x9b\x36\x6d\x44\xd3\x54\x24\x49\xc2\ \x3f\x33\x79\x45\x08\x91\x25\xcb\xf2\xb5\x28\x6a\x19\x18\x18\xc0\ \xe3\xf1\xf0\xe1\xf7\x93\x00\xe6\xd0\xd1\x9a\x9b\x9b\x9d\xa5\x25\ \x3b\x9f\x5c\xba\xf4\x21\x02\x7e\x3f\x9a\xa6\xa1\x69\x5a\x08\x90\ \x64\x4a\xa6\xb6\xd6\x0e\x60\x9e\x6b\x95\x0e\x75\x74\x36\xbd\x44\ \xde\xdb\xa7\xf5\xad\x96\xee\x93\x65\xd7\x42\x60\x21\x44\x4a\x7c\ \x7c\xfc\xaf\xcf\x6f\x2f\x34\x3d\xfe\xc4\x53\x48\x92\x14\x9a\x95\ \x6f\xfc\xee\x7d\xf8\x72\x13\xb5\xf6\x3a\x00\xf3\x05\xef\x86\xd5\ \x80\xe3\x6a\xf3\x2b\xc1\xdc\x37\xbe\x32\x02\x45\xdd\x27\xcb\xda\ \xa3\x0e\x43\x08\x91\x95\x9e\x9e\xfe\xb9\xdb\xed\xce\xd6\x9f\xe5\ \xe6\xe6\x06\xb6\x6d\x2b\x5c\xf2\xf7\x5f\xe3\x68\x9a\xc6\xb2\xc4\ \x24\x5a\x5b\x5b\x69\xea\x8c\xe5\xe7\x86\x17\xb1\xbe\x73\x66\x9e\ \xca\x70\xae\xb4\x88\x9f\x53\x00\x1b\xd0\x5a\x55\x75\x94\xb1\x3b\ \x0a\xd7\x6f\xfe\xc1\xc7\x67\xdd\x7c\x7b\xbc\x98\x82\x23\x67\x17\ \x84\x02\x9a\xf4\x1f\x02\x93\x05\x38\xd6\x5a\x8a\x39\x71\xe1\x06\ \xdf\x54\xe5\x53\xf5\x45\x37\x25\x9b\x03\xb8\x5c\xfd\x96\xb0\x81\ \xea\xfd\x8b\xee\xcb\x70\xd3\x2b\x43\x1e\xaf\x5e\xaf\x4a\x4d\xe3\ \x72\xfd\x2e\x0e\xd4\xb5\xb1\xcb\x12\xcf\xcb\x25\x45\xd4\xd4\xd4\ \xe8\x03\x1d\x05\x66\x17\x35\x7c\x38\x74\xcf\xf6\x8d\x64\x6e\x5e\ \x8f\xa2\x8c\xf1\x49\xcb\x15\x56\xa5\xa6\x51\xb1\x23\x05\xb3\xc9\ \xc8\xfa\x8c\x75\xa4\x3e\x9a\x86\x2c\xcb\x00\x96\x48\x2b\x1a\x16\ \x83\xbe\x5a\x6a\x45\x9d\x50\x48\x34\x99\x28\xb4\x24\xa1\x0c\x79\ \x70\xf5\xfe\x84\xcd\x66\x23\x3e\x2e\x96\x3b\x7f\xde\xe6\xfe\x37\ \x0b\x87\x9e\xdc\xa8\x60\x1d\xfa\xfa\xee\x4c\x0e\xed\x7e\x86\xb6\ \x8b\x3f\xf0\x63\x4f\x3f\x18\x8c\xcc\x06\x83\x21\xaf\xca\xb2\xcc\ \xca\x87\x57\x23\x49\xd2\x82\x70\x43\x24\xf4\xe8\x6b\x56\xf6\x17\ \xe7\x71\xfa\xbb\x76\xba\xfa\x06\xc9\xb3\xd9\x70\xb9\x6e\x11\xf0\ \x4f\x03\xe0\xf3\xf9\x14\xbf\xdf\x9f\x2d\xcb\x32\x2b\x56\x3d\x02\ \x10\x82\xc7\xc5\xc5\x85\xe0\x06\x3d\x45\xca\x90\xc7\x2b\xbf\xf5\ \x2c\x7b\xb6\x67\x73\xea\xcc\x45\x06\x3d\x5e\x8a\x8a\x4b\x70\xb9\ \x6e\xe1\x75\xdf\xa4\xa3\x5f\xc5\x18\x1c\xdd\x50\x5f\x5f\x7f\xd7\ \x6e\xb7\xdf\x18\x19\x19\xb1\xea\xca\x67\xfc\x7e\x0e\x1e\x3c\x40\ \x65\x65\x25\x80\x23\x04\x56\x86\x3c\x8e\x23\x65\x4f\x53\x5a\x90\ \x49\xeb\xb9\xcb\x0c\x7a\xbc\xd8\x9e\x2b\x9c\x07\x0d\x8c\xf6\x5a\ \xa6\x14\x77\x12\xb0\x02\x58\xe9\x74\x3a\x03\x4e\xa7\xb3\x58\x96\ \x65\xcc\xa9\x69\x34\x36\x36\xe2\xf3\xf9\x42\x9d\x30\xea\x77\xe9\ \xeb\xd2\x98\x55\x35\x46\x87\x06\x1f\x80\x4e\xfc\xde\x56\xa0\xb8\ \x2e\x05\xe6\x84\x24\x03\x86\xce\xce\xce\x20\x30\x3c\x31\x31\xb1\ \xb7\xa1\xa1\xe1\xeb\xb1\xb1\x31\x54\x55\xbd\x1a\x08\x04\xec\xa1\ \xe4\xad\x7b\xc1\xae\xed\xc8\x37\x63\xc9\xb6\xf0\x58\x8a\x89\x5f\ \xfa\x6e\x71\xb5\xab\x8b\x8e\x7e\x95\x29\xf7\xa5\xfc\xd1\xbe\x36\ \x25\x62\x26\x6a\x98\x55\x67\x81\x19\x60\x12\x98\x06\x82\xc0\xac\ \x11\x60\xc5\x9a\x94\xad\xe7\x3b\xbc\xbd\x7a\x83\xee\x4d\x4d\xd0\ \xd1\xaf\x12\x67\x98\x2c\x50\x93\x53\xc7\x01\x25\xcc\xf7\x3a\x50\ \xff\xa3\xa8\x73\xf0\xa0\x0e\x9d\x17\xe9\xad\x87\xbe\xb4\x8c\x8d\ \x0c\xf7\xea\x75\x42\x62\xec\xda\xeb\xad\x15\x23\xe1\x31\x0d\x83\ \x4a\x51\x62\xac\xce\x5d\x1a\xa0\xfd\x03\x8c\xf6\xde\xf1\x62\xa0\ \xea\x2a\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ \x00\x00\x05\x4f\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x16\x00\x00\x00\x16\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\ \x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\ \x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\ \x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\ \x67\x9b\xee\x3c\x1a\x00\x00\x04\xe1\x49\x44\x41\x54\x38\x8d\x8d\ \x94\x6b\x6c\x54\x45\x18\x86\x9f\x99\x33\xe7\xb6\x6d\x81\x82\x6d\ \x97\x3b\xbb\x6c\x2d\x97\x2d\x77\xe4\x2a\x01\x09\x24\xb2\x20\x26\ \x1a\x12\x12\x43\x54\x22\x28\x28\x26\x46\xa4\x5e\x12\x7f\x18\x65\ \x49\x48\xd0\x88\xc8\x1f\xf8\x01\x51\x13\x13\x23\x21\x6c\x00\xc1\ \x72\x11\xa4\x10\x25\x94\x96\x52\xe8\x65\x5b\x0a\x94\x36\x45\x28\ \xb4\xdd\xb6\xdb\x73\x8e\x3f\x76\xdb\xa0\x80\x38\xc9\x9b\xf9\x33\ \xf3\xcc\x97\x79\xbf\xf7\x13\x9e\xe7\xf1\xa4\x15\x88\x44\x0d\x20\ \x0c\xdc\x03\x6a\xe2\xb1\xa2\x27\x5e\x12\x8f\x03\x07\x22\xd1\x19\ \xc0\x3a\x60\x36\x30\x12\xe8\x04\x64\x5a\x97\x81\x13\xc0\xd6\x78\ \xac\xe8\xe6\xff\x02\xa7\xab\xdb\x0c\xac\x0d\x87\xfc\x19\x73\x26\ \x8e\x24\x1c\xf2\x53\x98\xef\x07\xa0\xbc\xba\x89\xb2\xea\x46\x4e\ \x5f\xa8\x4b\x96\x57\x37\x25\x80\xb7\xe2\xb1\xa2\xef\xff\x13\x1c\ \x88\x44\xc7\x02\x31\xdb\x54\xb9\x9b\x5e\x5b\x90\xb1\x78\x56\x3e\ \xc5\xe7\x6a\x28\xaf\x6d\xa2\xa2\xb6\x19\x29\x24\x85\x21\x3f\xe1\ \x50\x1e\xf3\xa7\x06\x38\xf4\xfb\x55\xa2\xbb\x8f\xb5\x25\xba\x92\ \x27\x80\x15\xf1\x58\x51\xc7\x43\xe0\x40\x24\x6a\x02\x95\xe3\x82\ \x79\x23\xbf\xf9\xf0\x45\x71\xae\xbc\x81\xad\x7b\x7f\xa3\x3b\xe9\ \xa0\x94\x86\xa6\x49\xa4\x94\x08\x21\x10\x02\x32\x6d\x83\x77\x57\ \xce\x66\x7c\x30\x87\x77\xa2\xfb\xbb\xca\xaa\x1b\xf7\xc6\x63\x45\ \x6f\x3c\x0a\xbc\xcd\xb6\xf4\x35\x07\xb7\xbf\xee\xdb\xba\xe7\x24\ \x27\xce\xd7\x31\x7d\xfc\x70\x5e\x5a\x38\x9e\x09\x21\x3f\x39\xd9\ \x19\x24\x7b\x1c\x1a\x6f\xb7\x71\xe8\x4c\x15\xfb\x4f\x56\xe2\xb8\ \x1e\x0b\xa6\x06\x58\xb5\x64\x12\xcf\xaf\xdf\xd5\x9e\xe8\x4a\x2e\ \x8b\xc7\x8a\x8e\xf5\x81\xd3\x46\x15\x7f\xb6\x6e\xb1\x4f\xd7\x35\ \x3e\xdf\x75\x1c\xd3\xd0\xd9\xb8\xea\x59\x56\x2c\x2a\x7c\xa4\xb9\ \x3f\xfe\x7a\x89\x3d\xb1\x52\x1c\xd7\xe5\xbd\x95\x33\x69\xb9\xdb\ \xce\xc7\x5f\x1f\x6c\xf6\x3c\x46\xc7\x63\x45\x6d\x32\x7d\xee\xed\ \x49\x05\x83\x7d\xcf\x3d\x13\x62\xdb\x77\xa7\x31\x4d\x1d\xd3\xd4\ \xf1\x80\xc3\x25\xd5\x7c\xb2\xb3\x98\xb5\x5b\x0e\xf0\xc3\x91\x4b\ \x7d\xe0\x85\xd3\x02\xd8\xb6\x89\x6d\x19\xec\x3e\x70\x81\xc5\x33\ \xf3\x99\x3c\x66\x68\x06\x10\x21\xdd\x3a\x00\xb3\xe7\x4e\x0e\x70\ \xa4\xa4\x8a\x1e\xc7\xc3\xd0\x15\xa6\xa1\xb3\xf7\x50\x19\x3b\x7f\ \xfe\x93\xab\xd7\xef\xd0\x96\x70\x38\x5d\x76\xbd\x0f\xac\x34\x89\ \xcf\x36\xb0\x2d\x03\xc7\x13\x9c\xab\xb8\xc9\xbc\x69\xa3\x7d\xc0\ \x4c\x00\x19\x88\x44\x2d\x60\xc4\x84\xfc\xc1\x54\xc4\x9b\xd1\x75\ \x0d\x43\x57\x18\x86\x42\x57\x1a\xa6\xa1\x63\x99\x06\x3e\xdb\x60\ \xf5\xd2\x49\x7d\xe0\x8b\xb5\x2d\xd8\x96\x89\x65\x19\x58\xa6\x41\ \x5d\xe3\x5d\x0a\x43\x7e\x21\xa5\x98\xd7\x5b\xf1\x44\x20\x51\x98\ \xef\xa7\xb2\xae\x05\xa5\x34\x74\x5d\xf5\xc9\x30\x52\xdf\xb2\x76\ \xf9\x64\x26\x3f\x9d\x07\xc0\xb5\xa6\x7b\xc4\x4a\xea\xb0\x2d\x03\ \xdb\x34\x30\x4d\x9d\xfa\xa6\xfb\x8c\x1d\x95\x83\xe7\x79\x63\x01\ \x14\xd0\x06\x48\x21\x04\x52\x93\x28\x4d\x43\x69\x12\x3d\xfd\x80\ \xa1\x2b\x5e\x98\x1b\x62\xda\x98\x54\x40\xea\x9b\xee\xb3\xf7\xe8\ \x55\x74\x43\x47\x48\x89\x94\x02\x04\xe8\x4a\xa5\x5a\x11\xd1\xd9\ \x5b\xf1\x65\x40\x55\xd4\x36\x13\x0e\xe6\x21\xa5\x44\xd3\x52\x52\ \x9a\x86\x52\x1a\x13\x43\xb9\x7d\x5f\x50\x5c\x7a\x13\x5d\xd7\xb1\ \x2d\x03\xcb\xd4\x31\x0c\x1d\x5d\x29\x46\x0f\xcb\xe6\xea\xb5\x16\ \x84\x14\x17\x00\x54\x3c\x56\xe4\x06\x22\xd1\xca\x8a\x9a\x5b\x13\ \xc7\x05\x73\x29\xb9\x74\x03\x29\x53\x61\xd0\xa4\x40\xd3\x24\x3b\ \xf6\x5d\xc4\x67\x1b\x58\x96\x91\x82\xda\x06\x3d\x8e\x8b\x00\x1c\ \xc7\x25\xa9\x24\xc1\x21\xfd\xa9\xa8\x6e\x74\x1d\xc7\x3d\xf9\x60\ \x57\x9c\x38\x55\x5a\xef\xcc\x9f\x1a\xc0\x32\x54\x2a\x39\x90\x4e\ \x99\xe0\x95\x45\x63\x58\x13\x09\xf3\xea\xa2\x02\xb2\xb3\x2c\x7c\ \xb6\x89\xae\x34\xa4\x26\x11\x52\x60\x1b\x8a\xc2\x60\x0e\xc5\x67\ \xab\x3a\x81\x92\x07\xc1\x5b\x4a\x4a\xeb\x13\x67\xcb\x1b\x58\xbd\ \x7c\x0a\x00\x1e\xe0\xe1\xe1\x79\x1e\xb9\xd9\x3e\xfc\x03\x7d\xe4\ \x0e\xb0\xc1\x73\x49\x74\x76\xd3\xd3\xe3\xe0\xba\x2e\x9e\xeb\xb1\ \x74\x56\x90\x53\x17\xea\xbd\xf3\x95\x37\x2a\x80\xc3\x7d\xe0\xf4\ \xe8\x5b\xff\xe9\xb7\xbf\x74\xcc\x0c\x0f\x63\x4a\xc1\x60\x5c\xd7\ \xc5\x75\x3c\x5c\xd7\x4d\xbd\x92\x5e\x5d\xdd\x3d\x24\x12\x5d\x74\ \x76\x25\xe9\x4e\xf6\x50\x30\xac\x3f\x01\x7f\x16\x1f\x7d\x15\xeb\ \x70\x1c\x77\x45\xef\xac\xfe\xc7\x74\x0b\x2e\x8d\x1e\x99\x51\x38\ \x72\xde\xb6\xf7\x97\x19\xe7\xaf\xdc\xe2\xa7\xe3\x95\x08\x4d\xc3\ \x32\x7b\x8d\x52\x28\xa5\x21\x85\x40\x69\x82\xc5\x53\x87\x13\xf0\ \xf7\x63\xfd\xe6\x7d\x1d\x7f\x5c\x6a\xd8\x58\x7b\x60\xd3\x8e\x5e\ \xd6\xbf\xc7\x66\xa6\x10\x62\x7b\x56\x86\xf9\xf2\x17\x1b\x96\x64\ \x4c\x1f\x37\x94\xf3\x57\x6e\x71\xad\xf9\x3e\x37\x5a\xda\xd1\x75\ \x8d\x51\xfe\x01\x8c\xc8\xcb\xa2\x30\x30\x88\x33\x65\x0d\xde\xa6\ \x2f\x0f\x74\xb4\x77\x74\x7f\xf0\x20\xf4\x21\x30\x29\xc3\x32\xfd\ \xb3\xde\x8c\xd8\xd9\x23\x76\xcc\x99\x12\xf4\xcd\x9f\x16\x32\xc3\ \xa3\xf3\x44\xfe\x88\x41\x00\x54\x37\xfc\x45\x79\xcd\x2d\xf7\xe8\ \x99\x2b\xc9\xb3\xa5\x35\xb5\xb7\xab\x8e\x6d\x68\xad\x3e\x76\x19\ \x68\xf5\x3c\xaf\xed\x91\x60\x21\x44\x36\x30\x10\x18\xa4\x67\xe4\ \x0c\xe9\x17\x98\xbb\xd0\xc8\xcc\x09\x9b\x59\x4f\x15\xa0\x32\x72\ \x04\x8e\xeb\x74\xb6\x36\x27\x5a\x1b\xab\xba\x5b\x1b\x2f\xb7\xd6\ \x1c\x3f\x0d\xde\x6d\xe0\x0e\x70\x1b\xb8\xe9\x79\x5e\xe2\x71\x15\ \x2b\xc0\x06\x7c\x40\x56\x5a\xfd\x80\xcc\xb4\xd9\x09\x52\x69\xbd\ \x9f\xde\xdb\xd3\xea\xf4\x1e\x80\xfd\x0d\xc2\x22\xe7\x20\xf7\x3e\ \x8c\x40\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ " qt_resource_name = "\ \x00\x05\ \x00\x6f\xa6\x53\ \x00\x69\ \x00\x63\x00\x6f\x00\x6e\x00\x73\ \x00\x05\ \x00\x35\x9b\x52\ \x00\x32\ \x00\x32\x00\x78\x00\x32\x00\x32\ \x00\x04\ \x00\x06\x87\x73\ \x00\x61\ \x00\x70\x00\x70\x00\x73\ \x00\x0a\ \x0b\xeb\xbe\x83\ \x00\x63\ \x00\x61\x00\x74\x00\x65\x00\x67\x00\x6f\x00\x72\x00\x69\x00\x65\x00\x73\ \x00\x07\ \x07\xab\x06\x93\ \x00\x61\ \x00\x63\x00\x74\x00\x69\x00\x6f\x00\x6e\x00\x73\ \x00\x11\ \x01\xa6\xc4\x87\ \x00\x64\ \x00\x6f\x00\x63\x00\x75\x00\x6d\x00\x65\x00\x6e\x00\x74\x00\x2d\x00\x6f\x00\x70\x00\x65\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\ \ \x00\x12\ \x00\x03\x49\x87\ \x00\x73\ \x00\x79\x00\x73\x00\x74\x00\x65\x00\x6d\x00\x2d\x00\x6c\x00\x6f\x00\x67\x00\x2d\x00\x6f\x00\x75\x00\x74\x00\x2e\x00\x70\x00\x6e\ \x00\x67\ \x00\x10\ \x0c\xbc\x2e\x67\ \x00\x64\ \x00\x6f\x00\x63\x00\x75\x00\x6d\x00\x65\x00\x6e\x00\x74\x00\x2d\x00\x6e\x00\x65\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\ \x00\x11\ \x0f\xe3\xd5\x67\ \x00\x64\ \x00\x6f\x00\x63\x00\x75\x00\x6d\x00\x65\x00\x6e\x00\x74\x00\x2d\x00\x73\x00\x61\x00\x76\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\ \ \x00\x0e\ \x0d\x8b\x39\xe7\ \x00\x65\ \x00\x64\x00\x69\x00\x74\x00\x2d\x00\x63\x00\x6c\x00\x65\x00\x61\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\ \x00\x14\ \x0b\xa9\xab\x27\ \x00\x64\ \x00\x6f\x00\x63\x00\x75\x00\x6d\x00\x65\x00\x6e\x00\x74\x00\x2d\x00\x73\x00\x61\x00\x76\x00\x65\x00\x2d\x00\x61\x00\x73\x00\x2e\ \x00\x70\x00\x6e\x00\x67\ \x00\x17\ \x0d\x58\x3e\xe7\ \x00\x61\ \x00\x70\x00\x70\x00\x6c\x00\x69\x00\x63\x00\x61\x00\x74\x00\x69\x00\x6f\x00\x6e\x00\x73\x00\x2d\x00\x73\x00\x79\x00\x73\x00\x74\ \x00\x65\x00\x6d\x00\x2e\x00\x70\x00\x6e\x00\x67\ \x00\x16\ \x01\x70\xe1\x87\ \x00\x70\ \x00\x72\x00\x65\x00\x66\x00\x65\x00\x72\x00\x65\x00\x6e\x00\x63\x00\x65\x00\x73\x00\x2d\x00\x73\x00\x79\x00\x73\x00\x74\x00\x65\ \x00\x6d\x00\x2e\x00\x70\x00\x6e\x00\x67\ \x00\x10\ \x0f\xad\xca\x47\ \x00\x68\ \x00\x65\x00\x6c\x00\x70\x00\x2d\x00\x62\x00\x72\x00\x6f\x00\x77\x00\x73\x00\x65\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\ " qt_resource_struct = "\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\ \x00\x00\x00\x10\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\ \x00\x00\x00\x20\x00\x02\x00\x00\x00\x01\x00\x00\x00\x0f\ \x00\x00\x00\x48\x00\x02\x00\x00\x00\x06\x00\x00\x00\x09\ \x00\x00\x00\x2e\x00\x02\x00\x00\x00\x02\x00\x00\x00\x07\ \x00\x00\x01\x80\x00\x00\x00\x00\x00\x01\x00\x00\x1e\x0f\ \x00\x00\x01\x4c\x00\x00\x00\x00\x00\x01\x00\x00\x18\x3b\ \x00\x00\x00\x84\x00\x00\x00\x00\x00\x01\x00\x00\x03\x9b\ \x00\x00\x00\x5c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x01\x1e\x00\x00\x00\x00\x00\x01\x00\x00\x13\xee\ \x00\x00\x00\xae\x00\x00\x00\x00\x00\x01\x00\x00\x07\xdb\ \x00\x00\x00\xfc\x00\x00\x00\x00\x00\x01\x00\x00\x0f\x15\ \x00\x00\x00\xd4\x00\x00\x00\x00\x00\x01\x00\x00\x0a\x93\ \x00\x00\x01\xb2\x00\x00\x00\x00\x00\x01\x00\x00\x22\x92\ " qInitResources()
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 20857, 2134, 2438, 198, 2, 198, 2, 15622, 416, 25, 383, 20857, 3082, 5329, 329, 9485, 48, 83, 19, 357, 48, 83, 410, 19, 13, 23, 13, 22, 8, 198, 2, 198, ...
1.239264
36,629
# Created by Xinyu Zhu on 2021/6/6, 21:08 from turtle import Turtle import turtle if __name__ == '__main__': tur = Turtle() wn = turtle.Screen() wn.title("Turtle Demo") wn.setworldcoordinates(0, 0, 500, 500) tur.speed(0) draw_rectangle(tur, 0, 0, 500, 500) a = input()
[ 2, 15622, 416, 1395, 3541, 84, 33144, 319, 33448, 14, 21, 14, 21, 11, 2310, 25, 2919, 198, 198, 6738, 28699, 1330, 33137, 198, 11748, 28699, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220...
2.333333
129
from __future__ import absolute_import, division from keras.layers import * from deform_conv.layers import ConvOffset2D
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 11, 7297, 628, 198, 6738, 41927, 292, 13, 75, 6962, 1330, 1635, 198, 6738, 47577, 62, 42946, 13, 75, 6962, 1330, 34872, 34519, 17, 35, 628, 628 ]
3.571429
35
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from unit.common import Unit from helpers.eventually import eventually from helpers.shell import execute import string import time import os
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 4326, 13, 11321, 1330, 11801, 198, 6738, 49385, 13, 15596, 935, 1330, 4191, 198, 6738, 49385, 13, 29149,...
3.392857
56
from pythonneat.neat.Species import Species import pythonneat.neat.Speciation as Speciation import pythonneat.neat.utils.Parameters as Parameters current_genomes = [] def add_genome(genome): """Adds genome to the species list based on its compatability distance to already existing species Inputs: genome: The genome to add. type: Genome """ for specie in current_genomes: first = specie.get_champion() if Speciation.compatibility_distance(genome, first) < Parameters.COMPATABILITY_THRESHOLD: specie.add_genome(genome) return s = Species() s.add_genome(genome) current_genomes.append(s) return
[ 6738, 21015, 710, 265, 13, 710, 265, 13, 5248, 3171, 1330, 28540, 198, 11748, 21015, 710, 265, 13, 710, 265, 13, 5248, 17269, 355, 2531, 17269, 198, 11748, 21015, 710, 265, 13, 710, 265, 13, 26791, 13, 48944, 355, 40117, 198, 198, 1...
2.670588
255
from __future__ import absolute_import # flake8: noqa # import apis into api package from container_service_extension.pksclient.api.cluster_api import ClusterApi from container_service_extension.pksclient.api.plans_api import PlansApi from container_service_extension.pksclient.api.profile_api import ProfileApi from container_service_extension.pksclient.api.users_api import UsersApi
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 198, 2, 781, 539, 23, 25, 645, 20402, 198, 198, 2, 1330, 2471, 271, 656, 40391, 5301, 198, 6738, 9290, 62, 15271, 62, 2302, 3004, 13, 79, 591, 16366, 13, 15042, 13, 565, 5819, 6...
3.307692
117
""" This is a simple application for sentence embeddings: clustering Sentences are mapped to sentence embeddings and then agglomerative clustering with a threshold is applied. """ from sentence_transformers import SentenceTransformer from sklearn.cluster import AgglomerativeClustering import numpy as np embedder = SentenceTransformer('paraphrase-MiniLM-L6-v2') # Corpus with example sentences corpus = ['A man is eating food.', 'A man is eating a piece of bread.', 'A man is eating pasta.', 'The girl is carrying a baby.', 'The baby is carried by the woman', 'A man is riding a horse.', 'A man is riding a white horse on an enclosed ground.', 'A monkey is playing drums.', 'Someone in a gorilla costume is playing a set of drums.', 'A cheetah is running behind its prey.', 'A cheetah chases prey on across a field.' ] corpus_embeddings = embedder.encode(corpus) # Normalize the embeddings to unit length corpus_embeddings = corpus_embeddings / np.linalg.norm(corpus_embeddings, axis=1, keepdims=True) # Perform kmean clustering clustering_model = AgglomerativeClustering(n_clusters=None, distance_threshold=1.5) #, affinity='cosine', linkage='average', distance_threshold=0.4) clustering_model.fit(corpus_embeddings) cluster_assignment = clustering_model.labels_ clustered_sentences = {} for sentence_id, cluster_id in enumerate(cluster_assignment): if cluster_id not in clustered_sentences: clustered_sentences[cluster_id] = [] clustered_sentences[cluster_id].append(corpus[sentence_id]) for i, cluster in clustered_sentences.items(): print("Cluster ", i+1) print(cluster) print("")
[ 37811, 198, 1212, 318, 257, 2829, 3586, 329, 6827, 11525, 67, 654, 25, 32966, 1586, 198, 198, 31837, 3007, 389, 27661, 284, 6827, 11525, 67, 654, 290, 788, 4194, 75, 12057, 876, 32966, 1586, 351, 257, 11387, 318, 5625, 13, 198, 37811,...
2.742089
632
from netapp.netapp_object import NetAppObject
[ 6738, 2010, 1324, 13, 3262, 1324, 62, 15252, 1330, 3433, 4677, 10267, 198 ]
3.538462
13
#Learning Python import os list = [1,2,3] ##using list as a queue print(list) list.pop(0) print(list) list.append(5) print(list)
[ 2, 41730, 11361, 198, 198, 11748, 28686, 198, 198, 4868, 796, 685, 16, 11, 17, 11, 18, 60, 198, 198, 2235, 3500, 1351, 355, 257, 16834, 198, 198, 4798, 7, 4868, 8, 198, 4868, 13, 12924, 7, 15, 8, 198, 4798, 7, 4868, 8, 198, 48...
2.333333
57
import pandas as pd wine = pd.read_csv('https://bit.ly/wine-date') # wine = pd.read_csv('../data/wine.csv') print(wine.head()) data = wine[['alcohol', 'sugar', 'pH']].to_numpy() target = wine['class'].to_numpy() from sklearn.model_selection import train_test_split train_input, test_input, train_target, test_target = train_test_split(data, target, test_size=0.2, random_state=42) print(train_input.shape, test_input.shape) sub_input, val_input, sub_target, val_target = train_test_split(train_input, train_target, test_size=0.2, random_state=42) print(sub_input.shape, val_input.shape) from sklearn.tree import DecisionTreeClassifier dt = DecisionTreeClassifier(random_state=42) dt.fit(sub_input, sub_target) print(dt.score(sub_input, sub_target)) print(dt.score(val_input, val_target)) from sklearn.model_selection import cross_validate scores = cross_validate(dt, train_input, train_target) print(scores) import numpy as np print(np.mean(scores['test_score'])) from sklearn.model_selection import StratifiedKFold scores = cross_validate(dt, train_input, train_target, cv=StratifiedKFold()) print(np.mean(scores['test_score'])) splitter = StratifiedKFold(n_splits=10, shuffle=True, random_state=42) scores = cross_validate(dt, train_input, train_target, cv=splitter) print(np.mean(scores['test_score'])) from sklearn.model_selection import GridSearchCV params = {'min_impurity_decrease': [0.0001, 0.0002, 0.0003, 0.0004, 0.0005]} gs = GridSearchCV(DecisionTreeClassifier(random_state=42), params, n_jobs=1) gs.fit(train_input, train_target) dt = gs.best_estimator_ print(dt.score(train_input, train_target)) print(gs.best_params_) print(gs.cv_results_['mean_test_score']) best_index = np.argmax(gs.cv_results_['mean_test_score']) print(gs.cv_results_['params'][best_index]) params = {'min_impurity_decrease': np.arange(0.0001, 0.001, 0.0001), 'max_depth': range(5, 20, 1), 'min_samples_split': range(2, 100, 10) } gs = GridSearchCV(DecisionTreeClassifier(random_state=42), params, n_jobs=-1) gs.fit(train_input, train_target) print(gs.best_params_) print(np.max(gs.cv_results_['mean_test_score'])) from scipy.stats import uniform, randint rgen = randint(0, 10) print(rgen.rvs(10)) print(np.unique(rgen.rvs(1000), return_counts=True)) ugen = uniform(0, 1) print(ugen.rvs(10)) params = {'min_impurity_decrease': uniform(0.0001, 0.001), 'max_depth': randint(20, 50), 'min_samples_split': randint(2, 25), 'min_samples_leaf': randint(1, 25) } from sklearn.model_selection import RandomizedSearchCV gs = RandomizedSearchCV(DecisionTreeClassifier(random_state=42), params, n_iter=100, n_jobs=-1, random_state=42) gs.fit(train_input, train_target) print(gs.best_params_) print(np.max(gs.cv_results_['mean_test_score'])) dt = gs.best_estimator_ print(dt.score(test_input, test_target)) # Exam gs = RandomizedSearchCV(DecisionTreeClassifier(splitter='random', random_state=42), params, n_iter=100, n_jobs=-1, random_state=42) gs.fit(train_input, train_target) print(gs.best_params_) print(np.max(gs.cv_results_['mean_test_score'])) dt = gs.best_estimator_ print(dt.score(test_input, test_target))
[ 11748, 19798, 292, 355, 279, 67, 198, 198, 39002, 796, 279, 67, 13, 961, 62, 40664, 10786, 5450, 1378, 2545, 13, 306, 14, 39002, 12, 4475, 11537, 198, 2, 8237, 796, 279, 67, 13, 961, 62, 40664, 10786, 40720, 7890, 14, 39002, 13, 4...
2.501173
1,279
# Module to build a potential landscape import numpy as np def gauss(x,mean=0.0,stddev=0.02,peak=1.0): ''' Input: x : x-coordintes Output: f(x) where f is a Gaussian with the given mean, stddev and peak value ''' stddev = 5*(x[1] - x[0]) return peak*np.exp(-(x-mean)**2/(2*stddev**2)) def init_ndot(x,n_dot): ''' Input: x : 1d grid for the dots ndot : number of dots Output: y : cordinates of the potential grid with ndots The potential barriers are modelled as gaussians ''' # n dots imply n+1 barriers bar_centers = x[0] + (x[-1] - x[0])*np.random.rand(n_dot+1) bar_heights = np.random.rand(n_dot+1) #bar_heights = 0.5*np.ones(n_dot+1) N = len(x) y = np.zeros(N) # no need to optimize here really since the dot number is generally small, the calculation of the gauss function is already done in a vectorised manner for j in range(n_dot+1): y += gauss(x-bar_centers[j],peak=bar_heights[j]) return y
[ 2, 19937, 284, 1382, 257, 2785, 10747, 198, 11748, 299, 32152, 355, 45941, 198, 198, 4299, 31986, 1046, 7, 87, 11, 32604, 28, 15, 13, 15, 11, 301, 1860, 1990, 28, 15, 13, 2999, 11, 36729, 28, 16, 13, 15, 2599, 198, 220, 220, 220...
2.283146
445
from sys import stdin input = stdin.readline from collections import deque N, Q = map(int, input().split()) tree = [[] for _ in range(N + 1)] level = [0] * (N + 1) for _ in range(N - 1): a, b = map(int, input().split()) tree[a].append(b) tree[b].append(a) visited = [False] * (N + 1) bfs(1) for _ in range(Q): x, y = map(int, input().split()) print(solve(x, y))
[ 6738, 25064, 1330, 14367, 259, 198, 198, 15414, 796, 14367, 259, 13, 961, 1370, 198, 6738, 17268, 1330, 390, 4188, 198, 198, 45, 11, 1195, 796, 3975, 7, 600, 11, 5128, 22446, 35312, 28955, 198, 21048, 796, 16410, 60, 329, 4808, 287, ...
2.280702
171
""" nested field implements marshmallow field for objectfactory nested objects """ # lib import marshmallow # src from .serializable import Serializable from .factory import create
[ 37811, 198, 77, 7287, 2214, 198, 198, 320, 1154, 902, 22397, 42725, 2214, 329, 2134, 69, 9548, 28376, 5563, 198, 37811, 198, 198, 2, 9195, 198, 11748, 22397, 42725, 198, 198, 2, 12351, 198, 6738, 764, 46911, 13821, 1330, 23283, 13821, ...
3.77551
49
from wasabi import msg from ._util import app, setup_cli # noqa: F401 # These are the actual functions, NOT the wrapped CLI commands. The CLI commands # are registered automatically and won't have to be imported here. from .download import download # noqa: F401 from .info import info # noqa: F401 from .package import package # noqa: F401 from .profile import profile # noqa: F401 from .train import train_cli # noqa: F401 from .pretrain import pretrain # noqa: F401 from .debug_data import debug_data # noqa: F401 from .debug_config import debug_config # noqa: F401 from .debug_model import debug_model # noqa: F401 from .evaluate import evaluate # noqa: F401 from .convert import convert # noqa: F401 from .init_pipeline import init_pipeline_cli # noqa: F401 from .init_config import init_config, fill_config # noqa: F401 from .validate import validate # noqa: F401 from .project.clone import project_clone # noqa: F401 from .project.assets import project_assets # noqa: F401 from .project.run import project_run # noqa: F401 from .project.dvc import project_update_dvc # noqa: F401 from .project.push import project_push # noqa: F401 from .project.pull import project_pull # noqa: F401 from .project.document import project_document # noqa: F401
[ 6738, 373, 17914, 1330, 31456, 198, 198, 6738, 47540, 22602, 1330, 598, 11, 9058, 62, 44506, 220, 1303, 645, 20402, 25, 376, 21844, 198, 198, 2, 2312, 389, 262, 4036, 5499, 11, 5626, 262, 12908, 43749, 9729, 13, 383, 43749, 9729, 198,...
3.211587
397
from direct.showbase.ShowBase import ShowBase app = MyApp() app.run()
[ 6738, 1277, 13, 12860, 8692, 13, 15307, 14881, 1330, 5438, 14881, 198, 198, 1324, 796, 2011, 4677, 3419, 198, 1324, 13, 5143, 3419, 198 ]
2.958333
24
#!/usr/bin/env python3 # Copyright (C) 2017-2020 The btclib developers # # This file is part of btclib. It is subject to the license terms in the # LICENSE file found in the top-level directory of this distribution. # # No part of btclib including this file, may be copied, modified, propagated, # or distributed except according to the terms contained in the LICENSE file. """Elliptic Curve Schnorr Signature Algorithm (ECSSA). This implementation is according to BIP340-Schnorr: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki Differently from ECDSA, the BIP340-Schnorr scheme supports messages of size hsize only. It also uses as public key the x-coordinate (field element) of the curve point associated to the private key 0 < q < n. Therefore, for sepcp256k1 the public key size is 32 bytes. Arguably, the knowledge of q as the discrete logarithm of Q also implies the knowledge of n-q as discrete logarithm of -Q. As such, {q, n-q} can be considered a single private key and {Q, -Q} the associated public key characterized by the shared x_Q. Also, BIP340 advocates its own SHA256 modification as hash function: TaggedHash(tag, x) = SHA256(SHA256(tag)||SHA256(tag)||x) The rationale is to make BIP340 signatures invalid for anything else but Bitcoin and vice versa. TaggedHash is used for both the challenge (with tag 'BIPSchnorr') and the deterministic nonce (with tag 'BIPSchnorrDerive'). To allow for secure batch verification of multiple signatures, BIP340-Schnorr uses a challenge that prevents public key recovery from signature: c = TaggedHash('BIPSchnorr', x_k||x_Q||msg). A custom deterministic algorithm for the ephemeral key (nonce) is used for signing, instead of the RFC6979 standard: k = TaggedHash('BIPSchnorrDerive', q||msg) Finally, BIP340-Schnorr adopts a robust [r][s] custom serialization format, instead of the loosely specified ASN.1 DER standard. The signature size is p-size*n-size, where p-size is the field element (curve point coordinate) byte size and n-size is the scalar (curve point multiplication coefficient) byte size. For sepcp256k1 the resulting signature size is 64 bytes. """ import secrets from hashlib import sha256 from typing import List, Optional, Sequence, Tuple, Union from .alias import ( HashF, Integer, JacPoint, Octets, Point, SSASig, SSASigTuple, String, ) from .bip32 import BIP32Key from .curve import Curve, secp256k1 from .curvegroup import _double_mult, _mult, _multi_mult from .hashes import reduce_to_hlen from .numbertheory import mod_inv from .to_prvkey import PrvKey, int_from_prvkey from .to_pubkey import point_from_pubkey from .utils import bytes_from_octets, hex_string, int_from_bits # TODO relax the p_ThreeModFour requirement # hex-string or bytes representation of an int # 33 or 65 bytes or hex-string # BIP32Key as dict or String # tuple Point BIP340PubKey = Union[Integer, Octets, BIP32Key, Point] def point_from_bip340pubkey(x_Q: BIP340PubKey, ec: Curve = secp256k1) -> Point: """Return a verified-as-valid BIP340 public key as Point tuple. It supports: - BIP32 extended keys (bytes, string, or BIP32KeyData) - SEC Octets (bytes or hex-string, with 02, 03, or 04 prefix) - BIP340 Octets (bytes or hex-string, p-size Point x-coordinate) - native tuple """ # BIP 340 key as integer if isinstance(x_Q, int): y_Q = ec.y_quadratic_residue(x_Q, True) return x_Q, y_Q else: # (tuple) Point, (dict or str) BIP32Key, or 33/65 bytes try: x_Q = point_from_pubkey(x_Q, ec)[0] y_Q = ec.y_quadratic_residue(x_Q, True) return x_Q, y_Q except Exception: pass # BIP 340 key as bytes or hex-string if isinstance(x_Q, (str, bytes)): Q = bytes_from_octets(x_Q, ec.psize) x_Q = int.from_bytes(Q, "big") y_Q = ec.y_quadratic_residue(x_Q, True) return x_Q, y_Q raise ValueError("not a BIP340 public key") def deserialize(sig: SSASig, ec: Curve = secp256k1) -> SSASigTuple: """Return the verified components of the provided BIP340 signature. The BIP340 signature can be represented as (r, s) tuple or as binary [r][s] compact representation. """ if isinstance(sig, tuple): r, s = sig else: if isinstance(sig, str): # hex-string of the serialized signature sig2 = bytes.fromhex(sig) else: sig2 = bytes_from_octets(sig, ec.psize + ec.nsize) r = int.from_bytes(sig2[: ec.psize], byteorder="big") s = int.from_bytes(sig2[ec.nsize :], byteorder="big") _validate_sig(r, s, ec) return r, s def serialize(x_K: int, s: int, ec: Curve = secp256k1) -> bytes: "Return the BIP340 signature as [r][s] compact representation." _validate_sig(x_K, s, ec) return x_K.to_bytes(ec.psize, "big") + s.to_bytes(ec.nsize, "big") def gen_keys(prvkey: PrvKey = None, ec: Curve = secp256k1) -> Tuple[int, int]: "Return a BIP340 private/public (int, int) key-pair." # BIP340 is defined for curves whose field prime p = 3 % 4 ec.require_p_ThreeModFour() if prvkey is None: q = 1 + secrets.randbelow(ec.n - 1) else: q = int_from_prvkey(prvkey, ec) QJ = _mult(q, ec.GJ, ec) x_Q = ec._x_aff_from_jac(QJ) if not ec.has_square_y(QJ): q = ec.n - q return q, x_Q # TODO move to hashes # This implementation can be sped up by storing the midstate after hashing # tag_hash instead of rehashing it all the time. def _det_nonce( m: Octets, prvkey: PrvKey, ec: Curve = secp256k1, hf: HashF = sha256 ) -> Tuple[int, int]: """Return a BIP340 deterministic ephemeral key (nonce).""" # The message m: a hlen array hlen = hf().digest_size m = bytes_from_octets(m, hlen) q, _ = gen_keys(prvkey, ec) return __det_nonce(m, q, ec, hf) def det_nonce( msg: String, prvkey: PrvKey, ec: Curve = secp256k1, hf: HashF = sha256 ) -> Tuple[int, int]: """Return a BIP340 deterministic ephemeral key (nonce).""" m = reduce_to_hlen(msg, hf) return _det_nonce(m, prvkey, ec, hf) def _sign( m: Octets, prvkey: PrvKey, k: Optional[PrvKey] = None, ec: Curve = secp256k1, hf: HashF = sha256, ) -> SSASigTuple: """Sign message according to BIP340 signature algorithm.""" # BIP340 is defined for curves whose field prime p = 3 % 4 ec.require_p_ThreeModFour() # The message m: a hlen array hlen = hf().digest_size m = bytes_from_octets(m, hlen) q, x_Q = gen_keys(prvkey, ec) # The nonce k: an integer in the range 1..n-1. k, x_K = __det_nonce(m, q, ec, hf) if k is None else gen_keys(k, ec) # Let c = int(hf(bytes(x_K) || bytes(x_Q) || m)) mod n. c = __challenge(m, x_Q, x_K, ec, hf) return __sign(c, q, k, x_K, ec) def sign( msg: String, prvkey: PrvKey, k: Optional[PrvKey] = None, ec: Curve = secp256k1, hf: HashF = sha256, ) -> SSASigTuple: """Sign message according to BIP340 signature algorithm. The message msg is first processed by hf, yielding the value m = hf(msg), a sequence of bits of length *hlen*. Normally, hf is chosen such that its output length *hlen* is roughly equal to *nlen*, the bit-length of the group order *n*, since the overall security of the signature scheme will depend on the smallest of *hlen* and *nlen*; however, ECSSA supports all combinations of *hlen* and *nlen*. """ m = reduce_to_hlen(msg, hf) return _sign(m, prvkey, k, ec, hf) def _verify( m: Octets, Q: BIP340PubKey, sig: SSASig, ec: Curve = secp256k1, hf: HashF = sha256 ) -> bool: """Verify the BIP340 signature of the provided message.""" # try/except wrapper for the Errors raised by _assert_as_valid try: _assert_as_valid(m, Q, sig, ec, hf) except Exception: return False else: return True def verify( msg: String, Q: BIP340PubKey, sig: SSASig, ec: Curve = secp256k1, hf: HashF = sha256 ) -> bool: """ECDSA signature verification (SEC 1 v.2 section 4.1.4).""" m = reduce_to_hlen(msg, hf) return _verify(m, Q, sig, ec, hf) # FIXME add crack_prvkey def batch_verify( m: Sequence[Octets], Q: Sequence[BIP340PubKey], sig: Sequence[SSASig], ec: Curve = secp256k1, hf: HashF = sha256, ) -> bool: """Batch verification of BIP340 signatures.""" # try/except wrapper for the Errors raised by _batch_verify try: _batch_verify(m, Q, sig, ec, hf) except Exception: return False else: return True
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 15069, 357, 34, 8, 2177, 12, 42334, 383, 275, 83, 565, 571, 6505, 198, 2, 198, 2, 770, 2393, 318, 636, 286, 275, 83, 565, 571, 13, 632, 318, 2426, 284, 262, 5964, 2...
2.502746
3,459
import json
[ 11748, 33918, 628, 628, 628, 628 ]
3.166667
6
import matplotlib.pyplot as plt import cv2 import imutils import pytesseract as pt from tkinter import * from tkinter import messagebox # ploting the images # read the image using numpy print("\n1.car-1\n2.car-2\n3.car-3") a = int(input("Enter the choice of car : ")) if a == 1: path = "./image/a.jpg" elif a == 2: path = "./image/b.jpg" else: path = "./image/c.jpg" image = cv2.imread(path) # resizing the image image = imutils.resize(image, width=500) cv2.imshow("original image", image) # delaying the next image till this image gets closed cv2.waitKey(8000) #delaying till 5 sec cv2.destroyAllWindows() plot_img(image, image, title1="original1", title2="original1") # image color to gray gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) plot_img(image, gray, title1="original1", title2="gray") cv2.imshow('gray image', gray) cv2.waitKey(8000) cv2.destroyAllWindows() # Noise removal with iterative bilateral filters(which removes the noise while filtering the edges) blur = cv2.bilateralFilter(gray, 11, 90, 90) plot_img(gray, blur, title1="gray", title2="Blur") cv2.imshow("blurred image:", blur) cv2.waitKey(8000) cv2.destroyAllWindows() # blurring the edges of grayscale image edges = cv2.Canny(blur, 30, 200) plot_img(blur, edges, title1="Blur", title2="Edges") cv2.imshow("canny image:", edges) cv2.waitKey(8000) cv2.destroyAllWindows() # Finding the contours based edges cnts, new = cv2.findContours(edges.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) # coping the image as secondary image_copy = image.copy() # Drawing all the contours edges of the original image _ = cv2.drawContours(image_copy, cnts, -1, (255, 0, 255), 2) plot_img(edges, image_copy, title1="Edges", title2="Contours") cv2.imshow("contours image:", image_copy) cv2.waitKey(8000) cv2.destroyAllWindows() print("number of iteration of draw counter has passed: ", len(cnts)) # sort the contours keeping the minimum area as 30 cnts = sorted(cnts, key=cv2.contourArea, reverse=True)[:30] image_reduce_cnts = image.copy() _ = cv2.drawContours(image_reduce_cnts, cnts, -1, (255, 0, 255), 2) plot_img(image_copy, image_reduce_cnts , title1="Contours", title2="Reduced") cv2.imshow("reduced image:" , image_reduce_cnts) cv2.waitKey(8000) cv2.destroyAllWindows() print("number of iteration passed by reducing the edges : ", len(cnts)) plate = None for c in cnts: perimeter = cv2.arcLength(c, True) edges_count = cv2.approxPolyDP(c, 0.02 * perimeter , True) if len(edges_count) == 4 : x, y, w, h = cv2.boundingRect(c) plate = image[y:y + h, x:x + w] break cv2.imwrite("plate.png", plate) plot_img(plate, plate, title1="plate", title2="plate") cv2.imshow("Number Plate Image : ", plate) cv2.waitKey(8000) cv2.destroyAllWindows() pt.pytesseract.tesseract_cmd = r'C:\Users\admin\AppData\Local\Tesseract.exe' no_plate = pt.image_to_string(plate, lang='eng') print("the number plate of car is: ", no_plate) # creating Tk window root = Tk() # setting geometry of tk window root.geometry('500x350+100+200') #title of project root.title('Car Number Plate Detector - (owner file address)') # Back ground colour root.config(bg="dark orange") # Lay out widgets root.grid_columnconfigure(1, weight=1) root.grid_rowconfigure(1, weight=1) inputNumber = StringVar() var = StringVar() input_label = Label(root, text="car plate number", font=("times new roman", 20, "bold"), bg="white", fg="green", background="#09A3BA", foreground="#FFF").place(x=150,y=40) input_entry = Entry(root, textvariable=inputNumber, font=("times new roman", 15), bg="lightgray") input_entry.grid(row=1, columnspan=2) result_button = Button(root, text="Details", command=convert, font=("times new roman", 20, "bold"), bg="cyan") result_button.grid(row=3, column=1) root.mainloop()
[ 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 201, 198, 11748, 269, 85, 17, 201, 198, 11748, 545, 26791, 201, 198, 11748, 12972, 83, 408, 263, 529, 355, 42975, 201, 198, 6738, 256, 74, 3849, 1330, 1635, 201, 198, 6738, 25...
2.485406
1,576
# -*- coding: utf-8 -*- """ Created on Fri May 18 22:15:35 2018 @author: Sumudu Tennakoon References: [1] https://www.ibm.com/watson/developercloud/natural-language-understanding/api/v1/ """ from watson_developer_cloud import NaturalLanguageUnderstandingV1, WatsonException, WatsonApiException from watson_developer_cloud.natural_language_understanding_v1 import Features, EntitiesOptions, KeywordsOptions, RelationsOptions import pandas as pd import numpy as np from timeit import default_timer as timer import multiprocessing import sys ############################################################################### ############################################################################### ############################################################################### # GUI ############################################################################### import tkinter as tk #(https://wiki.python.org/moin/TkInter) from tkinter import filedialog from tkinter import scrolledtext import configparser #(https://docs.python.org/3.4/library/configparser.html) import traceback root = tk.Tk() AppWindow = ApplicationWindow(master=root) AppWindow.master.title('IBM Watson Natural Language Processing') #AppWindow.master.maxsize(1024, 768) AppWindow.mainloop()
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 19480, 1737, 1248, 2534, 25, 1314, 25, 2327, 2864, 198, 198, 31, 9800, 25, 5060, 463, 84, 9034, 461, 2049, 198, 19927, 25, 198, 58, 16, 60, 3...
3.872727
330
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-Drafts-Resources is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Invenio Drafts Resources module to create REST APIs.""" import marshmallow as ma from flask import g from flask_resources import JSONSerializer, ResponseHandler, \ resource_requestctx, response_handler, route, with_content_negotiation from invenio_records_resources.resources import \ RecordResource as RecordResourceBase from invenio_records_resources.resources.records.resource import \ request_data, request_headers, request_read_args, request_search_args, \ request_view_args from invenio_records_resources.resources.records.utils import es_preference from .errors import RedirectException
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 15069, 357, 34, 8, 12131, 327, 28778, 13, 198, 2, 15069, 357, 34, 8, 12131, 30197, 2059, 13, 198, 2, 198, 2, 554, 574, 952, 12, 37741, 82, 12, 33236, ...
3.474308
253
# Copyright 2020 Jacob D. Durrant # # 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. """ This script identifies and enumerates the possible protonation sites of SMILES strings. """ from __future__ import print_function import copy import os import argparse import sys try: # Python2 from StringIO import StringIO except ImportError: # Python3 from io import StringIO def print_header(): """Prints out header information.""" # Always let the user know a help file is available. print("\nFor help, use: python dimorphite_dl.py --help") # And always report citation information. print("\nIf you use Dimorphite-DL in your research, please cite:") print("Ropp PJ, Kaminsky JC, Yablonski S, Durrant JD (2019) Dimorphite-DL: An") print( "open-source program for enumerating the ionization states of drug-like small" ) print("molecules. J Cheminform 11:14. doi:10.1186/s13321-019-0336-9.\n") try: import rdkit from rdkit import Chem from rdkit.Chem import AllChem # Disable the unnecessary RDKit warnings from rdkit import RDLogger RDLogger.DisableLog("rdApp.*") except: msg = "Dimorphite-DL requires RDKit. See https://www.rdkit.org/" print(msg) raise Exception(msg) def main(params=None): """The main definition run when you call the script from the commandline. :param params: The parameters to use. Entirely optional. If absent, defaults to None, in which case argments will be taken from those given at the command line. :param params: dict, optional :return: Returns a list of the SMILES strings return_as_list parameter is True. Otherwise, returns None. """ parser = ArgParseFuncs.get_args() args = vars(parser.parse_args()) if not args["silent"]: print_header() # Add in any parameters in params. if params is not None: for k, v in params.items(): args[k] = v # If being run from the command line, print out all parameters. if __name__ == "__main__": if not args["silent"]: print("\nPARAMETERS:\n") for k in sorted(args.keys()): print(k.rjust(13) + ": " + str(args[k])) print("") if args["test"]: # Run tests. TestFuncs.test() else: # Run protonation if "output_file" in args and args["output_file"] is not None: # An output file was specified, so write to that. with open(args["output_file"], "w") as file: for protonated_smi in Protonate(args): file.write(protonated_smi + "\n") elif "return_as_list" in args and args["return_as_list"] == True: return list(Protonate(args)) else: # No output file specified. Just print it to the screen. for protonated_smi in Protonate(args): print(protonated_smi) def run(**kwargs): """A helpful, importable function for those who want to call Dimorphite-DL from another Python script rather than the command line. Note that this function accepts keyword arguments that match the command-line parameters exactly. If you want to pass and return a list of RDKit Mol objects, import run_with_mol_list() instead. :param **kwargs: For a complete description, run dimorphite_dl.py from the command line with the -h option. :type kwargs: dict """ # Run the main function with the specified arguments. main(kwargs) def run_with_mol_list(mol_lst, **kwargs): """A helpful, importable function for those who want to call Dimorphite-DL from another Python script rather than the command line. Note that this function is for passing Dimorphite-DL a list of RDKit Mol objects, together with command-line parameters. If you want to use only the same parameters that you would use from the command line, import run() instead. :param mol_lst: A list of rdkit.Chem.rdchem.Mol objects. :type mol_lst: list :raises Exception: If the **kwargs includes "smiles", "smiles_file", "output_file", or "test" parameters. :return: A list of properly protonated rdkit.Chem.rdchem.Mol objects. :rtype: list """ # Do a quick check to make sure the user input makes sense. for bad_arg in ["smiles", "smiles_file", "output_file", "test"]: if bad_arg in kwargs: msg = ( "You're using Dimorphite-DL's run_with_mol_list(mol_lst, " + '**kwargs) function, but you also passed the "' + bad_arg + '" argument. Did you mean to use the ' + "run(**kwargs) function instead?" ) UtilFuncs.eprint(msg) raise Exception(msg) # Set the return_as_list flag so main() will return the protonated smiles # as a list. kwargs["return_as_list"] = True # Having reviewed the code, it will be very difficult to rewrite it so # that a list of Mol objects can be used directly. Intead, convert this # list of mols to smiles and pass that. Not efficient, but it will work. protonated_smiles_and_props = [] for m in mol_lst: props = m.GetPropsAsDict() kwargs["smiles"] = Chem.MolToSmiles(m, isomericSmiles=True) protonated_smiles_and_props.extend( [(s.split("\t")[0], props) for s in main(kwargs)] ) # Now convert the list of protonated smiles strings back to RDKit Mol # objects. Also, add back in the properties from the original mol objects. mols = [] for s, props in protonated_smiles_and_props: m = Chem.MolFromSmiles(s) if m: for prop, val in props.items(): if type(val) is int: m.SetIntProp(prop, val) elif type(val) is float: m.SetDoubleProp(prop, val) elif type(val) is bool: m.SetBoolProp(prop, val) else: m.SetProp(prop, str(val)) mols.append(m) else: UtilFuncs.eprint( "WARNING: Could not process molecule with SMILES string " + s + " and properties " + str(props) ) return mols if __name__ == "__main__": main()
[ 2, 15069, 12131, 12806, 360, 13, 11164, 5250, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, ...
2.466334
2,807
from visuanalytics.analytics.control.procedures.step_data import StepData from visuanalytics.analytics.transform.transform import transform
[ 6738, 1490, 7258, 3400, 14094, 13, 38200, 14094, 13, 13716, 13, 1676, 771, 942, 13, 9662, 62, 7890, 1330, 5012, 6601, 198, 6738, 1490, 7258, 3400, 14094, 13, 38200, 14094, 13, 35636, 13, 35636, 1330, 6121, 628 ]
3.810811
37
_base_ = [ '../_base_/models/resnet50.py', '../_base_/datasets/cancer_bs32_pil_resize.py', '../_base_/schedules/imagenet_bs256_coslr.py', '../_base_/default_runtime.py' ] model = dict( head=dict( num_classes=2, topk=(1,)) ) data = dict( train=dict( data_prefix='/data3/zzhang/tmp/classification/train'), val=dict( data_prefix='/data3/zzhang/tmp/classification/test'), test=dict( data_prefix='/data3/zzhang/tmp/classification/test')) optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) load_from = 'https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_batch256_imagenet_20200708-cfb998bf.pth'
[ 62, 8692, 62, 796, 685, 198, 220, 220, 220, 705, 40720, 62, 8692, 62, 14, 27530, 14, 411, 3262, 1120, 13, 9078, 3256, 705, 40720, 62, 8692, 62, 14, 19608, 292, 1039, 14, 48870, 62, 1443, 2624, 62, 79, 346, 62, 411, 1096, 13, 907...
2.152174
322
import logging import traceback from kubernetes.client.rest import ApiException from django.conf import settings import auditor from constants.jobs import JobLifeCycle from db.models.build_jobs import BuildJob from docker_images.image_info import get_tagged_image from event_manager.events.build_job import BUILD_JOB_STARTED, BUILD_JOB_STARTED_TRIGGERED from libs.paths.exceptions import VolumeNotFoundError from scheduler.spawners.dockerizer_spawner import DockerizerSpawner from scheduler.spawners.utils import get_job_definition _logger = logging.getLogger('polyaxon.scheduler.dockerizer') def create_build_job(user, project, config, code_reference): """Get or Create a build job based on the params. If a build job already exists, then we check if the build has already an image created. If the image does not exists, and the job is already done we force create a new job. Returns: tuple: (build_job, image_exists[bool], build_status[bool]) """ build_job, rebuild = BuildJob.create( user=user, project=project, config=config, code_reference=code_reference) if build_job.succeeded and not rebuild: # Check if image was built in less than an 6 hours return build_job, True, False if check_image(build_job=build_job): # Check if image exists already return build_job, True, False if build_job.is_done: build_job, _ = BuildJob.create( user=user, project=project, config=config, code_reference=code_reference, nocache=True) if not build_job.is_running: # We need to build the image first auditor.record(event_type=BUILD_JOB_STARTED_TRIGGERED, instance=build_job, actor_id=user.id, actor_name=user.username) build_status = start_dockerizer(build_job=build_job) else: build_status = True return build_job, False, build_status
[ 11748, 18931, 198, 11748, 12854, 1891, 198, 198, 6738, 479, 18478, 3262, 274, 13, 16366, 13, 2118, 1330, 5949, 72, 16922, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 198, 11748, 30625, 198, 198, 6738, 38491, 13, 43863, 133...
2.539424
799
#coding=utf8 from uliweb.utils.pyini import * def test_sorteddict(): """ >>> d = SortedDict() >>> d <SortedDict {}> >>> d.name = 'limodou' >>> d['class'] = 'py' >>> d <SortedDict {'class':'py', 'name':'limodou'}> >>> d.keys() ['name', 'class'] >>> d.values() ['limodou', 'py'] >>> d['class'] 'py' >>> d.name 'limodou' >>> d.get('name', 'default') 'limodou' >>> d.get('other', 'default') 'default' >>> 'name' in d True >>> 'other' in d False >>> print (d.other) None >>> try: ... d['other'] ... except Exception as e: ... print (e) 'other' >>> del d['class'] >>> del d['name'] >>> d <SortedDict {}> >>> d['name'] = 'limodou' >>> d.pop('other', 'default') 'default' >>> d.pop('name') 'limodou' >>> d <SortedDict {}> >>> d.update({'class':'py', 'attribute':'border'}) >>> d <SortedDict {'attribute':'border', 'class':'py'}> """ def test_section(): """ >>> s = Section('default', "#comment") >>> print (s) #comment [default] <BLANKLINE> >>> s.name = 'limodou' >>> s.add_comment('name', '#name') >>> s.add_comment(comments='#change') >>> print (s) #change [default] #name name = 'limodou' <BLANKLINE> >>> del s.name >>> print (s) #change [default] <BLANKLINE> """ def test_ini1(): """ >>> x = Ini() >>> s = x.add('default') >>> print (x) #coding=utf-8 [default] <BLANKLINE> >>> s['abc'] = 'name' >>> print (x) #coding=utf-8 [default] abc = 'name' <BLANKLINE> """ def test_ini2(): """ >>> x = Ini() >>> x['default'] = Section('default', "#comment") >>> x.default.name = 'limodou' >>> x.default['class'] = 'py' >>> x.default.list = ['abc'] >>> print (x) #coding=utf-8 #comment [default] name = 'limodou' class = 'py' list = ['abc'] <BLANKLINE> >>> x.default.list = ['cde'] #for mutable object will merge the data, including dict type >>> print (x.default.list) ['abc', 'cde'] >>> x.default.d = {'a':'a'} >>> x.default.d = {'b':'b'} >>> print (x.default.d) {'a': 'a', 'b': 'b'} """ def test_gettext(): """ >>> from uliweb.i18n import gettext_lazy as _ >>> x = Ini(env={'_':_}) >>> x['default'] = Section('default') >>> x.default.option = _('Hello') >>> x.keys() ['_', 'gettext_lazy', 'set', 'default'] """ def test_replace(): """ >>> x = Ini() >>> x['default'] = Section('default') >>> x.default.option = ['a'] >>> x.default.option ['a'] >>> x.default.option = ['b'] >>> x.default.option ['a', 'b'] >>> x.default.add('option', ['c'], replace=True) >>> x.default.option ['c'] >>> print (x.default) [default] option <= ['c'] <BLANKLINE> """ def test_set_var(): """ >>> x = Ini() >>> x.set_var('default/key', 'name') True >>> print (x) #coding=utf-8 [default] key = 'name' <BLANKLINE> >>> x.set_var('default/key/name', 'hello') True >>> print (x) #coding=utf-8 [default] key = 'name' key/name = 'hello' <BLANKLINE> >>> x.get_var('default/key') 'name' >>> x.get_var('default/no') >>> x.get_var('defaut/no', 'no') 'no' >>> x.del_var('default/key') True >>> print (x) #coding=utf-8 [default] key/name = 'hello' <BLANKLINE> >>> x.get_var('default/key/name') 'hello' >>> x.get_var('default') <Section {'key/name':'hello'}> """ def test_update(): """ >>> x = Ini() >>> x.set_var('default/key', 'name') True >>> d = {'default/key':'limodou', 'default/b':123} >>> x.update(d) >>> print (x) #coding=utf-8 [default] key = 'limodou' b = 123 <BLANKLINE> """ def test_uni_print(): """ >>> a = () >>> uni_prt(a, 'utf-8') '()' >>> a = (1,2) >>> uni_prt(a) '(1, 2)' """ def test_triple_string(): """ >>> from io import StringIO >>> buf = StringIO(\"\"\" ... #coding=utf8 ... [DEFAULT] ... a = '''hello ... ... ''' ... \"\"\") >>> x = Ini() >>> x.read(buf) >>> print (repr(x.DEFAULT.a)) 'hello\\n\\u4e2d\\u6587\\n' """ def test_save(): """ >>> from uliweb.i18n import gettext_lazy as _, i18n_ini_convertor >>> from io import StringIO >>> x = Ini(env={'_':_}, convertors=i18n_ini_convertor) >>> buf = StringIO(\"\"\" ... [default] ... option = _('English') ... str = 'str' ... str1 = "str" ... float = 1.2 ... int = 1 ... list = [1, 'str', 0.12] ... dict = {'a':'b', 1:2} ... s = 'English' ... [other] ... option = 'default' ... options1 = '{{option}} xxx' ... options2 = '{{default.int}}' ... options3 = option ... options4 = '-- {{default.option}} --' ... options5 = '-- {{default.s}} --' ... options6 = 'English {{default.s}} --' ... options7 = default.str + default.str1 ... \"\"\") >>> x.read(buf) >>> print (x) #coding=UTF-8 <BLANKLINE> [default] option = _('English') str = 'str' str1 = 'str' float = 1.2 int = 1 list = [1, 'str', 0.12] dict = {'a': 'b', 1: 2} s = 'English' [other] option = 'default' options1 = 'default xxx' options2 = '1' options3 = 'default' options4 = '-- English --' options5 = '-- English --' options6 = 'English English --' options7 = 'strstr' <BLANKLINE> """ def test_merge_data(): """ >>> from uliweb.utils.pyini import merge_data >>> a = [[1,2,3], [2,3,4], [4,5]] >>> b = [{'a':[1,2], 'b':{'a':[1,2]}}, {'a':[2,3], 'b':{'a':['b'], 'b':2}}] >>> c = [set([1,2,3]), set([2,4])] >>> print (merge_data(a)) [1, 2, 3, 4, 5] >>> print (merge_data(b)) {'a': [1, 2, 3], 'b': {'a': [1, 2, 'b'], 'b': 2}} >>> print (merge_data(c)) {1, 2, 3, 4} >>> print (merge_data([2])) 2 """ def test_lazy(): """ >>> from uliweb.i18n import gettext_lazy as _, i18n_ini_convertor >>> from io import StringIO >>> x = Ini(env={'_':_}, convertors=i18n_ini_convertor, lazy=True) >>> buf = StringIO(\"\"\" ... [default] ... option = _('English') ... str = 'str' ... str1 = "str" ... float = 1.2 ... int = 1 ... list = [1, 'str', 0.12] ... dict = {'a':'b', 1:2} ... s = 'English' ... [other] ... option = 'default' ... options1 = '{{option}} xxx' ... options2 = '{{default.int}}' ... options3 = option ... options4 = '-- {{default.option}} --' ... options5 = '-- {{default.s}} --' ... options6 = 'English {{default.s}} --' ... options7 = default.str + default.str1 ... \"\"\") >>> x.read(buf) >>> x.freeze() >>> print (x) #coding=UTF-8 <BLANKLINE> [default] option = _('English') str = 'str' str1 = 'str' float = 1.2 int = 1 list = [1, 'str', 0.12] dict = {'a': 'b', 1: 2} s = 'English' [other] option = 'default' options1 = 'default xxx' options2 = '1' options3 = 'default' options4 = '-- English --' options5 = '-- English --' options6 = 'English English --' options7 = 'strstr' <BLANKLINE> """ def test_multiple_read(): """ >>> from uliweb.i18n import gettext_lazy as _, i18n_ini_convertor >>> from io import StringIO >>> x = Ini(env={'_':_}, convertors=i18n_ini_convertor, lazy=True) >>> buf = StringIO(\"\"\" ... [default] ... option = 'abc' ... [other] ... option = default.option ... option1 = '{{option}} xxx' ... option2 = '{{default.option}}' ... option3 = '{{other.option}}' ... \"\"\") >>> x.read(buf) >>> buf1 = StringIO(\"\"\" ... [default] ... option = 'hello' ... \"\"\") >>> x.read(buf1) >>> x.freeze() >>> print (x) #coding=UTF-8 <BLANKLINE> [default] option = 'hello' [other] option = 'hello' option1 = 'hello xxx' option2 = 'hello' option3 = 'hello' <BLANKLINE> """ def test_chinese(): """ >>> from uliweb.i18n import gettext_lazy as _, i18n_ini_convertor >>> from io import StringIO >>> x = Ini(env={'_':_}, convertors=i18n_ini_convertor) >>> buf = StringIO(\"\"\"#coding=utf-8 ... [default] ... option = '' ... option2 = _('') ... option3 = '{{option}}' ... [other] ... x = ' {{default.option}}' ... x1 = ' {{default.option}}' ... x2 = 'xbd {{default.option}}' ... \"\"\") >>> x.read(buf) >>> print (x) #coding=utf-8 [default] option = '' option2 = _('') option3 = '' [other] x = ' ' x1 = ' ' x2 = 'xbd ' <BLANKLINE> >>> print (repr(x.other.x1)) ' ' >>> x.keys() ['_', 'gettext_lazy', 'set', 'default', 'other'] """ def test_set(): """ >>> from io import StringIO >>> x = Ini() >>> buf = StringIO(\"\"\"#coding=utf-8 ... [default] ... set1 = {1,2,3} ... set2 = set([1,2,3]) ... \"\"\") >>> x.read(buf) >>> print (x) #coding=utf-8 [default] set1 = {1, 2, 3} set2 = {1, 2, 3} <BLANKLINE> >>> buf2 = StringIO(\"\"\"#coding=utf-8 ... [default] ... set1 = {5,3} ... \"\"\") >>> x.read(buf2) >>> print (x.default.set1) {1, 2, 3, 5} """
[ 2, 66, 7656, 28, 40477, 23, 198, 6738, 334, 4528, 12384, 13, 26791, 13, 9078, 5362, 1330, 1635, 198, 198, 4299, 1332, 62, 30619, 6048, 713, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 13163, 288, 796, 311, 9741, 35, 713, ...
2.061475
4,636
import threading from queue import Queue from blessed import Terminal FPS = 60
[ 11748, 4704, 278, 198, 6738, 16834, 1330, 4670, 518, 198, 198, 6738, 18259, 1330, 24523, 198, 198, 37, 3705, 796, 3126, 628 ]
3.727273
22
import logging import threading import flask from .requests import Request __all__ = ['Skill']
[ 11748, 18931, 198, 11748, 4704, 278, 198, 198, 11748, 42903, 198, 198, 6738, 764, 8897, 3558, 1330, 19390, 628, 198, 834, 439, 834, 796, 37250, 35040, 20520, 628 ]
3.571429
28
import logging from main.fileextractors.compressedfile import get_compressed_file from main.utilities.fileutils import dir_path from main.utilities.subtitlesadjuster import ArchiveAdjuster
[ 11748, 18931, 198, 6738, 1388, 13, 7753, 2302, 974, 669, 13, 5589, 2790, 7753, 1330, 651, 62, 5589, 2790, 62, 7753, 198, 6738, 1388, 13, 315, 2410, 13, 7753, 26791, 1330, 26672, 62, 6978, 198, 6738, 1388, 13, 315, 2410, 13, 7266, 83...
3.72549
51
import curses from get_json import get_json
[ 11748, 43878, 198, 6738, 651, 62, 17752, 1330, 651, 62, 17752, 628 ]
3.75
12
import sys, os, seaborn as sns, rasterio, pandas as pd import numpy as np import matplotlib.pyplot as plt sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from config.definitions import ROOT_DIR, ancillary_path, city,year attr_value ="totalpop" gtP = ROOT_DIR + "/Evaluation/{0}_groundTruth/{2}_{0}_{1}.tif".format(city,attr_value,year) srcGT= rasterio.open(gtP) popGT = srcGT.read(1) print(popGT.min(),popGT.max(), popGT.mean()) #prP = ROOT_DIR + "/Evaluation/{0}/apcatbr/div_{0}_dissever01WIESMN_500_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value) evalFiles = [#gtP, #ROOT_DIR + "/Evaluation/{0}/aprf/dissever00/{0}_dissever00WIESMN_2018_ams_Dasy_aprf_p[1]_12AIL12_1IL_it10_{1}.tif".format(city,attr_value), #ROOT_DIR + "/Evaluation/{0}/aprf/dissever01/{0}_dissever01WIESMN_100_2018_ams_DasyA_aprf_p[1]_12AIL12_13IL_it10_{1}.tif".format(city,attr_value), #ROOT_DIR + "/Evaluation/{0}/apcatbr/{0}_dissever01WIESMN_100_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value), #ROOT_DIR + "/Evaluation/{0}/apcatbr/{0}_dissever01WIESMN_250_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/apcatbr/{0}_dissever01WIESMN_500_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value), ] evalFilesMAEbp = [ROOT_DIR + "/Evaluation/{0}/Pycno/mae_{0}_{2}_{0}_{1}_pycno.tif".format(city,attr_value,year), ROOT_DIR + "/Evaluation/{0}/Dasy/mae_{0}_{2}_{0}_{1}_dasyWIESMN.tif".format(city,attr_value,year), ROOT_DIR + "/Evaluation/{0}/aprf/dissever00/mae_{0}_dissever00WIESMN_2018_ams_Dasy_aprf_p[1]_12AIL12_1IL_it10_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/aprf/dissever01/mae_{0}_dissever01WIESMN_100_2018_ams_DasyA_aprf_p[1]_12AIL12_13IL_it10_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/apcatbr/mae_{0}_dissever01WIESMN_100_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/apcatbr/mae_{0}_dissever01WIESMN_250_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/apcatbr/mae_{0}_dissever01WIESMN_500_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/apcatbr/mae_{0}_dissever01WIESMN_250_2018_ams_DasyA_apcatbr_p[1]_3AIL5_12IL_it10_ag_{1}.tif".format(city,attr_value)] evalFilesPEbp = [ROOT_DIR + "/Evaluation/{0}/Pycno/div_{0}_{2}_{0}_{1}_pycno.tif".format(city,attr_value,year), ROOT_DIR + "/Evaluation/{0}/Dasy/div_{0}_{2}_{0}_{1}_dasyWIESMN.tif".format(city,attr_value,year), ROOT_DIR + "/Evaluation/{0}/aprf/dissever00/div_{0}_dissever00WIESMN_2018_ams_Dasy_aprf_p[1]_12AIL12_1IL_it10_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/aprf/dissever01/div_{0}_dissever01WIESMN_100_2018_ams_DasyA_aprf_p[1]_12AIL12_13IL_it10_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/apcatbr/div_{0}_dissever01WIESMN_100_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/apcatbr/div_{0}_dissever01WIESMN_250_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value), ROOT_DIR + "/Evaluation/{0}/apcatbr/div_{0}_dissever01WIESMN_500_2018_ams_DasyA_apcatbr_p[1]_12AIL12_12IL_it10_ag_{1}.tif".format(city,attr_value)] for i in evalFiles: scatterplot(i)
[ 11748, 25064, 11, 28686, 11, 384, 397, 1211, 355, 3013, 82, 11, 374, 1603, 952, 11, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 17597, 13, 6978, 13...
1.877246
2,004
import abc from codepack.service.service import Service
[ 11748, 450, 66, 198, 6738, 14873, 538, 441, 13, 15271, 13, 15271, 1330, 4809, 628 ]
3.8
15
import numpy as np import pytest import nengo from nengo.builder import Builder from nengo.builder.operator import Reset, Copy from nengo.builder.signal import Signal from nengo.dists import UniformHypersphere from nengo.exceptions import ValidationError from nengo.learning_rules import LearningRuleTypeParam, PES, BCM, Oja, Voja from nengo.processes import WhiteSignal from nengo.synapses import Alpha, Lowpass def test_pes_transform(Simulator, seed, allclose): """Test behaviour of PES when function and transform both defined.""" n = 200 # error must be with respect to transformed vector (conn.size_out) T = np.asarray([[0.5], [-0.5]]) # transform to output m = nengo.Network(seed=seed) with m: u = nengo.Node(output=[1]) a = nengo.Ensemble(n, dimensions=1) b = nengo.Node(size_in=2) e = nengo.Node(size_in=1) nengo.Connection(u, a) learned_conn = nengo.Connection( a, b, function=lambda x: [0], transform=T, learning_rule_type=nengo.PES(learning_rate=1e-3), ) assert T.shape[0] == learned_conn.size_out assert T.shape[1] == learned_conn.size_mid nengo.Connection(b[0], e, synapse=None) nengo.Connection(nengo.Node(output=-1), e) nengo.Connection(e, learned_conn.learning_rule, transform=T, synapse=None) p_b = nengo.Probe(b, synapse=0.05) with Simulator(m) as sim: sim.run(1.0) tend = sim.trange() > 0.7 assert allclose(sim.data[p_b][tend], [1, -1], atol=1e-2) def test_pes_multidim_error(Simulator, seed): """Test that PES works on error connections mapping from N to 1 dims. Note that the transform is applied before the learning rule, so the error signal should be 1-dimensional. """ with nengo.Network(seed=seed) as net: err = nengo.Node(output=[0]) ens1 = nengo.Ensemble(20, 3) ens2 = nengo.Ensemble(10, 1) # Case 1: ens -> ens, weights=False conn = nengo.Connection( ens1, ens2, transform=np.ones((1, 3)), solver=nengo.solvers.LstsqL2(weights=False), learning_rule_type={"pes": nengo.PES()}, ) nengo.Connection(err, conn.learning_rule["pes"]) # Case 2: ens -> ens, weights=True conn = nengo.Connection( ens1, ens2, transform=np.ones((1, 3)), solver=nengo.solvers.LstsqL2(weights=True), learning_rule_type={"pes": nengo.PES()}, ) nengo.Connection(err, conn.learning_rule["pes"]) # Case 3: neurons -> ens conn = nengo.Connection( ens1.neurons, ens2, transform=np.ones((1, ens1.n_neurons)), learning_rule_type={"pes": nengo.PES()}, ) nengo.Connection(err, conn.learning_rule["pes"]) with Simulator(net) as sim: sim.run(0.01) def test_pes_cycle(Simulator): """Test that PES works when connection output feeds back into error.""" with nengo.Network() as net: a = nengo.Ensemble(10, 1) b = nengo.Node(size_in=1) c = nengo.Connection(a, b, synapse=None, learning_rule_type=nengo.PES()) nengo.Connection(b, c.learning_rule, synapse=None) with Simulator(net): # just checking that this builds without error pass def test_learningruletypeparam(): """LearningRuleTypeParam must be one or many learning rules.""" inst = Test() assert inst.lrp is None inst.lrp = Oja() assert isinstance(inst.lrp, Oja) inst.lrp = [Oja(), Oja()] for lr in inst.lrp: assert isinstance(lr, Oja) # Non-LR no good with pytest.raises(ValueError): inst.lrp = "a" # All elements in list must be LR with pytest.raises(ValueError): inst.lrp = [Oja(), "a", Oja()] def test_learningrule_attr(seed): """Test learning_rule attribute on Connection""" with nengo.Network(seed=seed): a, b, e = [nengo.Ensemble(10, 2) for i in range(3)] T = np.ones((10, 10)) r1 = PES() c1 = nengo.Connection(a.neurons, b.neurons, learning_rule_type=r1) check_rule(c1.learning_rule, c1, r1) r2 = [PES(), BCM()] c2 = nengo.Connection(a.neurons, b.neurons, learning_rule_type=r2, transform=T) assert isinstance(c2.learning_rule, list) for rule, rule_type in zip(c2.learning_rule, r2): check_rule(rule, c2, rule_type) r3 = dict(oja=Oja(), bcm=BCM()) c3 = nengo.Connection(a.neurons, b.neurons, learning_rule_type=r3, transform=T) assert isinstance(c3.learning_rule, dict) assert set(c3.learning_rule) == set(r3) # assert same keys for key in r3: check_rule(c3.learning_rule[key], c3, r3[key]) def test_voja_encoders(Simulator, nl_nodirect, rng, seed, allclose): """Tests that voja changes active encoders to the input.""" n = 200 learned_vector = np.asarray([0.3, -0.4, 0.6]) learned_vector /= np.linalg.norm(learned_vector) n_change = n // 2 # modify first half of the encoders # Set the first half to always fire with random encoders, and the # remainder to never fire due to their encoder's dot product with the input intercepts = np.asarray([-1] * n_change + [0.99] * (n - n_change)) rand_encoders = UniformHypersphere(surface=True).sample( n_change, len(learned_vector), rng=rng ) encoders = np.append(rand_encoders, [-learned_vector] * (n - n_change), axis=0) m = nengo.Network(seed=seed) with m: m.config[nengo.Ensemble].neuron_type = nl_nodirect() u = nengo.Node(output=learned_vector) x = nengo.Ensemble( n, dimensions=len(learned_vector), intercepts=intercepts, encoders=encoders, max_rates=nengo.dists.Uniform(300.0, 400.0), radius=2.0, ) # to test encoder scaling conn = nengo.Connection( u, x, synapse=None, learning_rule_type=Voja(learning_rate=1e-1) ) p_enc = nengo.Probe(conn.learning_rule, "scaled_encoders") p_enc_ens = nengo.Probe(x, "scaled_encoders") with Simulator(m) as sim: sim.run(1.0) t = sim.trange() tend = t > 0.5 # Voja's rule relies on knowing exactly how the encoders were scaled # during the build process, because it modifies the scaled_encoders signal # proportional to this factor. Therefore, we should check that its # assumption actually holds. encoder_scale = (sim.data[x].gain / x.radius)[:, np.newaxis] assert allclose(sim.data[x].encoders, sim.data[x].scaled_encoders / encoder_scale) # Check that the last half kept the same encoders throughout the simulation assert allclose(sim.data[p_enc][0, n_change:], sim.data[p_enc][:, n_change:]) # and that they are also equal to their originally assigned value assert allclose( sim.data[p_enc][0, n_change:] / encoder_scale[n_change:], -learned_vector ) # Check that the first half converged to the input assert allclose( sim.data[p_enc][tend, :n_change] / encoder_scale[:n_change], learned_vector, atol=0.01, ) # Check that encoders probed from ensemble equal encoders probed from Voja assert allclose(sim.data[p_enc], sim.data[p_enc_ens]) def test_voja_modulate(Simulator, nl_nodirect, seed, allclose): """Tests that voja's rule can be modulated on/off.""" n = 200 learned_vector = np.asarray([0.5]) def control_signal(t): """Modulates the learning on/off.""" return 0 if t < 0.5 else -1 m = nengo.Network(seed=seed) with m: m.config[nengo.Ensemble].neuron_type = nl_nodirect() control = nengo.Node(output=control_signal) u = nengo.Node(output=learned_vector) x = nengo.Ensemble(n, dimensions=len(learned_vector)) conn = nengo.Connection( u, x, synapse=None, learning_rule_type=Voja(post_synapse=None) ) nengo.Connection(control, conn.learning_rule, synapse=None) p_enc = nengo.Probe(conn.learning_rule, "scaled_encoders") with Simulator(m) as sim: sim.run(1.0) tend = sim.trange() > 0.5 # Check that encoders stop changing after 0.5s assert allclose(sim.data[p_enc][tend], sim.data[p_enc][-1]) # Check that encoders changed during first 0.5s i = np.where(tend)[0][0] # first time point after changeover assert not allclose(sim.data[p_enc][0], sim.data[p_enc][i], record_rmse=False) def test_frozen(): """Test attributes inherited from FrozenObject""" a = PES(learning_rate=2e-3, pre_synapse=4e-3) b = PES(learning_rate=2e-3, pre_synapse=4e-3) c = PES(learning_rate=2e-3, pre_synapse=5e-3) assert hash(a) == hash(a) assert hash(b) == hash(b) assert hash(c) == hash(c) assert a == b assert hash(a) == hash(b) assert a != c assert hash(a) != hash(c) # not guaranteed, but highly likely assert b != c assert hash(b) != hash(c) # not guaranteed, but highly likely with pytest.raises((ValueError, RuntimeError)): a.learning_rate = 1e-1 def test_pes_direct_errors(): """Test that applying a learning rule to a direct ensemble errors.""" with nengo.Network(): pre = nengo.Ensemble(10, 1, neuron_type=nengo.Direct()) post = nengo.Ensemble(10, 1) conn = nengo.Connection(pre, post) with pytest.raises(ValidationError): conn.learning_rule_type = nengo.PES() def test_custom_type(Simulator, allclose): """Test with custom learning rule type. A custom learning type may have ``size_in`` not equal to 0, 1, or None. """ with nengo.Network() as net: a = nengo.Ensemble(10, 1) b = nengo.Ensemble(10, 1) conn = nengo.Connection( a.neurons, b, transform=np.zeros((1, 10)), learning_rule_type=TestRule() ) err = nengo.Node([1, 2, 3]) nengo.Connection(err, conn.learning_rule, synapse=None) p = nengo.Probe(conn, "weights") with Simulator(net) as sim: sim.run(sim.dt * 5) assert allclose(sim.data[p][:, 0, :3], np.outer(np.arange(1, 6), np.arange(1, 4))) assert allclose(sim.data[p][:, :, 3:], 0)
[ 11748, 299, 32152, 355, 45941, 198, 11748, 12972, 9288, 198, 198, 11748, 299, 1516, 78, 198, 6738, 299, 1516, 78, 13, 38272, 1330, 35869, 198, 6738, 299, 1516, 78, 13, 38272, 13, 46616, 1330, 30027, 11, 17393, 198, 6738, 299, 1516, 78...
2.221771
4,676
# coding: utf-8 """ joplin-web """ from django.conf import settings from django.http.response import JsonResponse from django.urls import reverse from joplin_api import JoplinApiSync from joplin_web.utils import nb_notes_by_tag, nb_notes_by_folder import logging from rich import console console = console.Console() logger = logging.getLogger("joplin_web.app") joplin = JoplinApiSync(token=settings.JOPLIN_WEBCLIPPER_TOKEN) def get_folders(request): """ all the folders :param request :return: json """ res = joplin.get_folders() json_data = sorted(res.json(), key=lambda k: k['title']) data = nb_notes_by_folder(json_data) logger.debug(data) return JsonResponse(data, safe=False)
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 37811, 198, 220, 220, 474, 404, 2815, 12, 12384, 198, 37811, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 4023, 13, 26209, 1330, 449, 1559, 31077, 198, 6738, 42625, ...
2.612903
279
import numpy as np from django.core.management.base import BaseCommand from oscar.core.loading import get_classes StatsSpe, StatsItem, Test, Speciality, Item, Conference = get_classes( 'confs.models', ( "StatsSpe", "StatsItem", "Test", "Speciality", "Item", "Conference" ) )
[ 11748, 299, 32152, 355, 45941, 198, 198, 6738, 42625, 14208, 13, 7295, 13, 27604, 13, 8692, 1330, 7308, 21575, 198, 6738, 267, 13034, 13, 7295, 13, 25138, 1330, 651, 62, 37724, 628, 198, 29668, 5248, 11, 20595, 7449, 11, 6208, 11, 609...
2.847619
105
import torch import torch.nn as nn import torch.nn.functional as F from math import sqrt as sqrt import collections import numpy as np import itertools from ssd_project.utils.utils import * from ssd_project.utils.global_variables import * device = DEVICE
[ 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 198, 6738, 10688, 1330, 19862, 17034, 355, 19862, 17034, 198, 11748, 17268, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 340, ...
3.368421
76
import trio from kivy.config import Config Config.set('graphics', 'width', '1600') Config.set('graphics', 'height', '900') Config.set('modules', 'touchring', '') for items in Config.items('input'): Config.remove_option('input', items[0]) from glitter2.main import Glitter2App from kivy.tests.async_common import UnitKivyApp __all__ = ('Glitter2TestApp', 'touch_widget')
[ 11748, 19886, 198, 198, 6738, 479, 452, 88, 13, 11250, 1330, 17056, 198, 16934, 13, 2617, 10786, 70, 11549, 3256, 705, 10394, 3256, 705, 36150, 11537, 198, 16934, 13, 2617, 10786, 70, 11549, 3256, 705, 17015, 3256, 705, 12865, 11537, 19...
2.930769
130
from aiohttp import web from aiohttp import WSMsgType from Settings import log
[ 6738, 257, 952, 4023, 1330, 3992, 198, 6738, 257, 952, 4023, 1330, 25290, 50108, 6030, 198, 198, 6738, 16163, 1330, 2604, 628 ]
3.681818
22
import json import os if __name__ == "__main__": qald(r"C:\Users\Gregor\Documents\Programming\square-skill-selector\data\kbqa\qald", r"C:\Users\Gregor\Documents\Programming\square-skill-selector\data\kbqa") websqp(r"C:\Users\Gregor\Documents\Programming\square-skill-selector\data\kbqa\WebQSP\data", r"C:\Users\Gregor\Documents\Programming\square-skill-selector\data\kbqa")
[ 11748, 33918, 198, 11748, 28686, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 10662, 1940, 7, 81, 1, 34, 7479, 14490, 59, 25025, 273, 59, 38354, 59, 15167, 2229, 59, 23415, 12, 42401, 12, 19...
2.641379
145
import requests
[ 11748, 7007, 628, 198 ]
4.5
4
import pandas as pd import numpy as np def missing_dict(df): ''' Function to build a dictionary of indicators of missing information per feature INPUT: df: pandas dataframe with features, description, and values that mean "unknown" OUPUT: missing_dict: dictionary of values for "unkwon" per feature ''' unknown_values = [] for val in df.Value: ## evaluate whether missing 'value' is an integer (one digit) if isinstance(val, int): unknown_values.append([val]) ## evaluate whether attribute has more than one value (a string object in the dataframe) elif isinstance(val, str): split_list = val.split(',') int_list = [int(x) for x in split_list] unknown_values.append(int_list) unknown_dict = {} for attr, value_list in zip(df.Attribute, unknown_values): unknown_dict[attr] = value_list unknown_dict['ALTERSKATEGORIE_FEIN'] = [0] unknown_dict['GEBURTSJAHR'] = [0] return unknown_dict def find_cat_cols(df): ''' Function to find the names of categorical columns INPUT df: pandas dataframe OUTPUT cat_cols: list of names of columns with categorical values ''' cat_cols = list(df.select_dtypes(['object']).columns) return cat_cols def find_binary_cols(df): ''' Function to find the names numerical columns with binary (1/0) values INPUT df: pandas dataframe OUTPUT bin_cols: list of names of columns with binary values ''' bin_cols = [] for col in df.select_dtypes(['float64', 'int64']).columns: n_unique = df[col].dropna().nunique() if n_unique == 2: bin_cols.append(col) return bin_cols def clean_data(df, drop_rows = [], drop_cols = []): ''' Function to clean Arvato's datasets. It mainly changes data format for certain columns, and drops columns (rows) which exceed a given threshold of missing values. INPUT df: pandas dataframe (from Arvato's ) drop_rows: list of row indices to drop drop_cols: list of col names to drop OUTPUT clean_df: pandas dataframee with cleaned data ''' if len(drop_cols) > 0: clean_df = df.drop(drop_cols, axis = 1) if len(drop_rows) > 0: clean_df = clean_df.loc[~clean_df.index.isin(drop_rows)] ## Cast CAMEO_DEUG_2015 to int clean_df['CAMEO_DEUG_2015'] = clean_df['CAMEO_DEUG_2015'].replace('X',np.nan) clean_df['CAMEO_DEUG_2015'] = clean_df['CAMEO_DEUG_2015'].astype('float') ## Transform EINGEFUEGT_AM to date format (only year part) clean_df['EINGEFUEGT_AM'] = pd.to_datetime(clean_df['EINGEFUEGT_AM'], format = '%Y-%m-%d').dt.year ### Label-encode OST_WEST_KZ clean_df['OST_WEST_KZ'] = clean_df['OST_WEST_KZ'].replace('W',1).replace('O', 0) clean_df['OST_WEST_KZ'] = pd.to_numeric(clean_df['OST_WEST_KZ'], errors = 'coerce') return clean_df def scree_plot(pca): """ Function to make a scree plot out of a PCA object INPUT pca: PCA fitted object OUTPUT scree plot """ import matplotlib.pyplot as plt nc = len(pca.explained_variance_ratio_) ind = np.arange(nc) vals = pca.explained_variance_ratio_ cumvals = np.cumsum(vals) fig = plt.figure(figsize=(12,6)) ax = plt.subplot() ax.bar(ind, vals) ax.plot(ind, cumvals) plt.xlabel('No. of Components') plt.ylabel('Cum. explained variance') plt.title('Scree plot PCA') def get_cluster_centers(cluster_pipeline, num_cols, col_names): """ Function inverse transform pca components. INPUT: cluster: object of cluster_pipeline num_cols: list of numerical attributes which were rescaled col_names: names of all columns after Column Transformer operation OUTPUT: df (DataFrame): DataFrame of cluster_centers with their attributes values """ pca_components = cluster_pipeline.named_steps['reduction'] kmeans = cluster_pipeline.named_steps['clustering'] transformer = cluster_pipeline.named_steps['transform'] centers = pca_components.inverse_transform(kmeans.cluster_centers_) df = pd.DataFrame(centers, columns = col_names) num_scale = transformer.named_transformers_['num'].named_steps['num_scale'] df[num_cols] = num_scale.inverse_transform(df[num_cols]) return df def plot_learning_curve(estimator, title, X, y, axes=None, ylim=None, cv=None, n_jobs=None, train_sizes=np.linspace(.1, 1.0, 5), verbose=0): """ Generate 3 plots: the test and training learning curve, the training samples vs fit times curve, the fit times vs score curve. Source: [https://scikit-learn.org/stable/auto_examples/model_selection/plot_learning_curve.html] Parameters ---------- estimator : estimator instance An estimator instance implementing `fit` and `predict` methods which will be cloned for each validation. title : str Title for the chart. X : array-like of shape (n_samples, n_features) Training vector, where ``n_samples`` is the number of samples and ``n_features`` is the number of features. y : array-like of shape (n_samples) or (n_samples, n_features) Target relative to ``X`` for classification or regression; None for unsupervised learning. axes : array-like of shape (3,), default=None Axes to use for plotting the curves. ylim : tuple of shape (2,), default=None Defines minimum and maximum y-values plotted, e.g. (ymin, ymax). cv : int, cross-validation generator or an iterable, default=None Determines the cross-validation splitting strategy. Possible inputs for cv are: - None, to use the default 5-fold cross-validation, - integer, to specify the number of folds. - :term:`CV splitter`, - An iterable yielding (train, test) splits as arrays of indices. For integer/None inputs, if ``y`` is binary or multiclass, :class:`StratifiedKFold` used. If the estimator is not a classifier or if ``y`` is neither binary nor multiclass, :class:`KFold` is used. Refer :ref:`User Guide <cross_validation>` for the various cross-validators that can be used here. n_jobs : int or None, default=None Number of jobs to run in parallel. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary <n_jobs>` for more details. train_sizes : array-like of shape (n_ticks,) Relative or absolute numbers of training examples that will be used to generate the learning curve. If the ``dtype`` is float, it is regarded as a fraction of the maximum size of the training set (that is determined by the selected validation method), i.e. it has to be within (0, 1]. Otherwise it is interpreted as absolute sizes of the training sets. Note that for classification the number of samples usually have to be big enough to contain at least one sample from each class. (default: np.linspace(0.1, 1.0, 5)) """ import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import learning_curve if axes is None: _, axes = plt.subplots(1, 3, figsize=(20, 5)) axes[0].set_title(title) if ylim is not None: axes[0].set_ylim(*ylim) axes[0].set_xlabel("Training examples") axes[0].set_ylabel("Score") train_sizes, train_scores, test_scores, fit_times, _ = \ learning_curve(estimator, X, y, cv=cv, n_jobs=n_jobs, train_sizes=train_sizes, return_times=True, verbose=verbose) train_scores_mean = np.mean(train_scores, axis=1) train_scores_std = np.std(train_scores, axis=1) test_scores_mean = np.mean(test_scores, axis=1) test_scores_std = np.std(test_scores, axis=1) fit_times_mean = np.mean(fit_times, axis=1) fit_times_std = np.std(fit_times, axis=1) # Plot learning curve axes[0].grid() axes[0].fill_between(train_sizes, train_scores_mean - train_scores_std, train_scores_mean + train_scores_std, alpha=0.1, color="r") axes[0].fill_between(train_sizes, test_scores_mean - test_scores_std, test_scores_mean + test_scores_std, alpha=0.1, color="g") axes[0].plot(train_sizes, train_scores_mean, 'o-', color="r", label="Training score") axes[0].plot(train_sizes, test_scores_mean, 'o-', color="g", label="Cross-validation score") axes[0].legend(loc="best") # Plot n_samples vs fit_times axes[1].grid() axes[1].plot(train_sizes, fit_times_mean, 'o-') axes[1].fill_between(train_sizes, fit_times_mean - fit_times_std, fit_times_mean + fit_times_std, alpha=0.1) axes[1].set_xlabel("Training examples") axes[1].set_ylabel("fit_times") axes[1].set_title("Scalability of the model") # Plot fit_time vs score axes[2].grid() axes[2].plot(fit_times_mean, test_scores_mean, 'o-') axes[2].fill_between(fit_times_mean, test_scores_mean - test_scores_std, test_scores_mean + test_scores_std, alpha=0.1) axes[2].set_xlabel("fit_times") axes[2].set_ylabel("Score") axes[2].set_title("Performance of the model") return plt if __name__ == '__main__': pass
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 198, 4299, 4814, 62, 11600, 7, 7568, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 15553, 284, 1382, 257, 22155, 286, 21337, 286, 4814, 1321, 583, ...
2.374143
4,084
# Criar uma base de dados. O usurio pode adicionar, excluir e listar clientes (que possuem id e nome). # *utilizar encapsulamento. user = Clientes() user.adicionar_cliente(189, 'Davi') user.adicionar_cliente(123, 'yan') user.adicionar_cliente(198, 'lorena') user.__lista = 'Outra coisa' # Varivel criada pelo programa. Caso queira acessar # a varivel da classe, ter que instanciar da seguinte forma: user._Pessoas__lista user.listar_clientes() user.deletar_cliente(123) user.listar_clientes()
[ 2, 327, 380, 283, 334, 2611, 2779, 390, 9955, 418, 13, 440, 39954, 952, 279, 1098, 512, 47430, 283, 11, 409, 565, 84, 343, 304, 1351, 283, 5456, 274, 357, 4188, 1184, 84, 368, 4686, 304, 299, 462, 737, 198, 2, 1635, 22602, 528, ...
2.460396
202
""" Test utility functionality.""" import datetime import decimal import json import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest from mock import patch from ..utils import JSONSerializable, DatetimeDecimalEncoder
[ 37811, 6208, 10361, 11244, 526, 15931, 198, 11748, 4818, 8079, 198, 11748, 32465, 198, 11748, 33918, 198, 11748, 25064, 198, 361, 25064, 13, 9641, 62, 10951, 1279, 357, 17, 11, 767, 2599, 198, 220, 220, 220, 1330, 555, 715, 395, 17, 3...
3.325
80
# 264. Ugly Number II # # Write a program to check whether a given number is an ugly number. # # Ugly numbers are positive numbers whose prime factors only include # 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it # includes another prime factor 7. # # Note that 1 is typically treated as an ugly number. # # precompute all ugly numbers if __name__ == "__main__": #print (Solution().nthUglyNumber(10)) #print (Solution().nthUglyNumber(1500)) print (Solution().nthUglyNumber(1690))
[ 2, 32158, 13, 471, 10853, 7913, 2873, 198, 2, 198, 2, 19430, 257, 1430, 284, 2198, 1771, 257, 1813, 1271, 318, 281, 13400, 1271, 13, 198, 2, 198, 2, 471, 10853, 3146, 389, 3967, 3146, 3025, 6994, 5087, 691, 2291, 198, 2, 362, 11, ...
3.17284
162
# Copyright 2015 OpenStack Foundation # # 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. # """ Add default security group table Revision ID: 14be42f3d0a5 Revises: 41662e32bce2 Create Date: 2014-12-12 14:54:11.123635 """ # revision identifiers, used by Alembic. revision = '14be42f3d0a5' down_revision = '26b54cf9024d' from alembic import op import six import sqlalchemy as sa from neutron._i18n import _ from neutron.common import exceptions # Models can change in time, but migration should rely only on exact # model state at the current moment, so a separate model is created # here. security_group = sa.Table('securitygroups', sa.MetaData(), sa.Column('id', sa.String(length=36), nullable=False), sa.Column('name', sa.String(255)), sa.Column('tenant_id', sa.String(255)))
[ 2, 15069, 1853, 4946, 25896, 5693, 198, 2, 198, 2, 220, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 220, 220, 220, 407, 779, 428, 2393, 2845, 287, 11846, 351, 26...
2.712381
525
from __future__ import annotations from coredis.response.callbacks import ResponseCallback from coredis.response.types import LibraryDefinition from coredis.response.utils import flat_pairs_to_dict from coredis.typing import Any, AnyStr, Mapping, Union from coredis.utils import EncodingInsensitiveDict
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 198, 6738, 269, 1850, 271, 13, 26209, 13, 13345, 10146, 1330, 18261, 47258, 198, 6738, 269, 1850, 271, 13, 26209, 13, 19199, 1330, 10074, 36621, 198, 6738, 269, 1850, 271, 13, 26209, 13, 26791,...
3.642857
84
from models.tilemap import TileMap
[ 198, 198, 6738, 4981, 13, 40927, 8899, 1330, 47870, 13912, 628 ]
3.454545
11
from .BasePage import BasePage from src.Locators import LoginPage from src.Services.Faker.FakeDataGenerator import DataGenerator
[ 6738, 764, 14881, 9876, 1330, 7308, 9876, 198, 6738, 12351, 13, 33711, 2024, 1330, 23093, 9876, 198, 6738, 12351, 13, 31007, 13, 37, 3110, 13, 49233, 6601, 8645, 1352, 1330, 6060, 8645, 1352, 628, 628 ]
3.771429
35
""" Copyright 2016 Disney Connected and Advanced Technologies Licensed under the Apache License, Version 2.0 (the "Apache License") with the following modification; you may not use this file except in compliance with the Apache License and the following modification to it: Section 6. Trademarks. is deleted and replaced with: 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor and its affiliates, except as required to comply with Section 4(c) of the License and to reproduce the content of the NOTICE file. You may obtain a copy of the Apache License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the Apache License with the above modification is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for the specific language governing permissions and limitations under the Apache License. """ __author__ = "Joe Roets, Brandon Kite, Dylan Yelton, Michael Bachtel" __copyright__ = "Copyright 2016, Disney Connected and Advanced Technologies" __license__ = "Apache" __version__ = "2.0" __maintainer__ = "Joe Roets" __email__ = "joe@dragonchain.org" from distutils.errors import DistutilsError from distutils.spawn import find_executable from setuptools import setup, Command from glob import glob import os.path # If we have a thrift compiler installed, let's use it to re-generate # the .py files. If not, we'll use the pre-generated ones. setup(name = 'Blockchain', version = '0.0.2', description = 'blockchain stuff', author = 'Folks', packages = ['blockchain'], cmdclass = { 'gen_thrift': gen_thrift } )
[ 37811, 198, 15269, 1584, 8519, 8113, 276, 290, 13435, 21852, 198, 198, 26656, 15385, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 25189, 4891, 13789, 4943, 198, 4480, 262, 1708, 17613, 26, 345, 743, 407, 779, 428, 2...
3.299296
568
"""RSS feeds for the `multilingual_news` app.""" from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sites.shortcuts import get_current_site from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.utils import get_language_from_request from multilingual_tags.models import Tag, TaggedItem from people.models import Person from .models import NewsEntry
[ 37811, 49, 5432, 21318, 329, 262, 4600, 16680, 34900, 62, 10827, 63, 598, 526, 15931, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 11299, 19199, 13, 27530, 1330, 14041, 6030, 198, 6738, 426...
3.533784
148
""" Base settings to build other settings files upon. """ import os from pathlib import Path import environ ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent # field/ APPS_DIR = ROOT_DIR / "field" env = environ.Env() READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False) if READ_DOT_ENV_FILE: # OS environment variables take precedence over variables from .env env.read_env(str(ROOT_DIR / ".env")) # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = env.bool("DJANGO_DEBUG", False) # Local time zone. Choices are # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # though not all of them may be available with every OS. # In Windows, this must be set to your system time zone. TIME_ZONE = "UTC" # https://docs.djangoproject.com/en/dev/ref/settings/#language-code LANGUAGE_CODE = "en-gb" # https://docs.djangoproject.com/en/dev/ref/settings/#site-id SITE_ID = 1 # https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n USE_I18N = True # https://docs.djangoproject.com/en/dev/ref/settings/#use-l10n USE_L10N = True # https://docs.djangoproject.com/en/dev/ref/settings/#use-tz USE_TZ = True # https://docs.djangoproject.com/en/dev/ref/settings/#locale-paths LOCALE_PATHS = [str(ROOT_DIR / "locale")] # DATABASES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#databases DATABASES = {"default": env.db("DATABASE_URL")} DATABASES["default"]["ATOMIC_REQUESTS"] = True # URLS # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#root-urlconf ROOT_URLCONF = "config.urls" # https://docs.djangoproject.com/en/dev/ref/settings/#wsgi-application WSGI_APPLICATION = "config.wsgi.application" # APPS # ------------------------------------------------------------------------------ DJANGO_APPS = [ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.sites", "django.contrib.messages", "django.contrib.staticfiles", # "django.contrib.humanize", # Handy template tags "django.contrib.admin", "django.forms", # 'django_extensions', # legacy ] THIRD_PARTY_APPS = [ "crispy_forms", "allauth", "allauth.account", "allauth.socialaccount", "django_elasticsearch_dsl", # wagtail "wagtail.contrib.forms", "wagtail.contrib.redirects", "wagtail.contrib.settings", "wagtail.embeds", "wagtail.sites", "wagtail.users", "wagtail.snippets", "wagtail.documents", "wagtail.images", "wagtail.admin", "wagtail.core", 'wagtail.search', # legacy 'wagtail.contrib.modeladmin', # legacy "wagtail.contrib.sitemaps", # puput 'wagtail.contrib.routable_page', # legacy 'wagtail.contrib.table_block', # legacy "modelcluster", "django_social_share", # for puput "django_comments", # for puput "taggit", # for puput 'puput', # legacy 'colorful', # for puput 'wagtailmenus', # legacy 'captcha', # legacy, what for? # KDL 'kdl_wagtail_page', # legacy, still used? 'controlled_vocabulary', 'dublincore_resource', "kdl_wagtail.core", 'kdl_wagtail.people', 'django_kdl_timeline', ] LOCAL_APPS = [ # "field.users.apps.UsersConfig", # ? 'field_timeline', 'field_wagtail', ] # https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS # MIGRATIONS # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#migration-modules MIGRATION_MODULES = {"sites": "field.contrib.sites.migrations"} # AUTHENTICATION # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#authentication-backends AUTHENTICATION_BACKENDS = [ "django.contrib.auth.backends.ModelBackend", "allauth.account.auth_backends.AuthenticationBackend", ] if 0: # https://docs.djangoproject.com/en/dev/ref/settings/#auth-user-model AUTH_USER_MODEL = "users.User" # https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url LOGIN_REDIRECT_URL = "users:redirect" # https://docs.djangoproject.com/en/dev/ref/settings/#login-url LOGIN_URL = "account_login" LOGIN_URL = '/wagtail/login/' # PASSWORDS # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#password-hashers PASSWORD_HASHERS = [ # https://docs.djangoproject.com/en/dev/topics/auth/passwords/#using-argon2-with-django "django.contrib.auth.hashers.Argon2PasswordHasher", "django.contrib.auth.hashers.PBKDF2PasswordHasher", "django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher", "django.contrib.auth.hashers.BCryptSHA256PasswordHasher", ] # https://docs.djangoproject.com/en/dev/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"}, ] # MIDDLEWARE # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#middleware MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.locale.LocaleMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.common.BrokenLinkEmailsMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "wagtail.contrib.redirects.middleware.RedirectMiddleware", ] # STATIC # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#static-root STATIC_ROOT = str(ROOT_DIR / "staticfiles") # https://docs.djangoproject.com/en/dev/ref/settings/#static-url STATIC_URL = "/static/" # https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS STATICFILES_DIRS = [ str(ROOT_DIR / "assets"), str(APPS_DIR / "static"), str(ROOT_DIR / "node_modules"), ] # https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders STATICFILES_FINDERS = [ "django.contrib.staticfiles.finders.FileSystemFinder", "django.contrib.staticfiles.finders.AppDirectoriesFinder", ] # MEDIA # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#media-root MEDIA_ROOT = str(APPS_DIR / "media") # https://docs.djangoproject.com/en/dev/ref/settings/#media-url MEDIA_URL = "/media/" if not os.path.exists(MEDIA_ROOT): os.makedirs(MEDIA_ROOT) # TEMPLATES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#templates TEMPLATES = [ { # https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATES-BACKEND "BACKEND": "django.template.backends.django.DjangoTemplates", # https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs "DIRS": [str(ROOT_DIR / "templates"), str(APPS_DIR / "templates")], "OPTIONS": { # https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders # https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types "loaders": [ "django.template.loaders.filesystem.Loader", "django.template.loaders.app_directories.Loader", ], # https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors "context_processors": [ "django.template.context_processors.debug", "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.template.context_processors.i18n", "django.template.context_processors.media", "django.template.context_processors.static", "django.template.context_processors.tz", "django.contrib.messages.context_processors.messages", "field.utils.context_processors.settings_context", 'field_wagtail.context_processor.project_settings', 'field_wagtail.context_processor.mailing_list_footer', ], }, } ] # https://docs.djangoproject.com/en/dev/ref/settings/#form-renderer FORM_RENDERER = "django.forms.renderers.TemplatesSetting" # http://django-crispy-forms.readthedocs.io/en/latest/install.html#template-packs CRISPY_TEMPLATE_PACK = "bootstrap4" # FIXTURES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#fixture-dirs FIXTURE_DIRS = (str(APPS_DIR / "fixtures"),) # SECURITY # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-httponly SESSION_COOKIE_HTTPONLY = True # https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-httponly CSRF_COOKIE_HTTPONLY = True # https://docs.djangoproject.com/en/dev/ref/settings/#secure-browser-xss-filter SECURE_BROWSER_XSS_FILTER = True # https://docs.djangoproject.com/en/dev/ref/settings/#x-frame-options X_FRAME_OPTIONS = "DENY" # EMAIL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend EMAIL_BACKEND = env( "DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.smtp.EmailBackend" ) # https://docs.djangoproject.com/en/dev/ref/settings/#email-timeout EMAIL_TIMEOUT = 5 # ADMIN # ------------------------------------------------------------------------------ # Django Admin URL. ADMIN_URL = "admin/" # https://docs.djangoproject.com/en/dev/ref/settings/#admins # ADMINS = [("""King's Digital Lab""", "kdl-info@kcl.ac.uk")] ADMINS = [("Geoffroy", "geoffroy.noel@kcl.ac.uk")] # https://docs.djangoproject.com/en/dev/ref/settings/#managers MANAGERS = ADMINS # LOGGING # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#logging # See https://docs.djangoproject.com/en/dev/topics/logging for # more details on how to customize your logging configuration. LOGGING = { "version": 1, "disable_existing_loggers": False, "formatters": { "verbose": { "format": "%(levelname)s %(asctime)s %(module)s " "%(process)d %(thread)d %(message)s" } }, "handlers": { "console": { "level": "DEBUG", "class": "logging.StreamHandler", "formatter": "verbose", } }, "root": {"level": "INFO", "handlers": ["console"]}, } # django-allauth # ------------------------------------------------------------------------------ ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True) # https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_AUTHENTICATION_METHOD = "username" # https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_EMAIL_REQUIRED = True # https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_EMAIL_VERIFICATION = "mandatory" # https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_ADAPTER = "field.users.adapters.AccountAdapter" # https://django-allauth.readthedocs.io/en/latest/configuration.html SOCIALACCOUNT_ADAPTER = "field.users.adapters.SocialAccountAdapter" # django-compressor # ------------------------------------------------------------------------------ # https://django-compressor.readthedocs.io/en/latest/quickstart/#installation INSTALLED_APPS += ["compressor"] STATICFILES_FINDERS += ["compressor.finders.CompressorFinder"] COMPRESS_CSS_FILTERS = [ # CSS minimizer 'compressor.filters.cssmin.CSSMinFilter' ] COMPRESS_PRECOMPILERS = ( ('text/x-scss', 'django_libsass.SassCompiler'), ) # Elasticsearch # ------------------------------------------------------------------------------ # https://github.com/django-es/django-elasticsearch-dsl ELASTICSEARCH_DSL = {"default": {"hosts": "elasticsearch:9200"}} # Wagtail # ------------------------------------------------------------------------------ # https://docs.wagtail.io/en/v2.7.1/getting_started/integrating_into_django.html WAGTAIL_SITE_NAME = "FIELD" PROJECT_TITLE = 'FIELD' # PUPUT # ------------------------------------------------------------------------------ PUPUT_AS_PLUGIN = True # https://github.com/APSL/puput/issues/222 PUPUT_COMMENTS_PROVIDER = 'puput.comments.DjangoCommentsCommentsProvider' # Your stuff... # ------------------------------------------------------------------------------ USE_BULMA = True # 1: root, 2: site home page, 3: top level page # default is 3, we change to 2 because our default main menu # is just the home page, nothing else. WAGTAILMENUS_SECTION_ROOT_DEPTH = 2 # Note that KCL was (still is?) the research grant recipient. # Please make sure logo removal is agreed first with Wellcome & KCL. HIDE_KCL_LOGO = True # those settings vars will be available in template contexts SETTINGS_VARS_IN_CONTEXT = [ 'PROJECT_TITLE', 'GA_ID', 'USE_BULMA', 'MAILING_LIST_FORM_WEB_PATH', 'HIDE_KCL_LOGO', ] # slug of the page which is the parent of the specific communities FIELD_COMMUNITIES_ROOT_SLUG = 'groups' if 1: FABRIC_DEV_PACKAGES = [ { 'git': 'https://github.com/kingsdigitallab/django-kdl-wagtail.git', 'folder_git': 'django-kdl-wagtail', 'folder_package': 'kdl_wagtail', 'branch': 'develop', 'servers': ['lcl', 'dev', 'stg', 'liv'], } ] KDL_WAGTAIL_HIDDEN_PAGE_TYPES = [ ('kdl_wagtail_page.richpage'), ('kdl_wagtail_core.streampage'), ('kdl_wagtail_core.indexpage'), ('kdl_wagtail_people.peopleindexpage'), ('kdl_wagtail_people.personpage'), ] MAILING_LIST_FORM_WEB_PATH = '/mailing-list/' # ----------------------------------------------------------------------------- # Django Simple Captcha # ----------------------------------------------------------------------------- CAPTCHA_FONT_SIZE = 36 # Timeline settings TIMELINE_IMAGE_FOLDER = '/images/' TIMELINE_IMAGE_FORMAT = 'jpg' # dublin core settings # Set to True to disable the DublinCoreResource model and define your own DUBLINCORE_RESOURCE_ABSTRACT_ONLY = False # The path where resource file are uploaded, relative to your MEDIA path DUBLINCORE_RESOURCE_UPLOAD_PATH = 'uploads/dublin_core/' # ---------------------------------------------------------------------------- # Wagtail extra settings # ---------------------------------------------------------------------------- WAGTAILIMAGES_IMAGE_MODEL = "field_wagtail.FieldImage" # Google Analytics ID GA_ID = 'UA-67707155-9' # Field Mailchimp settings (May 2019) MAILCHIMP_LIST_ID = env('MAILCHIMP_LIST_ID', default='') MAILCHIMP_API_KEY = env('MAILCHIMP_API_KEY', default='')
[ 37811, 198, 14881, 6460, 284, 1382, 584, 6460, 3696, 2402, 13, 198, 37811, 198, 11748, 28686, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 11748, 551, 2268, 198, 198, 13252, 2394, 62, 34720, 796, 10644, 7, 834, 7753, 834, 737, 411, 6...
2.685802
5,888
# -*- coding: utf-8 -*- import pandas as pd import pytest from bio_hansel.qc import QC from bio_hansel.subtype import Subtype from bio_hansel.subtype_stats import SubtypeCounts from bio_hansel.subtyper import absent_downstream_subtypes, sorted_subtype_ints, empty_results, \ get_missing_internal_subtypes from bio_hansel.utils import find_inconsistent_subtypes, expand_degenerate_bases
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 12972, 9288, 198, 198, 6738, 13401, 62, 7637, 741, 13, 80, 66, 1330, 36070, 198, 6738, 13401, 62, 7637, 741, 13, 7266...
2.891304
138
import gzip import json import pickle from collections import defaultdict from pathlib import Path from zipfile import ZipFile from tqdm import tqdm from capreolus import ConfigOption, Dependency, constants from capreolus.utils.common import download_file, remove_newline from capreolus.utils.loginit import get_logger from capreolus.utils.trec import topic_to_trectxt from . import Benchmark logger = get_logger(__name__) PACKAGE_PATH = constants["PACKAGE_PATH"]
[ 11748, 308, 13344, 198, 11748, 33918, 198, 11748, 2298, 293, 198, 6738, 17268, 1330, 4277, 11600, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 19974, 7753, 1330, 38636, 8979, 198, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 198, ...
3.219178
146
from click.testing import CliRunner from honeybee_radiance_folder.cli import filter_json_file import json import os
[ 6738, 3904, 13, 33407, 1330, 1012, 72, 49493, 198, 6738, 12498, 20963, 62, 6335, 3610, 62, 43551, 13, 44506, 1330, 8106, 62, 17752, 62, 7753, 198, 11748, 33918, 198, 11748, 28686, 628, 198 ]
3.575758
33
import logging from django import forms from django.forms import ModelForm from django.forms.widgets import flatatt from django.utils.html import mark_safe from perma.models import Registrar, Organization, LinkUser logger = logging.getLogger(__name__)
[ 11748, 18931, 198, 198, 6738, 42625, 14208, 1330, 5107, 198, 6738, 42625, 14208, 13, 23914, 1330, 9104, 8479, 198, 6738, 42625, 14208, 13, 23914, 13, 28029, 11407, 1330, 6228, 1078, 198, 6738, 42625, 14208, 13, 26791, 13, 6494, 1330, 1317...
2.364286
140