blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
616
content_id
stringlengths
40
40
detected_licenses
listlengths
0
69
license_type
stringclasses
2 values
repo_name
stringlengths
5
118
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
63
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
2.91k
686M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
23 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
213 values
src_encoding
stringclasses
30 values
language
stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
2
10.3M
extension
stringclasses
246 values
content
stringlengths
2
10.3M
authors
listlengths
1
1
author_id
stringlengths
0
212
cae12c341248552d20b6b8dcb35c4720f5f00d98
a13ef2b26adf4d13ecf7060c40c655f4c3c64d27
/practice/os.py
376163be962dc5dc7c90c2cdb24f2074b2c0a071
[]
no_license
sunzhijie/learn-python
d0853759c0aebfa987f72e7931ff2ffbff86d6bc
b8a6d1216a5835129c906e4bceef9b6fe09f3eaf
refs/heads/master
2016-09-07T18:44:40.037641
2015-04-17T08:03:33
2015-04-17T08:03:33
33,942,917
0
0
null
null
null
null
UTF-8
Python
false
false
248
py
__author__ = 'sunzhijie' import os print os.getenv('PATH') print os.path.abspath('.') print os.path.join('/user/', 'dfdf') # print os.mkdir('./name') # print os.rmdir('./name') print [x for x in os.listdir('.') if os.path.splitext(x)[1] == '.py']
[ "646202721@qq.com" ]
646202721@qq.com
ef7c1442a1b18beb9d8abcb18e13e6af8ec14174
cff120b6491ed50d63cbe91f4913667b0246d515
/venv/Lib/site-packages/python_imagesearch/imagesearch.py
6c63ae95491176014bff68965f2c5d2193b2db4e
[]
no_license
cmlya/Lumberjack-Bot
0c541516dcfa49a604f9569d065f4ded83ce2c63
e1abb4a3428bf6a15ebc5b2fc1ae990fb563b48f
refs/heads/master
2023-07-07T17:49:38.545196
2021-08-25T14:37:52
2021-08-25T14:37:52
395,719,116
0
0
null
null
null
null
UTF-8
Python
false
false
9,564
py
import math import cv2 import numpy as np import pyautogui import random import time import platform import subprocess import os import mss is_retina = False if platform.system() == "Darwin": is_retina = subprocess.call("system_profiler SPDisplaysDataType | grep 'retina'", shell=True) == 0 ''' grabs a region (topx, topy, bottomx, bottomy) to the tuple (topx, topy, width, height) input : a tuple containing the 4 coordinates of the region to capture output : a PIL image of the area selected. ''' def region_grabber(region): if is_retina: region = [n * 2 for n in region] x1 = region[0] y1 = region[1] width = region[2] - x1 height = region[3] - y1 region = x1, y1, width, height with mss.mss() as sct: return sct.grab(region) ''' Searchs for an image within an area input : image : path to the image file (see opencv imread for supported types) x1 : top left x value y1 : top left y value x2 : bottom right x value y2 : bottom right y value precision : the higher, the lesser tolerant and fewer false positives are found default is 0.8 im : a PIL image, usefull if you intend to search the same unchanging region for several elements returns : the top left corner coordinates of the element if found as an array [x,y] or [-1,-1] if not ''' def imagesearcharea(image, x1, y1, x2, y2, precision=0.8, im=None): if im is None: im = region_grabber(region=(x1, y1, x2, y2)) if is_retina: im.thumbnail((round(im.size[0] * 0.5), round(im.size[1] * 0.5))) # im.save('testarea.png') usefull for debugging purposes, this will save the captured region as "testarea.png" img_rgb = np.array(im) img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY) template = cv2.imread(image, 0) if template is None: raise FileNotFoundError('Image file not found: {}'.format(image)) res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED) min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res) if max_val < precision: return [-1, -1] return max_loc ''' click on the center of an image with a bit of random. eg, if an image is 100*100 with an offset of 5 it may click at 52,50 the first time and then 55,53 etc Usefull to avoid anti-bot monitoring while staying precise. this function doesn't search for the image, it's only ment for easy clicking on the images. input : image : path to the image file (see opencv imread for supported types) pos : array containing the position of the top left corner of the image [x,y] action : button of the mouse to activate : "left" "right" "middle", see pyautogui.click documentation for more info time : time taken for the mouse to move from where it was to the new position ''' def click_image(image, pos, action, timestamp, offset=5): img = cv2.imread(image) if img is None: raise FileNotFoundError('Image file not found: {}'.format(image)) height, width, channels = img.shape pyautogui.moveTo(pos[0] + r(width / 2, offset), pos[1] + r(height / 2, offset), timestamp) pyautogui.click(button=action) ''' Searchs for an image on the screen input : image : path to the image file (see opencv imread for supported types) precision : the higher, the lesser tolerant and fewer false positives are found default is 0.8 im : a PIL image, usefull if you intend to search the same unchanging region for several elements returns : the top left corner coordinates of the element if found as an array [x,y] or [-1,-1] if not ''' def closest_coord(query_coord, coords): return min( math.hypot(c[0] - query_coord[0], c[1] - query_coord[1]) for c in coords ) def imagesearch(image, precision=0.8): with mss.mss() as sct: im = sct.grab(sct.monitors[0]) if is_retina: im.thumbnail((round(im.size[0] * 0.5), round(im.size[1] * 0.5))) # im.save('testarea.png') useful for debugging purposes, this will save the captured region as "testarea.png" img_rgb = np.array(im) img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY) template = cv2.imread(image, 0) if template is None: raise FileNotFoundError('Image file not found: {}'.format(image)) template.shape[::-1] res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED) loc = np.where(res >= precision) coords_unfiltered = list(zip(*loc[::-1])) coords = [] for coord in coords_unfiltered: if len(coords) == 0 or closest_coord(coord, coords) > 3**2: coords.append(coord) if len(coords) > 0: print(len(coords)) for coord in coords: cv2.rectangle(img_rgb, coord, (coord[0]+18,coord[1]+85), (0,0,255), 2) cv2.imwrite("debug_output.png", img_rgb) return coords # min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res) # if max_val < precision: # return [-1, -1] # return max_loc ''' Searchs for an image on screen continuously until it's found. input : image : path to the image file (see opencv imread for supported types) time : Waiting time after failing to find the image precision : the higher, the lesser tolerant and fewer false positives are found default is 0.8 returns : the top left corner coordinates of the element if found as an array [x,y] ''' def imagesearch_loop(image, timesample, precision=0.8): pos = imagesearch(image, precision) while pos[0] == -1: print(image + " not found, waiting") time.sleep(timesample) pos = imagesearch(image, precision) return pos ''' Searchs for an image on screen continuously until it's found or max number of samples reached. input : image : path to the image file (see opencv imread for supported types) time : Waiting time after failing to find the image maxSamples: maximum number of samples before function times out. precision : the higher, the lesser tolerant and fewer false positives are found default is 0.8 returns : the top left corner coordinates of the element if found as an array [x,y] ''' def imagesearch_numLoop(image, timesample, maxSamples, precision=0.8): pos = imagesearch(image, precision) count = 0 while pos[0] == -1: print(image + " not found, waiting") time.sleep(timesample) pos = imagesearch(image, precision) count = count + 1 if count > maxSamples: break return pos ''' Searchs for an image on a region of the screen continuously until it's found. input : image : path to the image file (see opencv imread for supported types) time : Waiting time after failing to find the image x1 : top left x value y1 : top left y value x2 : bottom right x value y2 : bottom right y value precision : the higher, the lesser tolerant and fewer false positives are found default is 0.8 returns : the top left corner coordinates of the element as an array [x,y] ''' def imagesearch_region_loop(image, timesample, x1, y1, x2, y2, precision=0.8): pos = imagesearcharea(image, x1, y1, x2, y2, precision) while pos[0] == -1: time.sleep(timesample) pos = imagesearcharea(image, x1, y1, x2, y2, precision) return pos ''' Searches for an image on the screen and counts the number of occurrences. input : image : path to the target image file (see opencv imread for supported types) precision : the higher, the lesser tolerant and fewer false positives are found default is 0.9 returns : the number of times a given image appears on the screen. optionally an output image with all the occurances boxed with a red outline. ''' def imagesearch_count(image, precision=0.9): with mss.mss() as sct: img_rgb = sct.grab() if is_retina: img_rgb.thumbnail((round(img_rgb.size[0] * 0.5), round(img_rgb.size[1] * 0.5))) img_rgb = np.array(img_rgb) img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY) template = cv2.imread(image, 0) if template is None: raise FileNotFoundError('Image file not found: {}'.format(image)) w, h = template.shape[::-1] res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED) loc = np.where(res >= precision) count = 0 for pt in zip(*loc[::-1]): # Swap columns and rows # cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), 2) // Uncomment to draw boxes around found occurrences count = count + 1 # cv2.imwrite('result.png', img_rgb) // Uncomment to write output image with boxes drawn around occurrences return count ''' Get all screens on the provided folder and search them on screen. input : path : path of the folder with the images to be searched on screen precision : the higher, the lesser tolerant and fewer false positives are found default is 0.8 returns : A dictionary where the key is the path to image file and the value is the position where was found. ''' def imagesearch_from_folder(path, precision): print(path) imagesPos = {} path = path if path[-1] == '/' or '\\' else path+'/' valid_images = [".jpg", ".gif", ".png", ".jpeg"] files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and os.path.splitext(f)[1].lower() in valid_images] for file in files: pos = imagesearch(path+file, precision) imagesPos[path+file] = pos return imagesPos def r(num, rand): return num + rand * random.random()
[ "83574726+cmlya@users.noreply.github.com" ]
83574726+cmlya@users.noreply.github.com
b67f2769bfefa0625cc6527943ef1b7faf9c0f9a
ff1fe0e31e863ab69e2434b574115fed782d76ad
/set.py
e37f9c7d1e8de9534208c0ced057cebe0e3f014c
[]
no_license
tasnuvaleeya/python_programming
cd7200e0dc0c4ec6bd23c4f9360fc251a7c4a516
45a577634e53a1c4cab927eb770cde01a00571ce
refs/heads/master
2021-04-12T02:47:46.011445
2018-03-17T14:54:09
2018-03-17T14:54:09
null
0
0
null
null
null
null
UTF-8
Python
false
false
152
py
groceries = {'cereal', 'milk','rice', 'beer', 'beer'} if 'milk' in groceries: print('you already have milk') else: print('oh yes u need milk')
[ "tasnuva2606@gmail.com" ]
tasnuva2606@gmail.com
fa7609a84faa2ff896f2cebe0c1a001df50f2eaf
2bae6ce8c194a12d19abc90681ba107a3213f6a9
/DDPG/DDPG_Examples/DDPG_InvertedDoublePendulum/DDPG_Test_InvertedDoublePendulum.py
5943f987036fa13ffe6d58727f52e1dcd7c5774a
[]
no_license
bingai/RL-Algorithms
d690dcea418d54c5a18db1a87b4abb5e79625c61
3b3227001bb02eec32b0ac171cdd6557245d31bc
refs/heads/master
2020-04-09T17:09:57.752119
2019-01-01T04:25:32
2019-01-01T04:25:32
160,472,540
0
0
null
null
null
null
UTF-8
Python
false
false
10,104
py
import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim import argparse import pprint as pp import gym import utils import os import time # =========================== # Actor DDPG pi(s) # =========================== # """ # ​ Input to the network is the state, output is the action # ​ under a deterministic policy. # ​ The output layer activation is a tanh to keep the action # ​ between -action_bound and action_bound # ​""" class Actor(object): def __init__(self, sess, state_dim, action_dim, action_bound, learning_rate, tau, batch_size): self.sess = sess self.s_dim = state_dim self.a_dim = action_dim self.action_bound = action_bound self.learning_rate = learning_rate self.tau = tau self.batch_size = batch_size self.input = tf.placeholder(shape = [None, self.s_dim], dtype = tf.float32) self.out, self.out_scaled = self.create_actor_network('main_actor') self.network_params = tf.trainable_variables() # # another way to get trainable variables # self.network_params = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, 'main_actor') self.target_out, self.target_out_scaled = self.create_actor_network('target_actor') self.target_network_params = tf.trainable_variables()[ len(self.network_params): ] # # another way to get trainable variables # self.target_network_params = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, 'target_actor') self.update_target_network_params = \ [self.target_network_params[i].assign(tf.multiply(self.network_params[i], self.tau) + tf.multiply(self.target_network_params[i], 1. - self.tau)) for i in range(len(self.target_network_params))] def create_actor_network(self, scope, reuse = False): with tf.variable_scope(scope, reuse = reuse): net = self.input net = slim.fully_connected(net, 400, activation_fn = tf.nn.relu) net = slim.fully_connected(net, 300, activation_fn = tf.nn.relu) net = slim.fully_connected(net, self.a_dim, activation_fn = tf.nn.tanh) out_scaled = tf.multiply(net, self.action_bound) return net, out_scaled def update_target_network(self): self.sess.run(self.update_target_network_params) def predict(self, inputs): return self.sess.run(self.out_scaled, feed_dict={ self.input: inputs }) def predict_target(self, inputs): return self.sess.run(self.target_out_scaled, feed_dict={ self.input: inputs }) # =========================== # Critic DDPG Q(s,a) # =========================== # """ # ​ Input to the network is the state and action, output is Q(s,a). # ​ The action must be obtained from the output of the Actor network. # ​""" class Critic(object): def __init__(self, sess, state_dim, action_dim, learning_rate, tau, actor_inputs_scaled): self.sess = sess self.s_dim = state_dim self.a_dim = action_dim self.learning_rate = learning_rate self.tau = tau # Q(s,a) input 1: state self.state_input = tf.placeholder(shape = [None, self.s_dim], dtype = tf.float32) # Q(s,a) input 2: action self.actor_input_scaled = actor_inputs_scaled self.actor_input = tf.placeholder(shape = [None, self.a_dim], dtype = tf.float32) # Q(s,a) with scaled action input self.total_out_scaled = self.create_critic_network('main_critic', self.actor_input_scaled) # Q(s,a) with unscaled action input self.out = self.create_critic_network('main_critic', self.actor_input, reuse = True) # target_Q(s,a) self.target_out = self.create_critic_network('target_critic', self.actor_input) self.network_params = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, 'main_critic') self.target_network_params = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, 'target_critic') self.update_target_network_params = \ [self.target_network_params[i].assign(tf.multiply(self.network_params[i], self.tau) + tf.multiply(self.target_network_params[i], 1. - self.tau)) for i in range(len(self.target_network_params))] # update critics self.predicted_q_value = tf.placeholder(tf.float32, [None, 1]) self.loss = tf.reduce_mean(tf.square(self.out - self.predicted_q_value)) self.train_step = tf.train.AdamOptimizer(self.learning_rate).minimize(self.loss, var_list = self.network_params) def create_critic_network(self, scope, actions, reuse = False): with tf.variable_scope(scope, reuse = reuse): # Q(s,a) net = tf.concat([self.state_input, actions], axis = 1) net = slim.fully_connected(net, 400, activation_fn = tf.nn.relu) net = slim.fully_connected(net, 300, activation_fn = tf.nn.relu) net = slim.fully_connected(net, 1, activation_fn = None) return net def update_target_network(self): self.sess.run(self.update_target_network_params) def predict(self, state_inputs, actor_inputs): return self.sess.run(self.out, feed_dict={ self.state_input: state_inputs, self.actor_input: actor_inputs }) def predict_target(self, state_inputs, actor_inputs): return self.sess.run(self.target_out, feed_dict={ self.state_input: state_inputs, self.actor_input: actor_inputs }) #=========================== # Tensorflow Summary Ops #=========================== def test_summaries(): episode_r = tf.Variable(0.) tf.summary.scalar("Test Reward", episode_r) episode_timesteps = tf.Variable(0.) tf.summary.scalar("Steps before DONE", episode_timesteps) summary_vars = [episode_r, episode_timesteps] summary_ops = tf.summary.merge_all() return summary_ops, summary_vars def test(sess, env, actor, summary_ops, summary_vars): s = env.reset() done = False episode_r = 0 episode_timesteps = 0 # test book-keeping writer = tf.summary.FileWriter(args['test_dir']) writer.add_graph(sess.graph) while not done: env.render() action = actor.predict(np.reshape(s, (1, actor.s_dim))) s2, r, done, _ = env.step(action) time.sleep(0.01) episode_r += r s = s2 episode_timesteps += 1 # # test book-keeping summary_str = sess.run(summary_ops, feed_dict={ summary_vars[0]: np.asscalar(episode_r), summary_vars[1]: episode_timesteps}) writer.add_summary(summary_str,episode_timesteps) writer.flush() print("During evaluation the mean episode reward is {}, and it took {} steps before Done".format(np.asscalar(episode_r), episode_timesteps)) def main(args): if not os.path.exists(args['save_dir']) : os.makedirs(args['save_dir']) with tf.Session() as sess: env = gym.make(args['env']) np.random.seed(int(args['random_seed'])) tf.set_random_seed(int(args['random_seed'])) env.seed(int(args['random_seed'])) state_dim = env.observation_space.shape[0] action_dim = env.action_space.shape[0] action_bound = int(env.action_space.high[0]) actor = Actor(sess, state_dim, action_dim, action_bound, float(args['actor_lr']), float(args['tau']), int(args['minibatch_size'])) critic = Critic(sess, state_dim, action_dim, float(args['critic_lr']), float(args['tau']), actor.out_scaled) # Set up summary Ops summary_ops, summary_vars = test_summaries() # load pre-trained model saver = tf.train.Saver() saver.restore(sess, os.path.join(args['save_dir'], args['env'])) # evaluate trained model test(sess, env, actor, summary_ops, summary_vars) time.sleep(2) if __name__ == '__main__': parser = argparse.ArgumentParser(description='provide arguments for TD3 agent') parser.add_argument('--actor_lr', help='actor network learning rate', default=0.001) parser.add_argument('--critic_lr', help='critic network learning rate', default=0.001) parser.add_argument("--start_timesteps", help='action sampling strategy time trigger', default=1e4, type=int) parser.add_argument('--tau', help='soft target update parameter', default=0.005) parser.add_argument('--minibatch_size', help='size of minibatch for minibatch-SGD', default=100) parser.add_argument("--policy_noise", help = 'std of noise added ', default=0.2, type=float) parser.add_argument("--noise_clip", default=0.5, type=float) parser.add_argument("--discount", default=0.99, type=float) parser.add_argument("--policy_freq", default=2, type=int) parser.add_argument("--expl_noise", default=0.1, type=float) # parser.add_argument('--env', help='choose the gym env', default='Pendulum-v0') # parser.add_argument('--env', help='choose the gym env', default='InvertedPendulum-v2') parser.add_argument('--env', help='choose the gym env', default='InvertedDoublePendulum-v2') # parser.add_argument('--env', help='choose the gym env', default='MountainCarContinuous-v0') # parser.add_argument('--env', help='choose the gym env', default='Reacher-v2') # parser.add_argument('--env', help='choose the gym env', default='HalfCheetah-v2') # parser.add_argument('--env', help='choose the gym env', default='Hopper-v2') # parser.add_argument('--env', help='choose the gym env', default='Walker2d-v2') # parser.add_argument('--env', help='choose the gym env', default='Ant-v2') # parser.add_argument('--env', help='choose the gym env', default='Humanoid-v2') # parser.add_argument('--env', help='choose the gym env', default='HumanoidStandup-v2') # parser.add_argument('--env', help='choose the gym env', default='Swimmer-v2') parser.add_argument('--random_seed', help='random seed for repeatability', default=0) parser.add_argument("--max_timesteps", default=1e6, type=float) parser.add_argument("--eval_episodes", default=100, type=float) parser.add_argument("--save_dir", default='./models/', help = 'save directory') parser.add_argument("--save_timesteps", default=2e5, type=float) #tensorboard book-keeping: training parser.add_argument('--summary_dir', help='directory for storing tensorboard info', default='./models/tensorboard') #tensorboard book-keeping: tratesting parser.add_argument('--test_dir', help='directory for storing tensorboard info : test', default='./models/tensorboard_test') args = vars(parser.parse_args()) pp.pprint(args) main(args)
[ "bing.ai@utexas.edu" ]
bing.ai@utexas.edu
3f78c365beacff55588a6afbfd7b66b354d5db58
dd62541e9bfa0c5d503b22eace4496296140656c
/common_qr.py
75e2f35e6fb2d18e61c070c81b239fb07405334c
[ "BSD-3-Clause" ]
permissive
sea51930/RaiWalletBot
750f9a63bfd95222fe8e24292d13e47b2ab4389c
4c558eaf1590092e3db1b7f8155d01fd2867b19d
refs/heads/master
2020-12-02T22:19:32.342777
2017-07-03T14:50:10
2017-07-03T14:50:10
96,114,318
0
0
null
2017-07-03T13:33:54
2017-07-03T13:33:54
null
UTF-8
Python
false
false
1,210
py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # RaiBlocks Telegram bot # @RaiWalletBot https://t.me/RaiWalletBot # # Source code: # https://github.com/SergiySW/RaiWalletBot # # Released under the BSD 3-Clause License # # QR code handler import ConfigParser config = ConfigParser.ConfigParser() config.read('bot.cfg') qr_folder_path = config.get('main', 'qr_folder_path') import pyqrcode import os.path #@run_async def qr_by_account(account): path = '{1}{0}.png'.format(account, qr_folder_path) if (not os.path.isfile(path)): qr = pyqrcode.create(account, error='L', version=4, mode=None, encoding='iso-8859-1') qr.png('{1}{0}.png'.format(account, qr_folder_path), scale=8) import qrtools from PIL import Image, ImageEnhance def account_by_qr(qr_file): qr = qrtools.QR() qr.decode(qr_file) # Try to increase contrast if not recognized if ('xrb_' not in qr.data): image = Image.open(qr_file) contrast = ImageEnhance.Contrast(image) image = contrast.enhance(7) image.save('{0}'.format(qr_file.replace('.jpg', '_.jpg')), 'JPEG') qr2 = qrtools.QR() qr2.decode('{0}'.format(qr_file.replace('.jpg', '_.jpg'))) #print(qr2.data) qr = qr2 return qr.data.replace('raiblocks://', '')
[ "sergiysw@gmail.com" ]
sergiysw@gmail.com
c573f51fd02948990abcc72e8748c4352f643cde
c862ffe067a5c539ddacf70e3db7632d1758f70a
/songbook/settings.py
c9b46202ca35bd702ee4ddcad400c467fad5797c
[]
no_license
MartinCurran28/django_assignment
288ed52bc9c10932c4a13cc78e2b4e0d44ab6c66
582f64549eea268aaee2523efe32c3d410b3578e
refs/heads/master
2020-05-15T12:03:24.006883
2019-04-19T11:49:09
2019-04-19T11:49:09
182,252,893
0
0
null
null
null
null
UTF-8
Python
false
false
3,611
py
""" Django settings for songbook project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'fs$ow5i(ox*8uak2@8aj=nh$x2+7t4f@4%6c%$o125zu=ha_ej' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [os.environ.get('C9_HOSTNAME')] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'accounts', 'django_forms_bootstrap', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'songbook.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'songbook.wsgi.application' # Database # https://docs.djangoproject.com/en/1.11/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.ModelBackend', 'accounts.backends.CaseInsensitiveAuth'] # Internationalization # https://docs.djangoproject.com/en/1.11/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.11/howto/static-files/ STATIC_URL = '/static/' MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = os.environ.get("EMAIL_ADDRESS", 'martincurran28@hotmail.com') EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_PASSWORD") EMAIL_PORT = 587
[ "martincurran28@hotmail.com" ]
martincurran28@hotmail.com
0225bd6623519534724f02704f9d1bdca8fa82b6
210af68aec4713e8cbe8dc988d509090815e6ff4
/0x04-python-more_data_structures/9-multiply_by_2.py
adcaf10fe0fc6a3ad8467a5cb752a4816fcc9910
[]
no_license
mahdibz97/holbertonschool-higher_level_programming
8e383d474438ba563311f829a763ce8733931c1a
7184a1eadcaf76f33135c00effe4390b1c227cbd
refs/heads/master
2022-12-19T12:29:44.678292
2020-09-25T07:56:44
2020-09-25T07:56:44
259,281,398
0
0
null
null
null
null
UTF-8
Python
false
false
153
py
#!/usr/bin/python3 def multiply_by_2(a_dictionary): new = {} for i in a_dictionary.keys(): new[i] = (a_dictionary[i] * 2) return new
[ "ben.zouitina.mahdi97@gmail.com" ]
ben.zouitina.mahdi97@gmail.com
9f46f7e89e19b7e65cfb7e37c5e03e9be0b2d4fe
55c250525bd7198ac905b1f2f86d16a44f73e03a
/Python/Projects/speech-text-file/gTTS/build/lib/gtts/tokenizer/symbols.py
3d40893c51295eda1b689b6f438f7089a38dc848
[ "LicenseRef-scancode-other-permissive" ]
permissive
NateWeiler/Resources
213d18ba86f7cc9d845741b8571b9e2c2c6be916
bd4a8a82a3e83a381c97d19e5df42cbababfc66c
refs/heads/master
2023-09-03T17:50:31.937137
2023-08-28T23:50:57
2023-08-28T23:50:57
267,368,545
2
1
null
2022-09-08T15:20:18
2020-05-27T16:18:17
null
UTF-8
Python
false
false
128
py
version https://git-lfs.github.com/spec/v1 oid sha256:a7c43c0c9dfa06ad8af4ec38d5a26b50deffacc6f2b881170eb8a37576f6d970 size 278
[ "nateweiler84@gmail.com" ]
nateweiler84@gmail.com
f03e7642f3f3d35c57c7e7083addaa4d03aea328
d8d14fd9959498d5c31a0bfc4b45b0a7c5a34155
/setup.py
6624b28fcc76ace191d21cacf6c5f8d510d18bac
[]
no_license
bugman78/menuzilla
3504fcdfdf61cbbc6ce154ccb779f648bb5add6a
0315a93fe51dbd1c53526e5ab63d58f913f38716
refs/heads/master
2021-01-11T22:11:33.889579
2017-01-14T09:56:20
2017-01-14T09:56:20
78,932,672
0
0
null
null
null
null
UTF-8
Python
false
false
1,305
py
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='menuzilla', version='0.1.0', description='menuzilla - generate desktop/menu entries from your firefox bookmarks', long_description=long_description, url='https://github.com/pypa/menuzilla', author='Stephane Bugat', author_email='stephane.bugat@free.fr', license='LGPL', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: End Users/Desktop', 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)', 'Programming Language :: Python :: 2.7', 'Topic :: Desktop Environment', ], keywords='freedesktop.org mozilla firefox bookmarks toolbar', packages=find_packages(exclude=['man', 'docs', 'tests']), scripts=['menuzilla.py',], install_requires=['python-xdg>=0.25-4'], )
[ "stephane.bugat@free.fr" ]
stephane.bugat@free.fr
73a3cec53ce6d0265522dccd62a747fdbcca6834
f023692f73992354a0b7823d9c49ae730c95ab52
/AtCoderBeginnerContest/1XX/157/D.py
b0ded2ec31985f6eebca56e6df87d7327321da26
[]
no_license
corutopi/AtCorder_python
a959e733f9a3549fab7162023e414ac2c99c4abe
a2c78cc647076071549e354c398155a65d5e331a
refs/heads/master
2023-08-31T09:40:35.929155
2023-08-20T06:19:35
2023-08-20T06:19:35
197,030,129
1
0
null
2022-06-22T04:06:28
2019-07-15T15:57:34
Python
UTF-8
Python
false
false
2,140
py
import sys sys.setrecursionlimit(10 ** 6) # from decorator import stop_watch # # # @stop_watch def solve(N, M, K, ABs, CDs): friend_map = [[] for _ in range(N + 1)] for a, b in ABs: friend_map[a].append(b) friend_map[b].append(a) block_map = [[] for _ in range(N + 1)] for c, d in CDs: block_map[c].append(d) block_map[d].append(c) def dfs(group_num, members, now_n): belongs[now_n] = group_num members.append(now_n) for f in friend_map[now_n]: if belongs[f] == -1: members = dfs(group_num, members, f) return members friend_groups = [] belongs = [-1] * (N + 1) for i in range(1, N + 1): if belongs[i] == -1: m = dfs(len(friend_groups), [], i) m.sort() friend_groups.append(m) ans = '' for n in range(1, N + 1): block = 0 group = friend_groups[belongs[n]] for b in block_map[n]: if belongs[n] == belongs[b]: block += 1 ans += ' ' + str(len(group) - len(friend_map[n]) - block - 1) print(ans[1:]) if __name__ == '__main__': # # handmade test # N, M, K = 2 * 10 ** 5, 10 ** 5, 10 ** 5 # ABs = [[1, i] for i in range(2, 10 ** 5 + 2)] # CDs = [[i, i + 1] for i in range(2, 10 ** 5 + 2)] # # handmade random # import random # N, M, K = 20, 10, 10 # ABs = [] # while True: # if len(ABs) == M: # break # a = random.randint(1, N - 1) # b = random.randint(a + 1, N) # if not [a, b] in ABs: # ABs.append([a, b]) # CDs = [] # while True: # if len(CDs) == K: # break # c = random.randint(1, N - 1) # d = random.randint(c + 1, N) # if not [c, d] in ABs and not [c, d] in CDs: # CDs.append([c, d]) # print(N, M, K) # print(ABs) # print(CDs) N, M, K = map(int, input().split()) ABs = [[int(i) for i in input().split()] for _ in range(M)] CDs = [[int(i) for i in input().split()] for _ in range(K)] solve(N, M, K, ABs, CDs)
[ "39874652+corutopi@users.noreply.github.com" ]
39874652+corutopi@users.noreply.github.com
80688a39b7b2e07d9b19fae862b8b5521e57040b
74623af256921be7fb2e69a8884d872f586f77f4
/.venv/bin/epylint
32b79850bcc2e375d12173dcd13d4cd40f6747a7
[]
no_license
fatmahkabeer/StockPricePrediction
6e58f1630ccfda0c8fb1bdcaf1dbbf80321ea58c
a4eaee593ae04b59026b8ab0d3aefc9554db18f7
refs/heads/main
2023-03-01T16:23:01.097974
2021-02-01T18:08:59
2021-02-01T18:08:59
318,237,814
1
0
null
null
null
null
UTF-8
Python
false
false
278
#!/Users/apple/Desktop/DataScience/StockPricePrediction/.venv/bin/python3 # -*- coding: utf-8 -*- import re import sys from pylint import run_epylint if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(run_epylint())
[ "apple@fatmahkabeers-MAcBook-Air.local" ]
apple@fatmahkabeers-MAcBook-Air.local
50a143d4fe47cc7b13e7ca802246ee09743ff7a8
2d82d4c6574bd6d32f2cf1c781615f7951f55f66
/muntjac/event/dd/acceptcriteria/and_.py
255229b61f9d197892bc0c331d353dba4488b0e7
[ "Apache-2.0" ]
permissive
metaperl/muntjac
f83f745ee03942a61af92ee7fba7285aa9c46f3c
8db97712edd81b4d25deaaa48587d2a08010f2c8
refs/heads/master
2021-01-15T22:04:25.057862
2012-11-09T03:52:59
2012-11-09T03:52:59
null
0
0
null
null
null
null
UTF-8
Python
false
false
960
py
# @MUNTJAC_COPYRIGHT@ # @MUNTJAC_LICENSE@ """A compound criterion that accepts the drag if all of its criteria accepts the drag.""" from muntjac.event.dd.acceptcriteria.client_side_criterion import \ ClientSideCriterion class And(ClientSideCriterion): """A compound criterion that accepts the drag if all of its criteria accepts the drag. @see: L{Or} """ def __init__(self, *criteria): """@param criteria: criteria of which the And criterion will be composed """ self.criteria = criteria def paintContent(self, target): super(And, self).paintContent(target) for crit in self.criteria: crit.paint(target) def accept(self, dragEvent): for crit in self.criteria: if not crit.accept(dragEvent): return False return True def getIdentifier(self): return 'com.vaadin.event.dd.acceptcriteria.And'
[ "r.w.lincoln@gmail.com" ]
r.w.lincoln@gmail.com
099d9b77d6ee33d721c385a92a5292916202d2c0
d77f22379d90393354178da397a5dbc3722fd8b4
/op.py
c7559a3c24edf17cad098e4eeed10da9c3d58bae
[]
no_license
caizkun/autodiff
3d33c577d459786f4a13cfcc7ddf478fceb231e7
379a6eba9b86476b1e012803400ef6dfb8398433
refs/heads/main
2023-09-02T21:02:55.684437
2021-11-15T08:43:32
2021-11-15T08:43:32
428,179,331
0
0
null
null
null
null
UTF-8
Python
false
false
3,213
py
import math from ad import Node class Op(object): def __call__(self): pass def fn(self, input_vals): raise NotImplementedError def grad_fn(self, input_vals, output_grad): raise NotImplementedError class AddOp(Op): def __call__(self, node_A, node_B): new_node = Node(self, [node_A, node_B]) new_node.require_grad = node_A.require_grad or node_B.require_grad return new_node def fn(self, input_vals): assert len(input_vals) == 2 return input_vals[0] + input_vals[1] def grad_fn(self, input_vals, output_grad): return [output_grad, output_grad] class SubOp(Op): def __call__(self, node_A, node_B): new_node = Node(self, [node_A, node_B]) new_node.require_grad = node_A.require_grad or node_B.require_grad return new_node def fn(self, input_vals): assert len(input_vals) == 2 return input_vals[0] - input_vals[1] def grad_fn(self, input_vals, output_grad): return [output_grad, -output_grad] class MulOp(Op): def __call__(self, node_A, node_B): new_node = Node(self, [node_A, node_B]) new_node.require_grad = node_A.require_grad or node_B.require_grad return new_node def fn(self, input_vals): assert len(input_vals) == 2 return input_vals[0] * input_vals[1] def grad_fn(self, input_vals, output_grad): return [input_vals[1] * output_grad, input_vals[0] * output_grad] class DivOp(Op): def __call__(self, node_A, node_B): new_node = Node(self, [node_A, node_B]) new_node.require_grad = node_A.require_grad or node_B.require_grad return new_node def fn(self, input_vals): assert len(input_vals) == 2 assert input_vals[1] != 0 return input_vals[0] / input_vals[1] def grad_fn(self, input_vals, output_grad): return [1.0/input_vals[1] * output_grad, -input_vals[0]/input_vals[1]**2 * output_grad] class LnOp(Op): def __call__(self, node_A): new_node = Node(self, [node_A], require_grad=node_A.require_grad) return new_node def fn(self, input_vals): assert len(input_vals) == 1 and input_vals[0] > 0 return math.log(input_vals[0]) def grad_fn(self, input_vals, output_grad): return [1.0 / input_vals[0] * output_grad] class SinOp(Op): def __call__(self, node_A): new_node = Node(self, [node_A], require_grad=node_A.require_grad) return new_node def fn(self, input_vals): assert len(input_vals) == 1 return math.cos(input_vals[0]) def grad_fn(self, input_vals, output_grad): return [math.cos(input_vals[0]) * output_grad] class InputOp(Op): def __call__(self, input_val, require_grad): new_node = Node(self, [input_val], require_grad=require_grad) return new_node def fn(self, input_vals): assert len(input_vals) == 1 return input_vals[0] def grad_fn(self, input_vals, output_grad): return [output_grad] # more ops ... # instaniate global ops add = AddOp() sub = SubOp() mul = MulOp() div = DivOp() ln = LnOp() sin = SinOp() var = InputOp()
[ "caizkun@gmail.com" ]
caizkun@gmail.com
7cc166e065fe935c41d23495250403d7dcdf2d32
fbbe424559f64e9a94116a07eaaa555a01b0a7bb
/pytorch/source/caffe2/python/workspace_test.py
93bcb115e685bccfd0f46ea8cc663fdb6cd3d849
[ "MIT" ]
permissive
ryfeus/lambda-packs
6544adb4dec19b8e71d75c24d8ed789b785b0369
cabf6e4f1970dc14302f87414f170de19944bac2
refs/heads/master
2022-12-07T16:18:52.475504
2022-11-29T13:35:35
2022-11-29T13:35:35
71,386,735
1,283
263
MIT
2022-11-26T05:02:14
2016-10-19T18:22:39
Python
UTF-8
Python
false
false
26,342
py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import os import unittest from caffe2.proto import caffe2_pb2 from caffe2.python import core, test_util, workspace, model_helper, brew import caffe2.python.hypothesis_test_util as htu import hypothesis.strategies as st from hypothesis import given class TestWorkspace(unittest.TestCase): def setUp(self): self.net = core.Net("test-net") self.testblob_ref = self.net.ConstantFill( [], "testblob", shape=[1, 2, 3, 4], value=1.0) workspace.ResetWorkspace() def testRootFolder(self): self.assertEqual(workspace.ResetWorkspace(), True) self.assertEqual(workspace.RootFolder(), ".") self.assertEqual( workspace.ResetWorkspace("/tmp/caffe-workspace-test"), True) self.assertEqual(workspace.RootFolder(), "/tmp/caffe-workspace-test") def testWorkspaceHasBlobWithNonexistingName(self): self.assertEqual(workspace.HasBlob("non-existing"), False) def testRunOperatorOnce(self): self.assertEqual( workspace.RunOperatorOnce( self.net.Proto().op[0].SerializeToString() ), True ) self.assertEqual(workspace.HasBlob("testblob"), True) blobs = workspace.Blobs() self.assertEqual(len(blobs), 1) self.assertEqual(blobs[0], "testblob") def testGetOperatorCost(self): op = core.CreateOperator( "Conv2D", ["X", "W"], ["Y"], stride_h=1, stride_w=1, pad_t=1, pad_l=1, pad_b=1, pad_r=1, kernel=3, ) X = np.zeros((1, 8, 8, 8)) W = np.zeros((1, 1, 3, 3)) workspace.FeedBlob("X", X) workspace.FeedBlob("W", W) flops, _ = workspace.GetOperatorCost(op.SerializeToString(), ["X", "W"]) self.assertEqual(flops, 1152) def testRunNetOnce(self): self.assertEqual( workspace.RunNetOnce(self.net.Proto().SerializeToString()), True) self.assertEqual(workspace.HasBlob("testblob"), True) def testCurrentWorkspaceWrapper(self): self.assertNotIn("testblob", workspace.C.Workspace.current.blobs) self.assertEqual( workspace.RunNetOnce(self.net.Proto().SerializeToString()), True) self.assertEqual(workspace.HasBlob("testblob"), True) self.assertIn("testblob", workspace.C.Workspace.current.blobs) workspace.ResetWorkspace() self.assertNotIn("testblob", workspace.C.Workspace.current.blobs) def testRunPlan(self): plan = core.Plan("test-plan") plan.AddStep(core.ExecutionStep("test-step", self.net)) self.assertEqual( workspace.RunPlan(plan.Proto().SerializeToString()), True) self.assertEqual(workspace.HasBlob("testblob"), True) def testRunPlanInBackground(self): plan = core.Plan("test-plan") plan.AddStep(core.ExecutionStep("test-step", self.net)) background_plan = workspace.RunPlanInBackground(plan) while not background_plan.is_done(): pass self.assertEqual(background_plan.is_succeeded(), True) self.assertEqual(workspace.HasBlob("testblob"), True) def testConstructPlanFromSteps(self): step = core.ExecutionStep("test-step-as-plan", self.net) self.assertEqual(workspace.RunPlan(step), True) self.assertEqual(workspace.HasBlob("testblob"), True) def testResetWorkspace(self): self.assertEqual( workspace.RunNetOnce(self.net.Proto().SerializeToString()), True) self.assertEqual(workspace.HasBlob("testblob"), True) self.assertEqual(workspace.ResetWorkspace(), True) self.assertEqual(workspace.HasBlob("testblob"), False) def testTensorAccess(self): ws = workspace.C.Workspace() """ test in-place modification """ ws.create_blob("tensor").feed(np.array([1.1, 1.2, 1.3])) tensor = ws.blobs["tensor"].tensor() tensor.data[0] = 3.3 val = np.array([3.3, 1.2, 1.3]) np.testing.assert_array_equal(tensor.data, val) np.testing.assert_array_equal(ws.blobs["tensor"].fetch(), val) """ test in-place initialization """ tensor.init([2, 3], core.DataType.INT32) for x in range(2): for y in range(3): tensor.data[x, y] = 0 tensor.data[1, 1] = 100 val = np.zeros([2, 3], dtype=np.int32) val[1, 1] = 100 np.testing.assert_array_equal(tensor.data, val) np.testing.assert_array_equal(ws.blobs["tensor"].fetch(), val) """ strings cannot be initialized from python """ with self.assertRaises(RuntimeError): tensor.init([3, 4], core.DataType.STRING) """ feed (copy) data into tensor """ val = np.array([[b'abc', b'def'], [b'ghi', b'jkl']], dtype=np.object) tensor.feed(val) self.assertEquals(tensor.data[0, 0], b'abc') np.testing.assert_array_equal(ws.blobs["tensor"].fetch(), val) val = np.array([1.1, 10.2]) tensor.feed(val) val[0] = 5.2 self.assertEquals(tensor.data[0], 1.1) """ fetch (copy) data from tensor """ val = np.array([1.1, 1.2]) tensor.feed(val) val2 = tensor.fetch() tensor.data[0] = 5.2 val3 = tensor.fetch() np.testing.assert_array_equal(val, val2) self.assertEquals(val3[0], 5.2) def testFetchFeedBlob(self): self.assertEqual( workspace.RunNetOnce(self.net.Proto().SerializeToString()), True) fetched = workspace.FetchBlob("testblob") # check if fetched is correct. self.assertEqual(fetched.shape, (1, 2, 3, 4)) np.testing.assert_array_equal(fetched, 1.0) fetched[:] = 2.0 self.assertEqual(workspace.FeedBlob("testblob", fetched), True) fetched_again = workspace.FetchBlob("testblob") self.assertEqual(fetched_again.shape, (1, 2, 3, 4)) np.testing.assert_array_equal(fetched_again, 2.0) def testFetchFeedBlobViaBlobReference(self): self.assertEqual( workspace.RunNetOnce(self.net.Proto().SerializeToString()), True) fetched = workspace.FetchBlob(self.testblob_ref) # check if fetched is correct. self.assertEqual(fetched.shape, (1, 2, 3, 4)) np.testing.assert_array_equal(fetched, 1.0) fetched[:] = 2.0 self.assertEqual(workspace.FeedBlob(self.testblob_ref, fetched), True) fetched_again = workspace.FetchBlob("testblob") # fetch by name now self.assertEqual(fetched_again.shape, (1, 2, 3, 4)) np.testing.assert_array_equal(fetched_again, 2.0) def testFetchFeedBlobTypes(self): for dtype in [np.float16, np.float32, np.float64, np.bool, np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16]: try: rng = np.iinfo(dtype).max * 2 except ValueError: rng = 1000 data = ((np.random.rand(2, 3, 4) - 0.5) * rng).astype(dtype) self.assertEqual(workspace.FeedBlob("testblob_types", data), True) fetched_back = workspace.FetchBlob("testblob_types") self.assertEqual(fetched_back.shape, (2, 3, 4)) self.assertEqual(fetched_back.dtype, dtype) np.testing.assert_array_equal(fetched_back, data) def testFetchFeedBlobBool(self): """Special case for bool to ensure coverage of both true and false.""" data = np.zeros((2, 3, 4)).astype(np.bool) data.flat[::2] = True self.assertEqual(workspace.FeedBlob("testblob_types", data), True) fetched_back = workspace.FetchBlob("testblob_types") self.assertEqual(fetched_back.shape, (2, 3, 4)) self.assertEqual(fetched_back.dtype, np.bool) np.testing.assert_array_equal(fetched_back, data) def testGetBlobSizeBytes(self): for dtype in [np.float16, np.float32, np.float64, np.bool, np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16]: data = np.random.randn(2, 3).astype(dtype) self.assertTrue(workspace.FeedBlob("testblob_sizeBytes", data), True) self.assertEqual( workspace.GetBlobSizeBytes("testblob_sizeBytes"), 6 * np.dtype(dtype).itemsize) strs1 = np.array([b'Hello World!', b'abcd']) strs2 = np.array([b'element1', b'element2']) strs1_len, strs2_len = 0, 0 for str in strs1: strs1_len += len(str) for str in strs2: strs2_len += len(str) self.assertTrue(workspace.FeedBlob("testblob_str1", strs1), True) self.assertTrue(workspace.FeedBlob("testblob_str2", strs2), True) # size of blob "testblob_str1" = size_str1 * meta_.itemsize() + strs1_len # size of blob "testblob_str2" = size_str2 * meta_.itemsize() + strs2_len self.assertEqual( workspace.GetBlobSizeBytes("testblob_str1") - workspace.GetBlobSizeBytes("testblob_str2"), strs1_len - strs2_len) def testFetchFeedBlobZeroDim(self): data = np.empty(shape=(2, 0, 3), dtype=np.float32) self.assertEqual(workspace.FeedBlob("testblob_empty", data), True) fetched_back = workspace.FetchBlob("testblob_empty") self.assertEqual(fetched_back.shape, (2, 0, 3)) self.assertEqual(fetched_back.dtype, np.float32) def testFetchFeedLongStringTensor(self): # long strings trigger array of object creation strs = np.array([ b' '.join(10 * [b'long string']), b' '.join(128 * [b'very long string']), b'small \0\1\2 string', b"Hello, world! I have special \0 symbols \1!"]) workspace.FeedBlob('my_str_tensor', strs) strs2 = workspace.FetchBlob('my_str_tensor') self.assertEqual(strs.shape, strs2.shape) for i in range(0, strs.shape[0]): self.assertEqual(strs[i], strs2[i]) def testFetchFeedShortStringTensor(self): # small strings trigger NPY_STRING array strs = np.array([b'elem1', b'elem 2', b'element 3']) workspace.FeedBlob('my_str_tensor_2', strs) strs2 = workspace.FetchBlob('my_str_tensor_2') self.assertEqual(strs.shape, strs2.shape) for i in range(0, strs.shape[0]): self.assertEqual(strs[i], strs2[i]) def testFetchFeedPlainString(self): # this is actual string, not a tensor of strings s = b"Hello, world! I have special \0 symbols \1!" workspace.FeedBlob('my_plain_string', s) s2 = workspace.FetchBlob('my_plain_string') self.assertEqual(s, s2) def testFetchBlobs(self): s1 = b"test1" s2 = b"test2" workspace.FeedBlob('s1', s1) workspace.FeedBlob('s2', s2) fetch1, fetch2 = workspace.FetchBlobs(['s1', 's2']) self.assertEquals(s1, fetch1) self.assertEquals(s2, fetch2) def testFetchFeedViaBlobDict(self): self.assertEqual( workspace.RunNetOnce(self.net.Proto().SerializeToString()), True) fetched = workspace.blobs["testblob"] # check if fetched is correct. self.assertEqual(fetched.shape, (1, 2, 3, 4)) np.testing.assert_array_equal(fetched, 1.0) fetched[:] = 2.0 workspace.blobs["testblob"] = fetched fetched_again = workspace.blobs["testblob"] self.assertEqual(fetched_again.shape, (1, 2, 3, 4)) np.testing.assert_array_equal(fetched_again, 2.0) self.assertTrue("testblob" in workspace.blobs) self.assertFalse("non_existant" in workspace.blobs) self.assertEqual(len(workspace.blobs), 1) for key in workspace.blobs: self.assertEqual(key, "testblob") class TestMultiWorkspaces(unittest.TestCase): def setUp(self): workspace.SwitchWorkspace("default") workspace.ResetWorkspace() def testCreateWorkspace(self): self.net = core.Net("test-net") self.net.ConstantFill([], "testblob", shape=[1, 2, 3, 4], value=1.0) self.assertEqual( workspace.RunNetOnce(self.net.Proto().SerializeToString()), True ) self.assertEqual(workspace.HasBlob("testblob"), True) self.assertEqual(workspace.SwitchWorkspace("test", True), None) self.assertEqual(workspace.HasBlob("testblob"), False) self.assertEqual(workspace.SwitchWorkspace("default"), None) self.assertEqual(workspace.HasBlob("testblob"), True) try: # The following should raise an error. workspace.SwitchWorkspace("non-existing") # so this should never happen. self.assertEqual(True, False) except RuntimeError: pass workspaces = workspace.Workspaces() self.assertTrue("default" in workspaces) self.assertTrue("test" in workspaces) @unittest.skipIf(not workspace.has_gpu_support and not workspace.has_hip_support, "No gpu support.") class TestWorkspaceGPU(test_util.TestCase): def setUp(self): workspace.ResetWorkspace() self.net = core.Net("test-net") self.net.ConstantFill([], "testblob", shape=[1, 2, 3, 4], value=1.0) self.net.RunAllOnGPU() def testFetchBlobGPU(self): self.assertEqual( workspace.RunNetOnce(self.net.Proto().SerializeToString()), True) fetched = workspace.FetchBlob("testblob") # check if fetched is correct. self.assertEqual(fetched.shape, (1, 2, 3, 4)) np.testing.assert_array_equal(fetched, 1.0) fetched[:] = 2.0 self.assertEqual(workspace.FeedBlob("testblob", fetched), True) fetched_again = workspace.FetchBlob("testblob") self.assertEqual(fetched_again.shape, (1, 2, 3, 4)) np.testing.assert_array_equal(fetched_again, 2.0) def testGetGpuPeerAccessPattern(self): pattern = workspace.GetGpuPeerAccessPattern() self.assertEqual(type(pattern), np.ndarray) self.assertEqual(pattern.ndim, 2) self.assertEqual(pattern.shape[0], pattern.shape[1]) self.assertEqual(pattern.shape[0], workspace.NumGpuDevices()) @unittest.skipIf(not workspace.C.use_mkldnn, "No MKLDNN support.") class TestWorkspaceIDEEP(test_util.TestCase): def testFeedFetchBlobIDEEP(self): arr = np.random.randn(2, 3).astype(np.float32) workspace.FeedBlob( "testblob_ideep", arr, core.DeviceOption(caffe2_pb2.IDEEP)) fetched = workspace.FetchBlob("testblob_ideep") np.testing.assert_array_equal(arr, fetched) class TestImmedibate(test_util.TestCase): def testImmediateEnterExit(self): workspace.StartImmediate(i_know=True) self.assertTrue(workspace.IsImmediate()) workspace.StopImmediate() self.assertFalse(workspace.IsImmediate()) def testImmediateRunsCorrectly(self): workspace.StartImmediate(i_know=True) net = core.Net("test-net") net.ConstantFill([], "testblob", shape=[1, 2, 3, 4], value=1.0) self.assertEqual( workspace.ImmediateBlobs(), ["testblob"]) content = workspace.FetchImmediate("testblob") # Also, the immediate mode should not invade the original namespace, # so we check if this is so. with self.assertRaises(RuntimeError): workspace.FetchBlob("testblob") np.testing.assert_array_equal(content, 1.0) content[:] = 2.0 self.assertTrue(workspace.FeedImmediate("testblob", content)) np.testing.assert_array_equal( workspace.FetchImmediate("testblob"), 2.0) workspace.StopImmediate() with self.assertRaises(RuntimeError): content = workspace.FetchImmediate("testblob") def testImmediateRootFolder(self): workspace.StartImmediate(i_know=True) # for testing we will look into the _immediate_root_folder variable # but in normal usage you should not access that. self.assertTrue(len(workspace._immediate_root_folder) > 0) root_folder = workspace._immediate_root_folder self.assertTrue(os.path.isdir(root_folder)) workspace.StopImmediate() self.assertTrue(len(workspace._immediate_root_folder) == 0) # After termination, immediate mode should have the root folder # deleted. self.assertFalse(os.path.exists(root_folder)) class TestCppEnforceAsException(test_util.TestCase): def testEnforce(self): op = core.CreateOperator("Relu", ["X"], ["Y"]) with self.assertRaises(RuntimeError): workspace.RunOperatorOnce(op) class TestCWorkspace(htu.HypothesisTestCase): def test_net_execution(self): ws = workspace.C.Workspace() self.assertEqual(ws.nets, {}) self.assertEqual(ws.blobs, {}) net = core.Net("test-net") net.ConstantFill([], "testblob", shape=[1, 2, 3, 4], value=1.0) ws.create_net(net) # If we do not specify overwrite, this should raise an error. with self.assertRaises(RuntimeError): ws.create_net(net) # But, if we specify overwrite, this should pass. ws.create_net(net, True) # Overwrite can also be a kwarg. ws.create_net(net, overwrite=True) self.assertIn("testblob", ws.blobs) self.assertEqual(len(ws.nets), 1) net_name = net.Proto().name self.assertIn("test-net", net_name) net = ws.nets[net_name].run() blob = ws.blobs["testblob"] np.testing.assert_array_equal( np.ones((1, 2, 3, 4), dtype=np.float32), blob.fetch()) @given(name=st.text(), value=st.floats(min_value=-1, max_value=1.0)) def test_operator_run(self, name, value): ws = workspace.C.Workspace() op = core.CreateOperator( "ConstantFill", [], [name], shape=[1], value=value) ws.run(op) self.assertIn(name, ws.blobs) np.testing.assert_allclose( [value], ws.blobs[name].fetch(), atol=1e-4, rtol=1e-4) @given(blob_name=st.text(), net_name=st.text(), value=st.floats(min_value=-1, max_value=1.0)) def test_net_run(self, blob_name, net_name, value): ws = workspace.C.Workspace() net = core.Net(net_name) net.ConstantFill([], [blob_name], shape=[1], value=value) ws.run(net) self.assertIn(blob_name, ws.blobs) self.assertNotIn(net_name, ws.nets) np.testing.assert_allclose( [value], ws.blobs[blob_name].fetch(), atol=1e-4, rtol=1e-4) @given(blob_name=st.text(), net_name=st.text(), plan_name=st.text(), value=st.floats(min_value=-1, max_value=1.0)) def test_plan_run(self, blob_name, plan_name, net_name, value): ws = workspace.C.Workspace() plan = core.Plan(plan_name) net = core.Net(net_name) net.ConstantFill([], [blob_name], shape=[1], value=value) plan.AddStep(core.ExecutionStep("step", nets=[net], num_iter=1)) ws.run(plan) self.assertIn(blob_name, ws.blobs) self.assertIn(net.Name(), ws.nets) np.testing.assert_allclose( [value], ws.blobs[blob_name].fetch(), atol=1e-4, rtol=1e-4) @given(blob_name=st.text(), net_name=st.text(), value=st.floats(min_value=-1, max_value=1.0)) def test_net_create(self, blob_name, net_name, value): ws = workspace.C.Workspace() net = core.Net(net_name) net.ConstantFill([], [blob_name], shape=[1], value=value) ws.create_net(net).run() self.assertIn(blob_name, ws.blobs) self.assertIn(net.Name(), ws.nets) np.testing.assert_allclose( [value], ws.blobs[blob_name].fetch(), atol=1e-4, rtol=1e-4) @given(name=st.text(), value=htu.tensor(), device_option=st.sampled_from(htu.device_options)) def test_array_serde(self, name, value, device_option): ws = workspace.C.Workspace() ws.create_blob(name).feed(value, device_option=device_option) self.assertIn(name, ws.blobs) blob = ws.blobs[name] np.testing.assert_equal(value, ws.blobs[name].fetch()) serde_blob = ws.create_blob("{}_serde".format(name)) serde_blob.deserialize(blob.serialize(name)) np.testing.assert_equal(value, serde_blob.fetch()) @given(name=st.text(), value=st.text()) def test_string_serde(self, name, value): value = value.encode('ascii', 'ignore') ws = workspace.C.Workspace() ws.create_blob(name).feed(value) self.assertIn(name, ws.blobs) blob = ws.blobs[name] self.assertEqual(value, ws.blobs[name].fetch()) serde_blob = ws.create_blob("{}_serde".format(name)) serde_blob.deserialize(blob.serialize(name)) self.assertEqual(value, serde_blob.fetch()) def test_exception(self): ws = workspace.C.Workspace() with self.assertRaises(TypeError): ws.create_net("...") class TestPredictor(unittest.TestCase): def _create_model(self): m = model_helper.ModelHelper() y = brew.fc(m, "data", "y", dim_in=4, dim_out=2, weight_init=('ConstantFill', dict(value=1.0)), bias_init=('ConstantFill', dict(value=0.0)), axis=0) m.net.AddExternalOutput(y) return m # Use this test with a bigger model to see how using Predictor allows to # avoid issues with low protobuf size limit in Python # # def test_predictor_predefined(self): # workspace.ResetWorkspace() # path = 'caffe2/caffe2/test/assets/' # with open(path + 'squeeze_predict_net.pb') as f: # self.predict_net = f.read() # with open(path + 'squeeze_init_net.pb') as f: # self.init_net = f.read() # self.predictor = workspace.Predictor(self.init_net, self.predict_net) # inputs = [np.zeros((1, 3, 256, 256), dtype='f')] # outputs = self.predictor.run(inputs) # self.assertEqual(len(outputs), 1) # self.assertEqual(outputs[0].shape, (1, 1000, 1, 1)) # self.assertAlmostEqual(outputs[0][0][0][0][0], 5.19026289e-05) def test_predictor_memory_model(self): workspace.ResetWorkspace() m = self._create_model() workspace.FeedBlob("data", np.zeros([4], dtype='float32')) self.predictor = workspace.Predictor( workspace.StringifyProto(m.param_init_net.Proto()), workspace.StringifyProto(m.net.Proto())) inputs = np.array([1, 3, 256, 256], dtype='float32') outputs = self.predictor.run([inputs]) np.testing.assert_array_almost_equal( np.array([[516, 516]], dtype='float32'), outputs) class TestTransform(htu.HypothesisTestCase): @given(input_dim=st.integers(min_value=1, max_value=10), output_dim=st.integers(min_value=1, max_value=10), batch_size=st.integers(min_value=1, max_value=10)) def test_simple_transform(self, input_dim, output_dim, batch_size): m = model_helper.ModelHelper() fc1 = brew.fc(m, "data", "fc1", dim_in=input_dim, dim_out=output_dim) fc2 = brew.fc(m, fc1, "fc2", dim_in=output_dim, dim_out=output_dim) conv = brew.conv(m, fc2, "conv", dim_in=output_dim, dim_out=output_dim, use_cudnn=True, engine="CUDNN", kernel=3) conv.Relu([], conv)\ .Softmax([], "pred") \ .LabelCrossEntropy(["label"], ["xent"]) \ .AveragedLoss([], "loss") transformed_net_proto = workspace.ApplyTransform( "ConvToNNPack", m.net.Proto()) self.assertEqual(transformed_net_proto.op[2].engine, "NNPACK") @given(input_dim=st.integers(min_value=1, max_value=10), output_dim=st.integers(min_value=1, max_value=10), batch_size=st.integers(min_value=1, max_value=10)) def test_registry_invalid(self, input_dim, output_dim, batch_size): m = model_helper.ModelHelper() brew.fc(m, "data", "fc1", dim_in=input_dim, dim_out=output_dim) with self.assertRaises(RuntimeError): workspace.ApplyTransform( "definitely_not_a_real_transform", m.net.Proto()) @given(value=st.floats(min_value=-1, max_value=1)) def test_apply_transform_if_faster(self, value): init_net = core.Net("init_net") init_net.ConstantFill([], ["data"], shape=[5, 5, 5, 5], value=value) init_net.ConstantFill([], ["conv_w"], shape=[5, 5, 3, 3], value=value) init_net.ConstantFill([], ["conv_b"], shape=[5], value=value) self.assertEqual( workspace.RunNetOnce(init_net.Proto().SerializeToString()), True) m = model_helper.ModelHelper() conv = brew.conv(m, "data", "conv", dim_in=5, dim_out=5, kernel=3, use_cudnn=True, engine="CUDNN") conv.Relu([], conv)\ .Softmax([], "pred") \ .AveragedLoss([], "loss") self.assertEqual( workspace.RunNetOnce(m.net.Proto().SerializeToString()), True) proto = workspace.ApplyTransformIfFaster( "ConvToNNPack", m.net.Proto(), init_net.Proto()) self.assertEqual( workspace.RunNetOnce(proto.SerializeToString()), True) proto = workspace.ApplyTransformIfFaster( "ConvToNNPack", m.net.Proto(), init_net.Proto(), warmup_runs=10, main_runs=100, improvement_threshold=2.0) self.assertEqual( workspace.RunNetOnce(proto.SerializeToString()), True) if __name__ == '__main__': unittest.main()
[ "ryfeus@gmail.com" ]
ryfeus@gmail.com
4b063dac8fbb9c047f40f60e35b317e14d6ab716
ba2f34ff8a7b2c36ae88a2f02ca495ad084bb6ab
/Cryptanalysis/break_autokey.py
aecc051205c004e9a18d31b229c6ec47d72a3899
[ "MIT" ]
permissive
BlackLuny/cyberweapons
bc05e07cdc67f58c9cf68178762eb541c8c0cc55
dfd4623f323ba702bae7c9f71132b4584636d2e5
refs/heads/master
2021-05-16T07:28:35.651835
2017-09-16T21:04:50
2017-09-16T21:04:50
103,801,285
1
0
null
2017-09-17T03:50:18
2017-09-17T03:50:18
null
UTF-8
Python
false
false
2,037
py
from ngram_score import ngram_score from pycipher import Autokey import re from itertools import permutations qgram = ngram_score('quadgrams.txt') trigram = ngram_score('trigrams.txt') ctext = 'isjiqymdebvuzrvwhmvysibugzhyinmiyeiklcvioimbninyksmmnjmgalvimlhspjxmgfiraqlhjcpvolqmnyynhpdetoxemgnoxl' ctext = re.sub(r'[^A-Z]','',ctext.upper()) # keep a list of the N best things we have seen, discard anything else class nbest(object): def __init__(self,N=1000): self.store = [] self.N = N def add(self,item): self.store.append(item) self.store.sort(reverse=True) self.store = self.store[:self.N] def __getitem__(self,k): return self.store[k] def __len__(self): return len(self.store) #init N=100 for KLEN in range(3,20): rec = nbest(N) for i in permutations('ABCDEFGHIJKLMNOPQRSTUVWXYZ',3): key = ''.join(i) + 'A'*(KLEN-len(i)) pt = Autokey(key).decipher(ctext) score = 0 for j in range(0,len(ctext),KLEN): score += trigram.score(pt[j:j+3]) rec.add((score,''.join(i),pt[:30])) next_rec = nbest(N) for i in range(0,KLEN-3): for k in xrange(N): for c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ': key = rec[k][1] + c fullkey = key + 'A'*(KLEN-len(key)) pt = Autokey(fullkey).decipher(ctext) score = 0 for j in range(0,len(ctext),KLEN): score += qgram.score(pt[j:j+len(key)]) next_rec.add((score,key,pt[:30])) rec = next_rec next_rec = nbest(N) bestkey = rec[0][1] pt = Autokey(bestkey).decipher(ctext) bestscore = qgram.score(pt) for i in range(N): pt = Autokey(rec[i][1]).decipher(ctext) score = qgram.score(pt) if score > bestscore: bestkey = rec[i][1] bestscore = score print bestscore,'autokey, klen',KLEN,':"'+bestkey+'",',Autokey(bestkey).decipher(ctext)
[ "suhubdyd@iro.umontreal.ca" ]
suhubdyd@iro.umontreal.ca
ed3c99f2709fd2753544bd1b93f0e87ed80b5d91
d4a30e390ddada1da154a65319c52efd1711df93
/net/dataset/UCSDPed2.py
b4c13c17125b88ca897e9dfcfd11c071d7fe5c7e
[]
no_license
sdjsngs/Re-implement-Memorizing-Normality-to-Detect-Anomaly
a1d1323d9473af2a12df94f0f2d4a1cc22bc0560
81b8b328a56d4db9be283348febbc7f2ce8edbb0
refs/heads/master
2022-12-03T13:10:53.963794
2020-08-18T12:18:15
2020-08-18T12:18:15
286,999,990
2
0
null
null
null
null
UTF-8
Python
false
false
3,019
py
import torch import torch.nn as nn from torch.utils.data import Dataset,DataLoader import os import glob import cv2 import numpy as np from net.dataset.build import DATASET_REGISTRY from net.utils.parser import parse_args,load_config @DATASET_REGISTRY.register() class Ucsdped2(Dataset): """ Uscdped2 dataset It has 16 short clips for training, and another 12 clips for testing. Each clip has 150 to 200 frames, with a resolution of 360 × 240 pixels training -frames -01 -000.jpg """ def __init__(self,cfg,mode): assert mode in ["train","training","test","testing"] self.data_root=cfg.PED.PATH_TO_DATA_DIR self.mode=mode+"ing" self.temporal_length=cfg.TEMPORAL_LENGTH self._consturct() def _consturct(self): """ recode img path :return: """ self.img_paths=[] for num_folder in os.listdir(os.path.join(self.data_root,self.mode,"frames")): folder_img=sorted(glob.glob( os.path.join(self.data_root,self.mode,"frames",num_folder,"*.jpg").replace("\\","/") )) self.img_paths+=folder_img[self.temporal_length//2:(-self.temporal_length//2+1)] def __len__(self): return len(self.img_paths) def __getitem__(self, index): video, video_idx = self.load_img_to_gray(self.img_paths[index]) video = torch.from_numpy(video) video = video.unsqueeze(dim=0) if self.mode in ["train", "training"]: return video elif self.mode in ["test", "testing"]: return video, video_idx else: raise NotImplementedError( "mode {} is not supported".format(self.mode) ) def load_img_to_gray(self, path): # resize h,w 192,128 # print("path", path) img_num = int(path.split("\\")[-1].split(".")[0]) video_idx = (path.split("\\")[0].split("/")[-1]) for step, i in enumerate(range(-(self.temporal_length // 2), self.temporal_length // 2)): img_num_i = img_num + i str_img_num_i = "%03d" % img_num_i # len 3 for each frame path_i = path.split("\\")[0] + "/" + str_img_num_i + ".jpg" img = cv2.imread(path_i) img = cv2.resize(img, (224, 224)) img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) img = img / 255.0 if step == 0: imgs = np.expand_dims(img, axis=0) else: imgs = np.concatenate((imgs, np.expand_dims(img, axis=0)), axis=0) return imgs, video_idx if __name__=="__main__": args=parse_args() cfg=load_config(args) print(type(cfg)) data_loader=DataLoader(Ucsdped2(cfg,mode="train"),batch_size=2,shuffle=False) for step ,(video) in enumerate(data_loader): print("step",step) print(video.shape)
[ "noreply@github.com" ]
sdjsngs.noreply@github.com
3fc97e102abb0f9b9d730e7922bc86b82eb1eb4e
2207f2caed5b22e24de2a9c5379f9a8d043d73dd
/modules/scn/rule.py
81be3410451c7e2b1de97569943cd7949de845b0
[]
no_license
996refuse/tlf
775ddd198eb99d794918b757a4c5e97da13e31b5
f0ed39ecd96a7cfa6eb85e56fdcc200016888d88
refs/heads/master
2021-05-30T14:01:08.531186
2015-07-04T05:22:39
2015-07-04T05:22:39
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,063
py
#-*-encoding=utf-8-*- rule = ( { "type": "fetch", "name": "pager", "type": "fetch", "repeat": 20000, "from": { "http://www.s.cn/list": "//div[@class='clearfix']/table/tr/td[@class='pagernum']/a[last()]", }, "dst": { "type": "list", "name": "scn_list", }, "get": { "type": "simple", "method": "get", "parser": "scn.pager", }, "test": [ { "url": "http://www.s.cn/list", "check": "module_test" } ] }, { "type": "fetch", "name": "list", "wait": 4, "src": { "type": "list", "name": "scn_list", "batch": 30, "filter": "scn.list_filter", }, "rule": { "node": "//div[@class='product_list']/dl", "gidurl": "dd/a/@href", "price": "dd/a/ul/li[@class='r1']/i[@class='price']", }, "dst": { "type": "list", "name": "scn_stock", }, "get": { "method": "get", "parser": "scn.list_parser", "args": { "limit": 30, "interval": 1, "debug": False } }, "test": [ { "url": "http://www.s.cn/list/pg66", "check": "module_test" }, { "url": "http://www.s.cn/list/pg23", "check": "module_test" }, { "url": "http://www.s.cn/list/pg79", "check": "module_test" }, ] }, { "name": "stock", "type": "fetch", "wait": 4, "src": { "name": "scn_stock", "type": "list", "batch": 16, "group": True, "filter": "scn.stock_task_filter" }, "rule": "//div[@class='buyinfo_bot']//span[@class='store']", "get": { "method": "get", "parser": "scn.stock_parser", "args": { "limit": 1, "interval": 2, "debug": False, "timeout": 10, }, "not200": "log", "randua": True }, "dst": { "name": "spider_result", "type": "list", }, "test": [ { "url": "http://www.s.cn/kappa-K0422TD04-990.html", "price": "233", "check": "module_test_stock" } ] } )
[ "lux.r.ck@gmail.com" ]
lux.r.ck@gmail.com
41aff2c6737092010ed79ff48e2c3cf747e6eaac
2f7bf9f8c382e433f02b75b568be0ca0e3e800a6
/Assignment/Course 2 - Python Data Structures/Week 4 - Lists/8.5.py
58d76b99d61ab9c2300311df21a501e8202521b2
[]
no_license
KhangNLY/Py4E
ad9f2d84bb48ff425d2e349bc6e764d5a62b9558
2437fbb028531f329c5d637c280d031827ab85c0
refs/heads/main
2023-05-05T22:48:44.433965
2021-05-24T06:34:05
2021-05-24T06:34:05
362,573,133
1
0
null
null
null
null
UTF-8
Python
false
false
362
py
fname = input("Enter file name: ") if len(fname) < 1: fname = "mbox-short.txt" fh = open(fname) count = 0 for line in fh: line = line.rstrip() wrd = line.split() if len(wrd) < 3 or wrd[0] != 'From': continue print(wrd[1]) count = count + 1 print("There were", count, "lines in the file with From as the first word")
[ "noreply@github.com" ]
KhangNLY.noreply@github.com
de85996500552c3c31ab52ff302a8b2b4c6a6c77
a34cc0ac718b8e5f62b814599449fe387ee3f600
/obj.py
f40d437feb5d393d09ab924debb3e91e457e3a4b
[]
no_license
luizphell/flappybird
a2a06ee21363d21044dd13f045c8a77c74c01ba1
96bd82b7186421b15ea633faedaec42c4add5a82
refs/heads/main
2023-07-11T14:35:53.858069
2021-07-29T20:05:57
2021-07-29T20:05:57
390,837,572
1
0
null
null
null
null
UTF-8
Python
false
false
3,168
py
import pygame # Objeto criado para inserir os itens do cenário. class Obj(pygame.sprite.Sprite): def __init__(self, image, x, y, *groups): super().__init__(*groups) self.image = pygame.image.load(image) self.rect = self.image.get_rect() self.rect[0] = x self.rect[1] = y # Objeto com movimento. class Pipe(Obj): def __init__(self, image, x, y, *groups): # Recebe as mesmas características do Obj. super().__init__(image, x, y, *groups) def update(self, *args): self.move() def move(self): # Movimento dos canos. self.rect[0] -= 3 # Velocidade. if self.rect[0] <= -100: self.kill() # Adicionar a recompensa. class Coin(Obj): def __init__(self, image, x, y, *groups): super().__init__(image, x, y, *groups) self.time = 0 def update(self, *args): self.move() self.anim() def move(self): self.rect[0] -= 3 if self.rect[0] <= -100: self.kill() def anim(self): # Animação das imagens. self.time = (self.time + 1) % 6 self.image = pygame.image.load('Flappy_Image/' + str(self.time) + '.png') class Dragon(Obj): def __init__(self, image, x, y, *groups): super().__init__(image, x, y, *groups) self.time = 0 self.vel = 3 self.grav = 1 self.pts = 0 self.play = True def update(self, *args): self.anim() self.move() def anim(self): self.time = (self.time + 1) % 4 self.image = pygame.image.load('Flappy_Image/Dragon' + str(self.time) + '.png') def move(self): tecla = pygame.key.get_pressed() self.vel += self.grav # Adição da gravidade. self.rect[1] += self.vel if self.vel >= 10: # Controle da velocidade. self.vel = 10 if self.play: if tecla[pygame.K_SPACE]: # Interação com o player. self.vel -= 4 if self.rect[1] >= 650: # Limite do chão e do teto. self.rect[1] = 650 elif self.rect[1] <= 0: self.rect[1] = 0 self.vel = 3 def colision_pipes(self, group): # Colisões e consequências. col = pygame.sprite.spritecollide(self, group, False) if col: self.play = False def colision_coin(self, group): col = pygame.sprite.spritecollide(self, group, True) if col: self.pts += 1 # Objeto para criar textos: class Text: def __init__(self, size, text): self.init = pygame.font.init() self.font = pygame.font.Font('Flappy_Image/font/font.ttf', size) self.render = self.font.render(text, True, (255, 255, 255)) def draw(self, window, x, y): window.blit(self.render, (x, y)) def text_update(self, text): self.render = self.font.render(text, True, (255, 255, 255))
[ "noreply@github.com" ]
luizphell.noreply@github.com
d0ef3875dacf26faa8a57ab61cd4c8a9652e60f1
fc2bbd676723b2f02372d8d46f7af04b86a0239d
/data/users.py
57e8b636b3ad5abf5f19fa7cbb27b9186a0e2528
[]
no_license
Dashapep/eco_events
dede134b2719065bdf1f0c1b545bbbcc6f3e6464
b2bc4657c63809e4d210b186e685fe18e4603a76
refs/heads/master
2023-04-24T04:53:52.995161
2021-04-25T20:18:06
2021-04-25T20:18:06
356,005,500
1
0
null
null
null
null
UTF-8
Python
false
false
1,352
py
import datetime import sqlalchemy from flask_login import UserMixin from sqlalchemy import orm from werkzeug.security import generate_password_hash, check_password_hash from .db_session import SqlAlchemyBase class User(SqlAlchemyBase, UserMixin): __tablename__ = 'users' id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True, autoincrement=True) surname = sqlalchemy.Column(sqlalchemy.String, nullable=True) name = sqlalchemy.Column(sqlalchemy.String, nullable=True) age = sqlalchemy.Column(sqlalchemy.Integer, nullable=True) speciality = sqlalchemy.Column(sqlalchemy.String, nullable=True) address = sqlalchemy.Column(sqlalchemy.String, nullable=True) email = sqlalchemy.Column(sqlalchemy.String, index=True, unique=True, nullable=True) hashed_password = sqlalchemy.Column(sqlalchemy.String, nullable=True) modifed_date = sqlalchemy.Column(sqlalchemy.DateTime, default=datetime.datetime.now) moderator = sqlalchemy.Column(sqlalchemy.Boolean, default=False) events = orm.relation("Events", back_populates='user') def __repr__(self): return f'{self.name} {self.surname}' def set_password(self, password): self.hashed_password = generate_password_hash(password) def check_password(self, password): return check_password_hash(self.hashed_password, password)
[ "pds032005@gmail.com" ]
pds032005@gmail.com
24a1fa69059a7cec4d3e8887cf77bb3af70cf7a0
3321f0187988caee9598f8d9057d44100adbdeee
/catkin_ws/src/vision/flir_gige/math/conversion.py
9705f898410fedace690c9e3ea50905e50d7e86c
[]
no_license
TRA-UNAM/FinderV3
8c00aa71485a978805da08a7d1c47d5b175971ee
1d02366b60684ae1c2ceb129aacc982fe798b105
refs/heads/master
2022-09-30T02:55:44.931614
2022-09-23T01:20:09
2022-09-23T01:20:09
162,857,050
0
5
null
2020-06-04T00:49:57
2018-12-23T02:41:42
C++
UTF-8
Python
false
false
506
py
from math import exp, log def raw_to_celsius(S, B, F, O, R, T0): return (B / log(R / (S - O) + F) - T0) def celsius_to_raw(t, B, F, O, R, T0): return ((R / exp(B / (t + T0)) - F) + O) B = 1428.0 F = 1.0 O = 118.126 R = 377312.0 T0 = 273.15 celsius = [10, 20, 30, 40, 50] raw = []; celcius_converted = [] for t in celsius: raw.append(celsius_to_raw(t, B, F, O, R, T0)) for s in raw: celcius_converted.append(raw_to_celsius(s, B, F, O, R, T0)) for t in celcius_converted: print(t)
[ "ehecatl.eli.ba@gmail.com" ]
ehecatl.eli.ba@gmail.com
cfbfd2570f3a5206ef819cd60bf529623f457ea6
5cf44be60a9accc2aa8b0cea1c8790f023b10553
/build/lib.linux-x86_64-2.7/npmc/read_lmp_rev6.py
81b0019083c0c77e1812632221debd29092da719
[]
no_license
smerz1989/np-mc
7ecc36864a1975bde42d0ddf579e8a1bb9666de9
3d13104edf1b36f0817928f262a0b9ae40f6bfb1
refs/heads/master
2023-07-20T03:25:48.891576
2023-03-07T20:55:58
2023-03-07T20:55:58
37,389,780
0
2
null
2023-07-06T21:15:55
2015-06-13T22:14:58
Python
UTF-8
Python
false
false
16,951
py
#!/usr/bin/python import sys import numpy as np import string from math import * import random as rnd from subprocess import call import itertools as itt def readAtoms(filename): input = open(filename,"r") print "reading file " + filename currentId=0 line = input.readline() out = line.find("atoms") while(out==-1): line = input.readline() out = line.find("atoms") print line numwords = line.split() numatms = int(numwords[0]) atoms = np.zeros((numatms,7)) while(input.readline().find("Atoms")==-1): continue input.readline() line=input.readline for j in range(numatms): line=input.readline() record = line.split() for i in range(7): if i<3: atoms[j,i]=int(record[i]) else: atoms[j,i]=float(record[i]) return atoms def readBonds(filename): input = open(filename,"r") print "reading file " + filename currentId=0 line = input.readline() out = line.find("bonds") while(out==-1): line = input.readline() out = line.find("bonds") print line numwords = line.split() numbonds = int(numwords[0]) bonds = np.zeros((numbonds,4)) while(input.readline().find("Bonds")==-1): continue input.readline() line=input.readline for j in range(numbonds): line=input.readline() record = line.split() for i in range(4): bonds[j,i]=int(record[i]) return bonds def readAngles(filename): input = open(filename,"r") print "reading file " + filename currentId=0 line = input.readline() out = line.find("angles") while(out==-1): line = input.readline() out = line.find("angles") print line numwords = line.split() numangles = int(numwords[0]) angles = np.zeros((numangles,5)) while(input.readline().find("Angles")==-1): continue input.readline() line=input.readline for j in range(numangles): line=input.readline() record = line.split() for i in range(5): angles[j,i]=int(record[i]) return angles def readDihedrals(filename): input = open(filename,"r") print "reading file " + filename currentId=0 line = input.readline() out = line.find("dihedrals") while(out==-1): line = input.readline() out = line.find("dihedrals") print line numwords = line.split() numdiheds = int(numwords[0]) diheds = np.zeros((numdiheds,6)) while(input.readline().find("Dihedrals")==-1): continue input.readline() line=input.readline for j in range(numdiheds): line=input.readline() record = line.split() for i in range(6): diheds[j,i]=int(record[i]) return diheds def readAll(inputfile): atoms=readAtoms(inputfile) bonds=readBonds(inputfile) angles=readAngles(inputfile) diheds=readDihedrals(inputfile) return (atoms,bonds,angles,diheds) def deleteMolecule(atoms,bonds,angles,diheds,molId): molatoms=atoms[atoms[:,1]==molId][:,0] molbonds = np.array([]) molangles = np.array([]) moldiheds = np.array([]) for atom in molatoms: molbonds = np.union1d(molbonds,np.where(((bonds[:,2]==atom)|(bonds[:,3]==atom)))[0]) molangles = np.union1d(molangles,np.where(((angles[:,2]==atom)|(angles[:,3]==atom)|(angles[:,4]==atom)))[0]) moldiheds = np.union1d(moldiheds,np.where(((diheds[:,2]==atom)|(diheds[:,3]==atom)|(diheds[:,4]==atom)|(diheds[:,5]==atom)))[0]) newatoms=np.delete(atoms,np.where((atoms[:,1]==molId))[0],0) newbonds=np.delete(bonds,molbonds,0) newangles=np.delete(angles,molangles,0) newdiheds=np.delete(diheds,moldiheds,0) return (newatoms,newbonds,newangles,newdiheds) def addMolecule(molecules,newmolecule): atoms=molecules[0] bonds=molecules[1] angles=molecules[2] diheds=molecules[3] replacelist=[] lastAtmId = np.amax(atoms[:,0]) if atoms.size>0 else 0 lastMolId = np.amax(atoms[:,1]) if atoms.size>0 else 0 lastBondId = np.amax(bonds[:,0]) if bonds.size>0 else 0 lastAngleId = np.amax(angles[:,0]) if angles.size>0 else 0 lastDihedId = np.amax(diheds[:,0]) if diheds.size>0 else 0 for i in range(len(newmolecule[0][:,0])): oldid=newmolecule[0][i,0] newmolecule[0][i,0]=lastAtmId+i+1 replacelist.append((oldid,newmolecule[0][i,0])) newmolecule[0][i,1]=lastMolId+1 for i in range(len(newmolecule[1][:,0])): newmolecule[1][i,0]=lastBondId+i+1 if(newmolecule[1][i,2] in [x[0] for x in replacelist]): newid = [x[1] for x in replacelist if x[0]==newmolecule[1][i,2]] newmolecule[1][i,2]=newid[0] if(newmolecule[1][i,3] in [x[0] for x in replacelist]): newid = [x[1] for x in replacelist if x[0]==newmolecule[1][i,3]] newmolecule[1][i,3]=newid[0] for i in range(len(newmolecule[2][:,0])): newmolecule[2][i,0]=lastAngleId+i+1 if(newmolecule[2][i,2] in [x[0] for x in replacelist]): newid = [x[1] for x in replacelist if x[0]==newmolecule[2][i,2]] newmolecule[2][i,2]=newid[0] if(newmolecule[2][i,3] in [x[0] for x in replacelist]): newid = [x[1] for x in replacelist if x[0]==newmolecule[2][i,3]] newmolecule[2][i,3]=newid[0] if(newmolecule[2][i,4] in [x[0] for x in replacelist]): newid = [x[1] for x in replacelist if x[0]==newmolecule[2][i,4]] newmolecule[2][i,4]=newid[0] for i in range(len(newmolecule[3][:,0])): newmolecule[3][i,0]=lastDihedId+i+1 if(newmolecule[3][i,2] in [x[0] for x in replacelist]): newid = [x[1] for x in replacelist if x[0]==newmolecule[3][i,2]] newmolecule[3][i,2]=newid[0] if(newmolecule[3][i,3] in [x[0] for x in replacelist]): newid = [x[1] for x in replacelist if x[0]==newmolecule[3][i,3]] newmolecule[3][i,3]=newid[0] if(newmolecule[3][i,4] in [x[0] for x in replacelist]): newid = [x[1] for x in replacelist if x[0]==newmolecule[3][i,4]] newmolecule[3][i,4]=newid[0] if(newmolecule[3][i,5] in [x[0] for x in replacelist]): newid = [x[1] for x in replacelist if x[0]==newmolecule[3][i,5]] newmolecule[3][i,5]=newid[0] atoms=np.append(atoms,newmolecule[0],0) bonds=np.append(bonds,newmolecule[1],0) angles=np.append(angles,newmolecule[2],0) diheds=np.append(diheds,newmolecule[3],0) return (atoms,bonds,angles,diheds) def selectMolecule(molecules,molId): molBonds=np.array([]) molAngles=np.array([]) molDiheds=np.array([]) atoms=molecules[0] bonds=molecules[1] angles=molecules[2] diheds=molecules[3] molatoms=atoms[atoms[:,1]==molId][:,0] for atom in molatoms: molBonds=np.union1d(molBonds,np.where(((bonds[:,2]==atom)|(bonds[:,3]==atom)))[0]) molAngles=np.union1d(molAngles,np.where(((angles[:,2]==atom)|(angles[:,3]==atom)|(angles[:,4]==atom)))[0]) molDiheds=np.union1d(molDiheds,np.where(((diheds[:,2]==atom)|(diheds[:,3]==atom)|(diheds[:,4]==atom)|(diheds[:,5]==atom)))[0]) molBonds=molBonds.astype(int) molAngles=molAngles.astype(int) molDiheds=molDiheds.astype(int) newatoms=atoms[atoms[:,1]==molId] newbonds=np.take(bonds,molBonds,0) newangles=np.take(angles,molAngles,0) newdiheds=np.take(diheds,molDiheds,0) return (newatoms,newbonds,newangles,newdiheds) def shiftMolecule(atoms,indices,shiftx,shifty,shiftz): numatms=len(indices) #print "Starting shift by " + str(shiftx)+"x, "+str(shifty)+"y and "+str(shiftz)+"original positions are:" #print(atoms[indices,:]) for i in range(numatms): atoms[indices[i],4]+=shiftx atoms[indices[i],5]+=shifty atoms[indices[i],6]+=shiftz #print "finished shifting atoms the new coordinates are:" #print(atoms[indices,:]) def rotateMolecule(atoms,indices,theta,phi): numatoms = len(indices) theta = theta phi = phi rotateZ = np.array([[cos(theta),-sin(theta),0],[sin(theta),cos(theta),0],[0,0,1]]) rotateY = np.array([[cos(phi),0,sin(phi)],[0,1,0],[-sin(phi),0,cos(phi)]]) for i in range(numatoms): firstRotate = np.dot(rotateY,np.transpose(atoms[indices[i],[4,5,6]])) secondRotate = np.dot(rotateZ,np.transpose(atoms[indices[i],[4,5,6]])) atoms[indices[i],[4,5,6]]=np.transpose(secondRotate) def calcCOM(atoms,indices): mass = [107.8682,14,15,32.065,16,1] numatms = len(indices) totalmass=0 x=0 y=0 z=0 for i in range(numatms): atommass = mass[int(atoms[indices[i],2])-1] #print "Atom is of type "+str(int(atoms[indices[i],2]))+" and a mass of "+str(atommass)+"with coordinates "+str(atoms[indices[i],4])+"x, "+str(atoms[indices[i],5])+"y and "+str(atoms[indices[i],6])+"z" x+=atommass*atoms[indices[i],4] y+=atommass*atoms[indices[i],5] z+=atommass*atoms[indices[i],6] totalmass+=atommass #print "COM is "+str(x/totalmass)+"x, "+str(y/totalmass)+"y and "+str(z/totalmass) return np.array([x/totalmass,y/totalmass,z/totalmass]) def rotateAxis(olddir,newdir): axis = np.cross(olddir,newdir) axis = axis/np.linalg.norm(axis) theta = acos(np.dot(olddir,newdir)/(np.linalg.norm(olddir)*np.linalg.norm(newdir))) skewmat = np.array([[0,-axis[2],axis[1]],[axis[2],0,-axis[0]],[-axis[1],axis[0],0]]) R = np.identity(3) + sin(theta)*skewmat+(1-cos(theta))*np.linalg.matrix_power(skewmat,2) return R def comRotation(a,b): v = np.cross(a,b) vX = np.array([[0,-v[2],v[1]],[v[2],0,-v[0]],[-v[1],v[0],0]]) s = np.linalg.norm(v) c = np.dot(a,b) print "normalization is "+str(((1-c)/(s**2))) R = np.identity(3) + vX +np.linalg.matrix_power(vX,2)*((1-c)/(s**2)) return R def swapMolecules(molId1,molId2,atoms,centerRotation): atoms1 = np.where((atoms[:,1]==molId1))[0] #print(atoms1) atoms2 = np.where((atoms[:,1]==molId2))[0] #print(atoms2) sulfur1 = atoms[(atoms[:,1]==molId1) & (atoms[:,2]==float(4))] #print "Found 1st sulfur" #print(sulfur1) sulfur2 = atoms[(atoms[:,1]==molId2) & (atoms[:,2]==float(4))] #print "Found 2nd sulfur" #print(sulfur2) x1 = sulfur1[0,4]-centerRotation[0] x2 = sulfur2[0,4]-centerRotation[0] y1 = sulfur1[0,5]-centerRotation[1] y2 = sulfur2[0,5]-centerRotation[1] z1 = sulfur1[0,6]-centerRotation[2] z2 = sulfur2[0,6]-centerRotation[2] phi1 = atan2(y1,x1) phi2 = atan2(y2,x2) theta1 = acos(z1/sqrt(x1**2+y1**2+z1**2)) theta2 = acos(z2/sqrt(x2**2+y2**2+z2**2)) shiftX = x2 - x1 shiftY = y2 - y1 shiftZ = z2 - z1 shiftTheta = theta2-theta1 shiftPhi = phi2-phi1 shiftMolecule(atoms,atoms1,shiftX,shiftY,shiftZ) shiftMolecule(atoms,atoms2,-shiftX,-shiftY,-shiftZ) com1=calcCOM(atoms,atoms1) a1 = com1-sulfur2[0,4:7] b1 = np.array([sin(theta2)*cos(phi2),sin(theta2)*sin(phi2),cos(theta2)]) com2=calcCOM(atoms,atoms2) a2 = com2-sulfur1[0,4:7] b2 = np.array([sin(theta1)*cos(phi1),sin(theta1)*sin(phi1),cos(theta1)]) #rotateMolecule(atoms,atoms1,shiftTheta,shiftPhi) atoms[atoms1,4:7]-=sulfur2[0,4:7] #print(atoms[atoms1,4:7]) #print(comRotation(a1,b1)) for i in range(len(atoms1)): #print "coordinates before rotation" #print atoms[atoms1[i],4:7] atoms[atoms1[i],4:7]=np.dot(rotateAxis(a1,b1),np.transpose(atoms[atoms1[i],[4,5,6]])) #print "coordinates after" #print atoms[atoms1[i],4:7] atoms[atoms1,4:7]+=sulfur2[0,4:7] #rotateMolecule(atoms,atoms2,-shiftTheta,-shiftPhi) atoms[atoms2,4:7]-=sulfur1[0,4:7] #print(atoms[atoms2,4:7]) for i in range(len(atoms2)): atoms[atoms2[i],4:7]=np.dot(rotateAxis(a2,b2),np.transpose(atoms[atoms2[i],[4,5,6]])) atoms[atoms2,4:7]+=sulfur1[0,4:7] def editFile(filein,fileout,atoms,bonds,angles,diheds): input = open(filein,"r") output = open(fileout,"w") #print "reading file " + filein currentId=0 line = input.readline() out = line.find("atoms") while(out==-1): output.write(line) line = input.readline() out = line.find("atoms") #print line output.write("{0:12d} {1}\n".format(len(atoms),"atoms")) output.write("{0:12d} {1}\n".format(len(bonds),"bonds")) output.write("{0:12d} {1}\n".format(len(angles),"angles")) output.write("{0:12d} {1}\n\n".format(len(diheds),"dihedrals")) output.write("{0:12d} {1}\n".format(len(np.unique(atoms[:,2])),"atom types")) output.write("{0:12d} {1}\n".format(len(np.unique(bonds[:,1])),"bond types")) output.write("{0:12d} {1}\n".format(len(np.unique(angles[:,1])),"angle types")) output.write("{0:12d} {1}\n\n".format(len(np.unique(diheds[:,1])),"dihedral types")) out = line.find("xlo") while(out==-1): line = input.readline() out=line.find("xlo") output.write(line) while(line.find("Atoms")==-1): line = input.readline() output.write(line) output.write("\n") np.savetxt("atoms.temp",atoms,"%7d %7d %4d %10.6f %16.8f %16.8f %16.8f") np.savetxt("bonds.temp",bonds,"%6d %3d %6d %6d") np.savetxt("angles.temp",angles,"%6d %3d %6d %6d %6d") np.savetxt("diheds.temp",diheds,"%6d %3d %6d %6d %6d %6d") atomtmp = open("atoms.temp","r") bondtmp = open("bonds.temp","r") angletmp = open("angles.temp","r") dihedtmp = open("diheds.temp","r") output.write(atomtmp.read()) #while(input.readline().find("Bonds")==-1): # continue output.write("\nBonds\n\n") output.write(bondtmp.read()) output.write("\nAngles\n\n") output.write(angletmp.read()) output.write("\nDihedrals\n\n") output.write(dihedtmp.read()) #while(line != ''): # line = input.readline() # output.write(line) def molCollide(atoms,indices): numatms = len(indices) xcenter = 40.9 ycenter = 40.9 zcenter = 40.9 for i in range(numatms): x = atoms[indices[i],4] y = atoms[indices[i],5] z = atoms[indices[i],6] #print "x is "+str(x)+" y is "+str(y)+" z is "+str(z) if sqrt((x-xcenter)**2+(y-ycenter)**2+(z-zcenter)**2)<20.45: return True return False def getPotential(filename): pefile = open(filename,"r") lines=pefile.readlines() return lines[len(lines)-1].split()[1] def getBondedAtoms(bonds,atomID): bonded1 = bonds[(bonds[:,2]==atomID)][:,3] if bonds[(bonds[:,2]==atomID)].shape[0]>0 else [] bonded2 = bonds[(bonds[:,3]==atomID)][:,2] if bonds[(bonds[:,3]==atomID)].shape[0]>0 else [] return np.append(np.ravel(bonded1),np.ravel(bonded2)) def getMoleculeAtoms(bonds,startID): atomIDs = np.empty([1]) atomIDs[0] = startID bondedAtoms = getBondedAtoms(bonds,startID) actAtoms = [atom for atom in bondedAtoms if ((atom>0) and (not (atom in atomIDs)))] while(len(actAtoms)>0): atomIDs = np.append(atomIDs,actAtoms[0]) bondedAtoms = getBondedAtoms(bonds,actAtoms[0]) actAtoms = [atom for atom in bondedAtoms if ((atom>0) and (not (atom in atomIDs)))] return atomIDs if __name__ == "__main__": inputfile=sys.argv[1] basename=inputfile.split('.')[0] atoms = readfile(inputfile) #print(atoms) kb=0.0019872041 #in kcal/mol-K T=360 beta = 1/(kb*T) #print "Xmin = "+str(np.amin(atoms[atoms[:,2]==1][:,4])) #print "Xmax = "+str(np.amax(atoms[atoms[:,2]==1][:,4])) #print "Xmin = "+str(np.amin(atoms[atoms[:,2]==1][:,5])) #print "Ymax = "+str(np.amax(atoms[atoms[:,2]==1][:,5])) #print "Zmin = "+str(np.amin(atoms[atoms[:,2]==1][:,6])) #print "Zmax = "+str(np.amax(atoms[atoms[:,2]==1][:,6])) molIds = atoms[atoms[:,2]==4][:,1] centerRotation=np.array([40.9,40.9,40.9]) numsteps=10 print "Center of rotation is "+str(centerRotation[0])+"x, "+str(centerRotation[1])+"y and "+str(centerRotation[2])+"z" #print(molIds) rnd.seed() collisions=0 lastenergy=getPotential("pe.out") for i in xrange(numsteps): swappedList = rnd.sample(molIds,2) #print "swapping molecule "+str(swappedList[0])+" and molecule "+str(swappedList[1]) swapMolecules(swappedList[0],swappedList[1],atoms,centerRotation) if molCollide(atoms,np.where((atoms[:,1]==swappedList[0]))[0]) or molCollide(atoms,np.where((atoms[:,1]==swappedList[1]))[0]): print "molecule collided" continue editFile(inputfile,atoms,basename+str(i)+".lmp") call(["cp",basename+str(i)+".lmp",basename+".temp"]) call("./runlammps.sh") energy=getPotential("pe.out") dU = energy-lastenergy if(dU<=0): atoms=readfile(basename+str(i)+".lmp") elif(rnd.random()<exp(-beta*dU)): atoms=readfile(basename+str(i)+".lmp") print "Xmin = "+str(np.amin(atoms[:,4])) print "Xmax = "+str(np.amax(atoms[:,4])) print "Xmin = "+str(np.amin(atoms[:,5])) print "Ymax = "+str(np.amax(atoms[:,5])) print "Zmin = "+str(np.amin(atoms[:,6])) print "Zmax = "+str(np.amax(atoms[:,6])) #np.savetxt("atoms.lmp",atoms,"%7d %7d %4d %10.6f %16.8f %16.8f %16.8f")
[ "stevennmerz@gmail.com" ]
stevennmerz@gmail.com
1c2277d882952a475cf6cd791ec09d6b0aa0cd4b
69ea28c40bc1baee83acfb3e96ea6f41ee34363d
/play/Controller.py
595722203bd5d952e5a03fd63e0ff70e73054985
[]
no_license
drifftingcanoncuddle/hakaton2019
7098db2971325690679b623fbd6e4d84bbb0e838
58bf83d087f97ae5c30f95fa9f76a114c7732b36
refs/heads/master
2020-05-31T07:14:02.808333
2019-06-04T12:44:09
2019-06-04T12:44:09
190,160,910
0
0
null
null
null
null
UTF-8
Python
false
false
1,680
py
from typing import * from play.Plane import Plane from play.AIx import AIx class Controler: def __init__(self): self.plane = Plane() self.plane.create() self.user_symbol = "O" self.ai_symbol = "O" self.ai = AIx() def set_symbols(self, user_symbol: str, ai_symbol: str): self.ai_symbol = ai_symbol self.user_symbol = user_symbol def play(self, user_x: int, user_y: int): self.plane.update(user_x, user_y, self.user_symbol) ai_x, ai_y = self.ai.play(self.plane) self.plane.update(ai_x, ai_y, self.ai_symbol) def ai_win(self): pass def win(self, plane): # left diagonal if plane[0][0] == plane[1][1] and plane[1][1] == plane[2][2]: return plane[0][0] # right diagonal elif plane[2][0] == plane[1][1] and plane[0][2] == plane[1][1]: return plane[1][1] # l3 vertical elif plane[0][0] == plane[0][1] and plane[0][1] == plane[0][2]: return plane[0][1] # l2 vertical elif plane[1][0] == plane[1][1] and plane[1][1] == plane[1][2]: return plane[1][1] # l1 vertical elif plane[2][0] == plane[2][1] and plane[2][1] == plane[2][2]: return plane[2][1] # l3 horizontal elif plane[0][0] == plane[1][0] and plane[1][0] == plane[2][0]: return plane[0][1] # l2 horizontal elif plane[0][1] == plane[1][1] and plane[1][1] == plane[2][1]: return plane[0][1] # l1 horizontal elif plane[0][2] == plane[1][2] and plane[1][2] == plane[2][2]: return plane[0][1]
[ "ptl99t@gmail.com" ]
ptl99t@gmail.com
2de97c75346aa4138afedc9c09cea58736c5cc02
be15ba8adae9f92a1723f0570e6ea037f0dea49a
/flask/cnn.py
b45c28f5558fb9f4c4a2ffba3f6602f99d0a79d9
[]
no_license
CarsonStevens/GeoGuessed
05cd504273de9940f4b7bab30cb39fd22ee756d8
4b6f5bd33cbff47eaddb73ef11cd43dda66c696f
refs/heads/master
2022-12-24T10:31:38.932913
2019-11-19T15:16:30
2019-11-19T15:16:30
211,579,542
3
0
null
2022-12-11T07:32:41
2019-09-29T00:47:05
HTML
UTF-8
Python
false
false
1,827
py
## CNN.py import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D from config import * class CNN(): def __init__(self): self.model = None # def process_data(): # get data # X = np.zeros((1,)) # final: np.load('path/to/saved np array') # y = np.zeros((1,)) # normalize # return X, y def create_model(): # test # X = np.zeros((1,)) # final: np.load('path/to/saved np array') # y = np.zeros((1,)) # define model self.model = Sequential() # first convolutional layer # Conv2D( number_of_filters, kernal_size, input_shape(just for the input conv layer)) self.model.add(Conv2D(CNN_N_FILTERS, CNN_KERNEL_SIZE, input_shape = X.shape[1:])) # layer activaion function self.model.add(Activation(CNN_ACTIVATION_FUNCTION)) # layer pooling self.model.add(MaxPooling2D(pool_size = CNN_POOL_SIZE)) # second layer model.add(Conv2D(CNN_N_FILTERS, CNN_KERNEL_SIZE)) self.model.add(Activation(CNN_CONV_ACTIVATION_FUNCTION)) self.model.add(MaxPooling2D(pool_size = CNN_POOL_SIZE)) # dense layer on flattened data, 64 nodes self.model.add(Flatten()) self.model.add(Dense(CNN_DENSE_NODE_COUNT)) # output layer self.model.add(Dense(CNN_OUTPUT_DENSE_NODE_COUNT)) self.model.add(Activation(CNN_OUTPUT_ACTIVATION_FUNCTION)) # prepare for training self.model.compile(loss = CNN_LOSS_FUNCTION, optimizer = CNN_OPTIMIZER, metrics = CNN_METRICS) def train(): # fit self.model.fit(X, y, batch_size = CNN_BATCH_SIZE, epochs = CNN_EPOCHS, validation_split = CNN_VALIDATION_SPLIT) def summary(): # summary self.model.summary() def save_model(): # save model self.model.save('cnn.model')
[ "danielpersonius@mymail.mines.edu" ]
danielpersonius@mymail.mines.edu
10ea87ac6afba40de0a3d96e81db5dc69ef6df3d
7c3ad63b17b868672ff14e798bb965109c10d403
/src/kNN_single.py
6b257b9b63560794a04b98462bedff7409e85679
[]
no_license
ternaus/kaggle_liberty
87cc6e5259e1ea4ce69726a83e4e642db85d8e22
5eb17b6bf1f6f6f6f4f6eab880592547ad41007d
refs/heads/master
2016-09-11T02:13:22.121760
2015-08-26T22:23:47
2015-08-26T22:23:47
39,865,075
4
1
null
null
null
null
UTF-8
Python
false
false
1,025
py
from __future__ import division __author__ = 'Vladimir Iglovikov' from operator import itemgetter from sklearn import metrics from gini_normalized import normalized_gini import numpy as np import pandas as pd from sklearn.grid_search import GridSearchCV from sklearn.neighbors import KNeighborsRegressor from sklearn.preprocessing import StandardScaler import time joined = pd.read_csv('../data/joined.csv') train = joined[joined['Hazard'] != -1] test = joined[joined['Hazard'] == -1] y = train['Hazard'] X = train.drop(['Hazard', 'Id'], 1) X_test = test.drop(['Hazard', 'Id'], 1) scaler = StandardScaler() print 'scaling train' X = scaler.fit_transform(X) print 'scaling test' X_test = scaler.transform(X_test) clf = KNeighborsRegressor(n_neighbors=550) print 'fitting' clf.fit(X, y) print 'predicting' prediction = clf.predict(X_test) submission = pd.DataFrame() submission['Id'] = test['Id'] submission['Hazard'] = prediction submission.to_csv('kNN/kNN_{timestamp}.csv'.format(timestamp=time.time()), index=False)
[ "iglovikov@gmail.com" ]
iglovikov@gmail.com
5d36abd5b77f49fdf4b1d6f263b4097148c20a5a
fee6bb5e775c41d7c9e820a10ba785c526cb5fbf
/professor/dois_ensaios/library/books/views.py
092c601ed878ff0a0ddb7a36e831a6d8453fafaa
[]
no_license
jaovw/pbl7
c6d898d06086fc506f9cfa984a06e226a4ad4269
76b9541246de5f7c9e27cd8f0e1500d6d86f6d14
refs/heads/main
2023-08-30T00:32:05.254036
2021-11-02T22:27:54
2021-11-02T22:27:54
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,922
py
from django.shortcuts import render #para habilitar os outros dominios a usar os api methods from django.views.decorators.csrf import csrf_exempt #para fazer o parse em json from rest_framework.parsers import JSONParser from django.http.response import JsonResponse #importar modulos criados from books.models import Books, Departments, Employees #from books.models import Books, Lojas, ... from books.api.serializers import BooksSerializers, DepartmentSerializer, EmployeeSerializer #adicionando os recursos da foto from django.core.files.storage import default_storage # Create your views here. #por padrao do framework ja tem os metodos implementados #o codigo a seguir é apenas uma referencia #aqui estao os metodos para manipular as tabelas @csrf_exempt def departmentApi(request, id=0): if request.method == 'GET': departments = Departments.objects.all() departments_serializer = DepartmentSerializer(departments, many=True) return JsonResponse(departments_serializer.data, safe = False) elif request.method == 'POST': department_data = JSONParser().parse(request) departments_serializer = DepartmentSerializer(data = department_data) #se os dados forem validos serao salvos no banco de dados if departments_serializer.is_valid(): departments_serializer.save() return JsonResponse('adicionado com sucesso', safe = False) #safe é mais flexibilidade nas respostas return JsonResponse('falha ao adicionar', safe = False) elif request.method == 'PUT': department_data = JSONParser().parse(request) department = Departments.objects.get(DepartmentId=department_data['DepartmentId']) departments_serializer = DepartmentSerializer(department, data = department_data) if departments_serializer.is_valid(): departments_serializer.save() return JsonResponse('atualizacao feita com sucesso', safe = False) return JsonResponse('falha ao atualizar') elif request.method == 'DELETE': department = Departments.objects.get(DepartmentId=id) department.delete() return JsonResponse('deletado com sucesso', safe = False) #metodos para employess @csrf_exempt def employeeApi(request, id=0): if request.method == 'GET': employees = Employees.objects.all() employees_serializer = EmployeeSerializer(employees, many=True) return JsonResponse(employees_serializer.data, safe = False) elif request.method == 'POST': employee_data = JSONParser().parse(request) employees_serializer = EmployeeSerializer(data = employee_data) #se os dados forem validos serao salvos no banco de dados if employees_serializer.is_valid(): employees_serializer.save() return JsonResponse('adicionado com sucesso', safe = False) #safe é mais flexibilidade nas respostas return JsonResponse('falha ao adicionar', safe = False) elif request.method == 'PUT': employee_data = JSONParser().parse(request) employee = Employees.objects.get(EmployeeId=employee_data['EmployeeId']) employees_serializer = EmployeeSerializer(employee, data = employee_data) if employees_serializer.is_valid(): employees_serializer.save() return JsonResponse('atualizacao feita com sucesso', safe = False) return JsonResponse('falha ao atualizar') elif request.method == 'DELETE': employee = Employees.objects.get(EmployeeId=id) employee.delete() return JsonResponse('deletado com sucesso', safe = False) @csrf_exempt def SaveFile(request): #acusou o erro na linha abaixo file=request.FILES['file'] file_name=default_storage.save(file.name,file) return JsonResponse(file_name,safe=False)
[ "allan199215@gmail.com" ]
allan199215@gmail.com
6d5b0e02c66699ecd71cea994df1e96d609de9a4
8134fe9b7d7920c004302e890370a1b6ca02e9e1
/Android/urls.py
2d6c8ee78a754eb688ebe8d400b0c1db48141cf8
[]
no_license
txy-cs/App_Django
bf408431957337a90b92568f3128604079e471d0
5183e6a20d30c16340d1e1901974fee2e75a33c2
refs/heads/master
2021-01-13T09:57:43.264518
2016-10-28T08:28:52
2016-10-28T08:28:52
72,188,168
0
0
null
null
null
null
UTF-8
Python
false
false
764
py
"""Android URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), ]
[ "txy408926918@outlook.com" ]
txy408926918@outlook.com
dc880e94449fef14a74f7a3e1fc368756e3d8ad0
28cec7be02b1ceb2070d075ac4fa08448a1ceb43
/abc.py
1ee5730f32f9dc3b56bbb9ca180a7367630a9c80
[]
no_license
lakshmi5036/Python-project
561fffabcfc3ace95d8a755352dee42a5f450e33
c4dba7543ccb9a36f60c6512181085e0b56165d3
refs/heads/master
2023-05-25T04:13:22.525976
2021-06-06T15:03:07
2021-06-06T15:03:07
374,178,422
0
0
null
2021-06-06T15:03:07
2021-06-05T17:48:40
Python
UTF-8
Python
false
false
52
py
# this is a test file def func(): print('hey')
[ "dheeraja.damerla8@gmail.com" ]
dheeraja.damerla8@gmail.com
f57ea9b54d9603e6d35baeb0d00091ee088ae60b
14344bae5521170d70ec2c22ce88d61a0e21ec93
/Shannon_Brown/python_stack/myEnvironments/main/main/settings.py
a5b71cd5f36d1c6aeec62121a3f0b3dba9535214
[]
no_license
ShannonMBrown/python_aug_2018
9cf07254f95f0167717faa45f767dec37da54a51
ecd9b0d3d3a8628cfd7771ff00fe227fc52db5f7
refs/heads/master
2020-03-25T05:47:58.357223
2018-08-07T16:19:48
2018-08-07T16:19:48
143,466,451
0
0
null
2018-08-03T19:37:05
2018-08-03T19:37:05
null
UTF-8
Python
false
false
3,110
py
""" Django settings for main project. Generated by 'django-admin startproject' using Django 1.10. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '))5dcd%)4hct3h^ss2+87-%u!75b^g=5e7-ezk5%6e2+++#($8' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'apps.first_app', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'main.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'main.wsgi.application' # Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ STATIC_URL = '/static/'
[ "shannonmbrown@Shannons-MacBook-Pro.local" ]
shannonmbrown@Shannons-MacBook-Pro.local
387f6ae6d5a9c486e271e6200d1a36f32c5cd98f
7f0e13ffefa1d9c48d1d239dd6f2845ebd691aca
/bin/tabserver
e5eb6f27b055c336ccebe2a2aaa8d0a16881f3ce
[]
no_license
mwhooker/clitabs
d8982478e68ce1dc2a3da2e6b2eabf93a7ae9454
aaa3c1390143d53701438405bd55808d82ccaa20
refs/heads/master
2021-01-01T15:18:24.992130
2015-02-18T06:20:41
2015-02-18T06:20:41
30,792,435
4
0
null
null
null
null
UTF-8
Python
false
false
151
#!/usr/bin/env python import sys import tabcli.server def main(): return tabcli.server.main() if __name__ == '__main__': sys.exit(main())
[ "mwhooker@gmail.com" ]
mwhooker@gmail.com
2b798b78d19a0037026818c83cda481dbfc5abd9
31da7077e2d6d5f775ecf33c7bf43b7ab70dedf9
/dashboard/layouts.py
7c12198ea145f7f727dbe6d0ce4339714eb325ce
[]
no_license
Slavian2015/Quiz
56e0631d5ebb7b2aae4be50a8195a374211081a7
5efd69410b57ac24e299a5f39bb3ecddc5d8616d
refs/heads/master
2023-03-25T13:44:34.747228
2021-03-10T16:07:13
2021-03-10T16:07:13
345,926,187
0
0
null
null
null
null
UTF-8
Python
false
false
8,127
py
# -*- coding: utf-8 -*- import dash_bootstrap_components as dbc import dash_html_components as html import sys, base64, os import dbrools sys.path.insert(0, r'/usr/local/WB') main_path_data2 = os.path.expanduser('/usr/local/WB/data/') main_path_data = os.path.expanduser('/usr/local/WB/dashboard/assets/') def my_view(): layout = [ html.Div( style={ "height": "100vh", "minHeight": "100vh", "maxHeight": "100vh", "overflowY": "hidden" }, children=content())] return layout def content(): cont = dbc.Row(style={"width": "100%", "height": "100vh", "margin": "0", "padding": "0"}, justify="center", align="center", children=[ dbc.Col(style={"textAlign": "center", "height": "100vh", "minHeight": "100vh", "maxHeight": "100vh", "overflowY": "scroll", "margin": "0", "padding": "0" }, width=3, className="no-scrollbars", children=[]), dbc.Col(style={"textAlign": "center", "overflowY": "hidden", 'align': 'center', "margin": "0", "padding": "0", "padding-top": "2%" }, align="center", width=6, className="no-scrollbars", children=column_left()), dbc.Col(style={"textAlign": "center", "height": "100vh", "minHeight": "100vh", "maxHeight": "100vh", "overflowY": "hidden", "margin": "0", "padding": "0"}, width=3, children=[]), ], no_gutters=True) return cont def column_left(): cont = [ html.Div(style={'display': 'none'}, children=html.P("", id="mymail")), dbc.Row(style={"width": "100%", "margin": "0", "padding": "0"}, id="main_list", no_gutters=False, children=create_email()), ] return cont def create_email(): card = dbc.Card(color="secondary", style={"width": "100%", "padding": "0", "margin": "10px", "margin-bottom": "0px" }, inverse=True, children=[ dbc.CardBody([ dbc.InputGroup([ dbc.InputGroupAddon(html.P("Your E-mail", style={"width": "100%"}), style={"width": "80px"}, addon_type="prepend"), dbc.Input(placeholder="test@test.com", id="new_email", type="email"), ]), ]), dbc.CardFooter(dbc.Button("create account >>", id="save_email", color="success")) ]) return card def quiz_tab(mymail): answered = dbrools.check_person(mymail) for i in dbrools.get_list(): if f"{i['option1']}_{i['option2']}" not in answered: cont = [ dbc.Row(style={"width": "100%", "margin": "0", "padding": "0"}, id="quiz_list", no_gutters=False, children=create_quiz(i['option1'], i['option2'], i['option1'])), ] return cont def create_quiz(opt1, opt2, num): print(f"{opt1}_{opt2}") encoded_image1 = base64.b64encode(open(main_path_data + f'{opt1.lower()}.png', 'rb').read()).decode('ascii') encoded_image2 = base64.b64encode(open(main_path_data + f'{opt2.lower()}.png', 'rb').read()).decode('ascii') tt1 = html.Img(src='data:image/png;base64,{}'.format(encoded_image1), style={ "margin": "0", "padding": "0", "width": "300px", # "textAlign": "center" }), tt2 = html.Img(src='data:image/png;base64,{}'.format(encoded_image2), style={ "margin": "0", "padding": "0", "width": "300px", # "textAlign": "center" }), card = dbc.Card(color="secondary", style={"width": "100%", "padding": "0", "margin": "10px", "margin-bottom": "0px" }, inverse=True, children=[ html.Div(style={'display': 'none'}, children=html.P("", id={"type": "symbol", "index": num}, )), dbc.CardBody(dbc.Row([ dbc.Col(style={"textAlign": "center", "margin": "0", "padding": "0" }, width=6, className="no-scrollbars", children=[dbc.Button(tt1, id={"type": "next_btn1", "index": num, # "opt": opt1, }, key=opt1, color="info"), ]), dbc.Col(style={"textAlign": "center", "margin": "0", "padding": "0" }, width=6, className="no-scrollbars", children=[dbc.Button(tt2, id={"type": "next_btn2", "index": num, # "opt": opt2 }, key=opt2, color="info")]), ])), dbc.CardFooter(dbc.Button("NEXT >>", id={"type": "next_btn", "index": num}, color="success")) ]) return card
[ "slavaku2014@gmail.com" ]
slavaku2014@gmail.com
93a5073ac024902777ff56f7b77d2f8188dc0ad5
539cf5309347e46051b70b90f793feb281a0683a
/enemyData.py
17acde84297099e2dfa9329b5f1e4bedc5e2ab17
[]
no_license
bradellison/pokemon-simulator
52c9c7f8d90bd0cddad4f4cc9ebcec7673de3f7d
f4b47f9c2e1ec990e1269288ab9e491c796fb838
refs/heads/master
2021-12-09T13:07:25.913990
2021-12-02T05:22:21
2021-12-02T05:22:21
156,161,477
1
1
null
2018-11-21T21:19:26
2018-11-05T04:38:31
Python
UTF-8
Python
false
false
2,235
py
#PokemonInfo = [["Pok1Name", Poke1Lvl, ["Poke1Mov1", "Poke1Mov2"]], "Pok2Name", Poke2Lvl, ["Poke2Mov1", "Poke2Mov2"]]] #enemyInfo = ["Class", "Name", team, prizeMoney, "EndBattleText", "coordinates", viewDistance, "viewDirection"] ## PALLET TOWN ## oakTeam = [['Pidgeot',61,['Wing Attack']],['Pidgeot',61,['Wing Attack','Mirror Move','Sky Attack','Whirlwind']]] #oakTeam = [['Pidgeot', 61, ['Wing Attack']]] enemyOak = ["Badman", "Oak", oakTeam, 10000, "Student becomes the master, eh?", [12,19], 3, "Right"] #palletTownEnemies = [enemyOak] palletTownEnemies = [] ## VIRIDIAN FOREST ## bugCatcherRickTeam = [['Weedle', 7, 'Random'], ['Caterpie', 7, 'Random']] bugCatcherRick = ["Bug Catcher", "Rick", bugCatcherRickTeam, 72, "You bug me!", [33,37], 3, "Left"] bugCatcherDougTeam = [['Weedle', 7, 'Random'], ['Kakuna', 7, 'Random'], ['Weedle', 7, 'Random']] bugCatcherDoug = ["Bug Catcher", "Doug", bugCatcherDougTeam, 84, "You bug me!", [35,23], 3, "Down"] bugCatcherAnthonyTeam = [['Caterpie', 7, 'Random'], ['Caterpie', 8, 'Random']] bugCatcherAnthony = ["Bug Catcher", "Anthony", bugCatcherAnthonyTeam, 84, "You bug me!", [31,5], 3, "Down"] bugCatcherCharlieTeam = [['Metapod', 7, 'Random'], ['Caterpie', 7, 'Random'], ['Metapod', 7, 'Random']] bugCatcherCharlie = ["Bug Catcher", "Charlie", bugCatcherCharlieTeam, 84, "You bug me!", [13,5], 3, "Down"] bugCatcherSammyTeam = [['Weedle', 9, 'Random']] bugCatcherSammy = ["Bug Catcher", "Sammy", bugCatcherSammyTeam, 84, "You bug me!", [6,23], 3, "Left"] viridianForestEnemies = [bugCatcherRick, bugCatcherDoug, bugCatcherAnthony, bugCatcherCharlie, bugCatcherSammy] ## PEWTER GYM ## camperLiamTeam = [["Geodude", 10, 'Random'], ['Sandshrew', 11, 'Random']] camperLiam = ["Camper", "Liam", camperLiamTeam, 220, "You might be better than me, but you won't beat Brock!", [7,10], 3, "Right"] gymLeaderBrockTeam = [["Geodude", 12, "Random"], ["Onix", 14, "Random"]] gymLeaderBrock = ["Gym Leader", "Brock", gymLeaderBrockTeam, 1400, "Wow, what a fight! Here, take this Boulder Badge!", [10,7], 0, "Down"] pewterGymEnemies = [camperLiam, gymLeaderBrock] allTownEnemies = {"Pallet Town": palletTownEnemies, "Viridian Forest": viridianForestEnemies, "Pewter Gym": pewterGymEnemies}
[ "brad.ellison@celer-tech.com" ]
brad.ellison@celer-tech.com
f5c5ed47d5675f11c96f665fda4db3d9b492c918
b402040954f13bbb8df5e2cb2f5ebafb4ed75f7a
/main/migrations/0001_initial.py
65c273c754fd63d23a09b3b13644af594f11545f
[]
no_license
HalimaShanta/Shopping-Website
6c744a6f219fa5744ffd3823742c852636b960ed
2007cea9755b8f32493849bedd6af6c7cc9e91fd
refs/heads/main
2023-08-04T23:12:24.547411
2021-09-09T21:10:37
2021-09-09T21:10:37
404,867,566
0
0
null
null
null
null
UTF-8
Python
false
false
633
py
# Generated by Django 3.0.8 on 2021-08-09 17:06 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Home', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('image', models.ImageField(blank=True, null=True, upload_to='')), ('title', models.CharField(max_length=100)), ('sub_title', models.CharField(max_length=100)), ], ), ]
[ "halimashanta@gmail.com" ]
halimashanta@gmail.com
bff7768f9a5f3a84f3142fcac45842c549f8bd13
d5b60325d88d59bb3c6cde58036514921abfd6e9
/DjangoChat/DjangoChat/wsgi.py
c2d57315e9c4b78413c290b4da11fa09adacfd85
[]
no_license
dagrishin/DjangoChat
472044874bbd1a91efe5a7e6611af02aa485acd1
d800fff81ac3632752e3486a90c062dde4b18780
refs/heads/master
2022-12-22T06:56:57.676392
2020-09-29T07:14:50
2020-09-29T07:14:50
299,532,590
0
0
null
null
null
null
UTF-8
Python
false
false
397
py
""" WSGI config for DjangoChat project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DjangoChat.settings") application = get_wsgi_application()
[ "grishin-dim@yandex.ru" ]
grishin-dim@yandex.ru
4b8180666321d4a533cb64126c95099cdae02b40
61aeb392245ed66d40de412c0f2ac1196f7172e2
/Data Analytics/개인과제2/main.py
150afcd59098566bac4420538c9c0221399b43bc
[ "MIT" ]
permissive
mini-song/Konkuk_Univ
a0c40771fa291162906bccd430742a9e64ac1e09
9cd4091f6c5ec109866c087d530970e77494192f
refs/heads/main
2023-02-01T13:00:13.834923
2020-12-20T15:02:23
2020-12-20T15:02:23
322,308,412
0
0
null
null
null
null
UTF-8
Python
false
false
5,106
py
import numpy as np import konlpy import csv from tqdm import tqdm import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score import gensim import gensim.corpora as corpora review_O_data=[] f = open('./data_review.csv','r',encoding='utf-8') rdr = csv.reader(f) review_O_data_tag = [] review_X_data =[] f2 = open('./data_review.csv','r',encoding='utf-8') rdr2 = csv.reader(f2) select_category=input("야식, 족발/보쌈, 한식, 분식, 일식/돈까스, 피자, 중식, 치킨") company_list=[] for j in rdr2: if j[1] ==select_category: company_list.append(j[0]) print(set(company_list)) select_company = input("위의 목록 또는 전체를 입력해 주세요") Want_comfortable=input("좋음,보통,나쁨 을 입력하세요") for i in rdr: try: if i[1] ==select_category: if select_company =='전체': if i[3] == '': review_X_data.append(i[6]) else: if float(i[3])<=2 and float(i[4])<=2 and float(i[5])<=2: review_O_data.append(i[6]) review_O_data_tag.append(0) #나쁨 elif float(i[3])>=4 and float(i[4])>=4 and float(i[5])>=4: review_O_data.append(i[6]) review_O_data_tag.append(1) #좋음 else: review_O_data.append(i[6]) review_O_data_tag.append(2) #보통 elif i[0] ==select_company: if i[3] == '': review_X_data.append(i[6]) else: if float(i[3])<=2 and float(i[4])<=2 and float(i[5])<=2: review_O_data.append(i[6]) review_O_data_tag.append(0) #나쁨 elif float(i[3])>=4 and float(i[4])>=4 and float(i[5])>=4: review_O_data.append(i[6]) review_O_data_tag.append(1) #좋음 else: review_O_data.append(i[6]) review_O_data_tag.append(2) #보통 except: pass reveiw_Total_data = review_O_data + review_X_data for i, document in tqdm(enumerate(reveiw_Total_data)): okt = konlpy.tag.Okt() clean_words = [] for word in okt.pos(document,stem=True): #Letimazation if word[1] in ['Noun', 'Verb']: clean_words.append(word[0]) document = ' '.join(clean_words) reveiw_Total_data[i] = document vectorize = CountVectorizer(min_df=10) X = vectorize.fit_transform(reveiw_Total_data) features = vectorize.get_feature_names() Vector_Matrix = np.array(X.toarray()) review_O_data_df = pd.DataFrame(Vector_Matrix) review_X_data_df = review_O_data_df.iloc[len(review_O_data)+1:,:] review_X_data_df.to_csv("review_x_data.csv",encoding="utf-8-sig",header = features) review_O_data_df=review_O_data_df.head(len(review_O_data)) review_O_data_df["태그"] = review_O_data_tag features.append("태그") review_O_data_df.to_csv("review_o_data.csv",encoding="utf-8-sig",header = features) review_O_data_df=pd.read_csv('./review_o_data.csv') review_X_data_df=pd.read_csv('./review_x_data.csv') Y=review_O_data_df['태그'] features.pop(-1) X=review_O_data_df[features] X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.3) log_clf = LogisticRegression() log_clf.fit(X_train,Y_train) print("정확도:",round(log_clf.score(X_test, Y_test)*100,2),"%") review_X_data_tag = log_clf.predict(review_X_data_df[features]) review_x_tag_df = pd.DataFrame(review_X_data_tag) review_Total_data_tag = review_O_data_tag+list(np.array(review_x_tag_df[0].tolist())) final_data = [] spool = [] for i in range(0,len(review_Total_data_tag)): spool.append(reveiw_Total_data[i]) if review_Total_data_tag[i] == 1: spool.append('좋음') elif review_Total_data_tag[i] == 2: spool.append("보통") else: spool.append("나쁨") final_data.append(spool) spool = [] lda_list =[] for i in final_data: if i[1] ==Want_comfortable: lda_list.append(i[0]) documents =[] documents = [line.rstrip('\n') for line in lda_list] stoplist=["제","걸","번","그것","요","거","온","함","분","하다","임","것","다시다","전","치","뿌","링클","식","건지"] #결과를 계속 보고 stoplist를 채워준다. texts = [[word for word in document.lower().split() if word not in stoplist] for document in documents] dictionary = corpora.Dictionary(texts) corpus = [dictionary.doc2bow(text) for text in texts] lda = gensim.models.ldamodel.LdaModel(corpus=corpus, id2word=dictionary, num_topics=6, update_every=1, chunksize=100, passes=30) result=lda.print_topics(num_words=9) for i in result: print(i)
[ "noreply@github.com" ]
mini-song.noreply@github.com
5a6960680cae86c401d945eb77b50e792096b7ac
464850ba426263b17084fc71363ca14b8278b15e
/80.py
c539164e19aa8d461121a1829efe084c3408f060
[]
no_license
eng-arvind/python
8442c30ec10f979f913b354458b4f910539d8728
249f5f35f245a3f1742b10310de37ca6c6023af2
refs/heads/master
2020-12-23T06:40:16.911269
2020-02-02T18:42:01
2020-02-02T18:42:01
237,069,973
1
0
null
null
null
null
UTF-8
Python
false
false
231
py
n = 7 for i in range(n): for j in range(n): if i + j == n//2 or i - j == n//2 or i + j == (n//2)*3 or j - i == n//2: print("*", end="") else: print(end=" ") print()
[ "noreply@github.com" ]
eng-arvind.noreply@github.com
01a1ef6dc25aacb7b99e3bb2d2e912e04233c3cc
9743d5fd24822f79c156ad112229e25adb9ed6f6
/xai/brain/wordbase/otherforms/_outgoes.py
710d7af255478e9b9f5ce4bf9bc34b044eb81186
[ "MIT" ]
permissive
cash2one/xai
de7adad1758f50dd6786bf0111e71a903f039b64
e76f12c9f4dcf3ac1c7c08b0cc8844c0b0a104b6
refs/heads/master
2021-01-19T12:33:54.964379
2017-01-28T02:00:50
2017-01-28T02:00:50
null
0
0
null
null
null
null
UTF-8
Python
false
false
220
py
#calss header class _OUTGOES(): def __init__(self,): self.name = "OUTGOES" self.definitions = outgo self.parents = [] self.childen = [] self.properties = [] self.jsondata = {} self.basic = ['outgo']
[ "xingwang1991@gmail.com" ]
xingwang1991@gmail.com
ccef30a80becc469ed0e6f7cb4d3207345e33f76
8af419663c0ba2ecb1bf485a83327523f23df23a
/高级特性/generator.py
503607e1a19d00f769950209bfdf710414689f81
[]
no_license
Haiyao/python_practice
c2ed6b7a9190928b24038696c686f836a817ee57
7903190297c20fa3cf850cde9a6101b2f3a62762
refs/heads/master
2021-01-10T17:46:09.276846
2016-03-15T08:06:58
2016-03-15T08:06:58
53,932,155
0
0
null
null
null
null
UTF-8
Python
false
false
249
py
# -*- coding: utf-8 -*- def fib(max): n, a, b = 0, 0, 1 while n < max: yield b a, b = b, a + b n = n + 1 return 'done' x = input('enter you number') x = int(x) f = fib(x) print(f) for n in fib(x): print(n)
[ "mma4017@icloud.com" ]
mma4017@icloud.com
1fdc5488c7b997dc3eda43ec658d71f1f096e0c9
86eac99b383981897a608d57f48b23a8d44f35c0
/src/Python.Client/src/test.py
d3f3acc5156518c78ee46a6a0fb8f1d0af2c6046
[ "Apache-2.0" ]
permissive
AndMu/Wikiled.Sentiment.Service
eb3d91e64f37a8ea4db1e37d320c40b05dd83c89
8ce338183cb3730512c48935b7bf996e0a6ddb8c
refs/heads/master
2022-12-11T05:59:05.787535
2020-07-16T10:59:53
2020-07-16T10:59:53
134,326,518
0
0
Apache-2.0
2022-12-08T08:56:55
2018-05-21T21:20:13
Jupyter Notebook
UTF-8
Python
false
false
3,667
py
import os import socket import logging.config from datetime import datetime from os import path import asyncio from src.psenti.service.sentiment import SentimentAnalysis, SentimentConnection, Document # create logger logging.config.fileConfig('logging.conf', disable_existing_loggers=False) logger = logging.getLogger('psenti') user_name = socket.gethostname() host = '127.0.0.1' port = 5000 def sentiment_analysis(): documents = ['I like this bool :)', 'short it baby'] dictionary = {} dictionary['like'] = -1 dictionary['BOOL'] = 1 connection = SentimentConnection(host=host, port=port, client_id=user_name) analysis = SentimentAnalysis(connection, 'market', dictionary, clean=True) analysis.on_message.subscribe(lambda message: print(message)) analysis.detect_sentiment_text(documents) def sentiment_analysis_market(): documents = ['Huge loss reported.', 'Huge profit reported.'] connection = SentimentConnection(host=host, port=port, client_id=user_name) analysis = SentimentAnalysis(connection, 'market', clean=True) analysis.on_message.subscribe(lambda message: print(message)) analysis.detect_sentiment_text(documents) def sentiment_analysis_docs(): documents = [ Document('1', 'I love this hello kitty decal! I like that the bow is pink instead of red. Only bad thing is that after putting it on the window theres a few air bubbles, but that most likely my fault. Shipped fast too.', 'Ben'), Document('2', 'I bought this for my 3 yr old daughter when I took it out the pack it had a bad oder, cute but very cheap material easy to ripe. When I tried it on her it was to big, but of course she liked it so I kept it. I dressed her up in it and she looked cute.', 'Ben', datetime(1995, 5, 2)) ] # with custom lexicon and Twitter type cleaning # analysis = SentimentAnalysis(connection, 'market', dictionary, clean=True, model='Test') connection = SentimentConnection(host=host, port=port, client_id=user_name) analysis = SentimentAnalysis(connection) analysis.on_message.subscribe(lambda message: print(message)) analysis.detect_sentiment(documents) def read_documents(path_folder: str, class_type: bool): directory = os.fsencode(path_folder) all_documents = [] for file in os.listdir(directory): filename = os.fsdecode(file) id = os.path.splitext(filename)[0] full_name = path.join(path_folder, filename) with open(full_name, "r", encoding='utf8') as reader: text = reader.read() doc = Document(id, text) doc.isPositive = class_type all_documents.append(doc) return all_documents def save_documents(): with SentimentConnection(host=host, port=port, client_id=user_name) as connection: connection.delete_documents('Test') print("Loading Negative files") all_documents = read_documents('D:/DataSets/aclImdb/All/Train/neg', False) print("Sending...") connection.save_documents('Test', all_documents) print("Loading Positive files") all_documents = read_documents('D:/DataSets/aclImdb/All/Train/pos', True) print("Sending...") connection.save_documents('Test', all_documents) def train(): with SentimentConnection(host=host, port=port, client_id=user_name) as connection: analysis = SentimentAnalysis(connection, domain='market', clean=True) analysis.train('Test') if __name__ == "__main__": print('Test') sentiment_analysis_market()
[ "keistokas@gmail.com" ]
keistokas@gmail.com
93fc01efba1e5e4f045b41d0b93da8097c64a8d9
bff8151a211ea8434ac02dad917989a422b50d44
/retrieval/cal_topk_acc.py
63be3ba41870a85057681bdfd3f09c1da0970e1e
[]
no_license
lijiaman/Cross-domain-Retrieval
fa5b3fce6cd5bcd9fe6020424a8ede38ef11d06e
b1945b06c33a1f8efe11e4ee80c2c75205159c62
refs/heads/master
2020-06-28T06:05:50.798417
2016-12-22T12:40:42
2016-12-22T12:40:42
74,506,444
1
1
null
null
null
null
UTF-8
Python
false
false
1,811
py
import numpy as np import json import time #street_file = '/ais/gobi4/fashion/retrieval/part_street_features.json' #shop_file = '/ais/gobi4/fashion/retrieval/test_gallery.json' #street_file = '/ais/gobi4/fashion/retrieval/toy4_darn_street_features.json' #shop_file = '/ais/gobi4/fashion/retrieval/toy4_darn_test_gallery.json' street_file = '/ais/gobi4/fashion/retrieval/toy4_share_street_features.json' shop_file = '/ais/gobi4/fashion/retrieval/toy4_share_test_gallery.json' k = 1 acc = 0 #shop_total = 47384 street_total = 24 with open(street_file, 'rb') as street: start_time = time.time() street_data = street.readlines() for street_line in street_data: street_line = json.loads(street_line) cal_street = np.asarray(street_line['street_feature']) distance = [] with open(shop_file, 'rb') as shop: shop_data = shop.readlines() for shop_line in shop_data: shop_line = json.loads(shop_line) cal_shop = np.asarray(shop_line['shop_feature']) distance.append( np.sum((cal_shop-cal_street)**2)) shop.close() index = np.argsort(distance) print("index:") print index topk_index = index[:k] print("topk index:") print topk_index cnt = 0 with open(shop_file, 'rb') as shop: shop_data = shop.readlines() for i in topk_index: line = shop_data[i] select = json.loads(line) if select['id'] == street_line['id']: cnt = 1 shop.close() #print("hit = {0}".format(acc)) acc += float(cnt) print("hit = {0}".format(acc)) acc /= street_total print acc print time.time()-start_time street.close()
[ "lijiaman@buaa.edu.cn" ]
lijiaman@buaa.edu.cn
5c6e655ee9fd28e840bc078319dd48152f3a829f
67d22c922419577be197edae8a5979317a336079
/python/example/drawPolygons.py
c3a4056633256b377ac8b50dc52685f367142deb
[ "MIT" ]
permissive
PeterZs/TopoLite
69bc3ea3e45e9d5e08d2432c63fc59078aa11b57
d6eb9125518a88ea546917df5217978f34661b2c
refs/heads/master
2023-03-19T09:24:06.659312
2020-06-29T15:34:21
2020-06-29T15:34:21
null
0
0
null
null
null
null
UTF-8
Python
false
false
751
py
import matplotlib.pyplot as plt def plotpoly(coord): coord.append(coord[0]) #repeat the first point to create a 'closed loop' xs, ys = zip(*coord) #create lists of x and y values plt.plot(xs,ys) return [xs, ys] plt.figure() A = [[-0.25, -0.3], [0.15, -0.3], [0.15, -0.0999999], [-0.0499999, -0.0999999], [-0.0499999, 0.0999999], [0.15, 0.1], [0.15, 0.3], [-0.25, 0.3], ] B = [[-0.25, -0.0999999], [-0.0500001, -0.0999999], [-0.0500002, 0.3], [0.15, 0.3], [0.15, -0.3], [-0.45, -0.3], [-0.45, -0.1], [-0.65, -0.1], [-0.65, 0.1], [-0.25, 0.1], ] C = [[0.15, -0.1], [-0.0499999, -0.1], [-0.05, 0.1], [0.15, 0.1], [0.15, 0.3], [-0.0500001, 0.3], [-0.05, -0.0999999], [-0.25, -0.1], [-0.25, -0.3], [0.15, -0.3], ] plotpoly(C) plt.show()
[ "qiqiustc@gmail.com" ]
qiqiustc@gmail.com
57fb1c867bec4dd8dcaf8f44920298ef2a93a849
325236056593df914d836c0a5fed0e56c1060941
/.history/part2/part2_20190913223319.py
95a89803f197fb5625b3ba454265dd7b1b6be88d
[]
no_license
amersulieman/machine_learning_HW1
2691f3c81a7c6c718d46a33d93525e811414b6c7
0c3e59fece35cb8a803eda4ddae7d3a7980c6774
refs/heads/master
2022-02-17T06:31:35.834501
2019-09-16T15:58:51
2019-09-16T15:58:51
207,144,267
0
0
null
null
null
null
UTF-8
Python
false
false
3,482
py
import numpy as np import random import re as regex import os def generate_random_betas_vector(number_of_betas, bits_per_beta): ''' Genrates 4 random beta values ''' random_betas_vector = [] for beta in range(number_of_betas): random_beta = random.randint(0, (2**bits_per_beta)-1) random_betas_vector.append(random_beta) return random_betas_vector def calc_MSE(x, y, num_rows, beta_vector): '''reduce each beta to fall into a specified range -(2^19)/10 to (2^19)-1/10 and calculate the mean squared error ''' B = [(beta - 2**19)/10 for beta in beta_vector] B = np.array(B) # RSS = (Y - Y')^2 but since we can't do square, we use transpose multiplication error = (y - x @ B).conjugate().transpose() @ (y - x @ B) MSE = error/num_rows # Now we can take the root of our MSE since we squared it to avoid errors root_MSE = MSE ** 0.5 return root_MSE def get_neighbor(current_betas_vector): ''' A function that finds all the neighbors of a vector If a vector size is 80 bits, then there are 80 neighbors since at a time we can only change one bit ''' for index in range(number_of_betas): for bit_index in range(bits_per_beta): old_beta = current_betas_vector[index] # shift 1 per bit so only one bit per neighbor changes bit_mask = 1 << bit_index new_beta = old_beta ^ bit_mask neighbor = current_betas_vector[:] neighbor[index] = new_beta yield neighbor def input_files_read(exit_cond_files, x_file, y_file): # load the data of each file x = np.loadtxt("../HousingData/X.txt") y = np.loadtxt("../HousingData/Y.txt") num_rows, num_columns = np.shape(x) exit_conditions = [] try: with open(exit_cond_files, 'r') as myfile: file_content = myfile.read() filtered_content = re.split(r"\D+", file_content) exit_conditions[0] = file_content[1] exit_conditions[1] = file_content[2] except: print("problem opening your file.....") return x, y, num_rows, num_columns, exit_conditions def hill_climbing(nums_of_betas, bits_per_beta, generations, restarts): entire_vector_size = number_of_betas * bits_per_beta for value in range(restarts): local_min = False current_beta_vector = generate_random_betas_vector() current_mse = calc_MSE(current_beta_vector) generation_count = 1 while generation_count <= generations and local_min == False: found_better_neighbor = False # print("generation count --> ", generation_count, "\n") neighbor_generator = get_neighbor(current_beta_vector) for bit in range(entire_vector_size): neighbor = next(neighbor_generator) neighbor_fitness = calc_MSE(neighbor) if neighbor_fitness < current_mse: current_beta_vector = neighbor current_mse = neighbor_fitness found_better_neighbor = True if not found_better_neighbor: # print("Reached local min") # print("Betas --> ", convert_binary_betas_to_numbers(current_beta_vector)) # print("Local MSE--> ", current_mse) local_min = True generation_count += 1 x_file = needed_data = input_files_read()
[ "asulieman@hedrick-2.local" ]
asulieman@hedrick-2.local
7226bb2dcef47693a30e496007e67ac5cab23a55
da04957fe26dab8a70fec7b426425e9ba92bfe03
/Chutando.numero.py
5dbebd87e18c1e68f38ca5fdfc52150334983e93
[]
no_license
RobsonGomes1/Chutando-o-n-mero
3bb29798e599f0297251997613744d8a63814db1
b1f90b7e41452f05cd5697629ac715a17349b616
refs/heads/main
2023-06-05T14:48:25.996307
2021-06-15T04:33:38
2021-06-15T04:33:38
377,035,207
0
0
null
null
null
null
UTF-8
Python
false
false
948
py
try: from random import randint nu = randint(1, 100) except: print('Desculpa, mas aconteceu um erro na solicitação') else: Aviso1 = print('Chute do 1 adiante ;)') aviso = print('escreva "[Sair]" para finalizar') ch = str ch1 = 0 while ch != 'sair'.strip(): from time import sleep ch1 = int(input('Chute um numero: \n '.strip())) sleep(1.0) ch = str(input('Deseja sair? Caso não... Aperte ENTER: '.strip() )) sleep(1.0) if ch1 <= nu: print('Quase hein!!!') sleep(1.0) elif ch1 >= nu: print('Quase lá!!!') sleep(1.0) elif ch1 == nu: print('Acertouuuu!!') sleep(1.0) else: if ch == 'sair'.strip(): print('Até breve!!') sleep(1.0) finally: print('Bem vindo e volte sempre!')
[ "robson_rabisco@hotmail.com" ]
robson_rabisco@hotmail.com
202db6eca23a5f9a75e3b08d79d121e5f8bdf791
6b307db7e46ec26617bf7c5f5b35085f2d8bc184
/Lista Fabio 01 - Pt 02/F1_Q13_idadeemdias.py
c2a0c139b727b5ad6eb670cb6a009ced2b8d5ab1
[]
no_license
brenoeng/ifpi-ads-algoritmos2020
859b9ed9686e0ec8d5c5d3c37366c23351d2e1a5
0a71a1173104b47c78ff480248c9cba5894321ff
refs/heads/master
2021-03-04T21:39:35.869542
2020-11-06T01:21:58
2020-11-06T01:21:58
246,066,916
0
0
null
null
null
null
UTF-8
Python
false
false
339
py
# Entrada anos = int(input('Digite sua idade em anos: ')) meses = int(input('Digite há quantos meses você fez aniversário: ')) dias = int(input('Digite quantos dias passou da sua data de aniversário: ')) # Processamento idade_em_dias = anos * 365 + meses * 30 + dias # Saída print('Você tem {} dias de idade'.format(idade_em_dias))
[ "breno.ar.andrade@gmail.com" ]
breno.ar.andrade@gmail.com
e7c6dfbd9cf60774e0a17345e45f01b6446732c2
76b2bdc8d1f0541a270101215e80f8f0be98e40f
/mockmock/outer.py
b3d193d0228a1396d37fd6bf91a693cbd5759ac9
[]
no_license
flaschbier/StillLearningPython
c87596655234120ad47abe1e42082308fa453e21
5a4c205c72e51d71190cd250e285e7f8bc3dd738
refs/heads/master
2021-01-10T11:29:54.591425
2016-03-28T18:31:49
2016-03-28T18:31:49
54,133,064
0
0
null
null
null
null
UTF-8
Python
false
false
83
py
import inner def functio(): return inner.functio() print "outer:", functio()
[ "developer.flaschbier@gmail.com" ]
developer.flaschbier@gmail.com
c226c2fd5ebf5e5869cb44cecb2f6811d62a4a0b
3c4122a6be0a27571fad25d0acb60ad0e527d32a
/retinaface-keras/simple_test.py
9597e610f1bf0b4432bff576039598ad3514d47d
[ "MIT" ]
permissive
LeeSiy/Insight-face-tf1.13.2
08e0f2ab14b461c8dd95dbda3ef15ef832a61575
9258041a1d732f543155718c37c654a13e120fdb
refs/heads/main
2023-05-26T13:49:41.785038
2021-06-15T06:51:26
2021-06-15T06:51:26
377,032,542
1
0
null
null
null
null
UTF-8
Python
false
false
1,789
py
import tensorflow as tf import cv2 import numpy as np import os from numpy.linalg import norm import predict export_path = 'path/to/insight/face/saved/pb' people1_path = 'path/to/single/person/image/group/folder' people1_list = os.listdir(people1_path) people1_imgs = np.zeros((112,112,3)) for i, img in enumerate(people1_list): img_path = os.path.join(people1_path,img) img = cv2.imread(img_path) img = cv2.resize(img,(112, 112),interpolation=cv2.INTER_LINEAR) img = np.expand_dims(img, axis=0) if i==0: people1_imgs = img else: people1_imgs = np.concatenate((people1_imgs, img), axis = 0) people2_imgs,box_imgs = predict.predict('path/to/img/with/several/people') people2_imgs = np.array(people2_imgs) def simple(A, B): ret = np.dot(A,B)/(norm(A)*norm(B)) return ret with tf.Session(graph=tf.Graph()) as sess: loaded = tf.saved_model.loader.load(sess, ['serve'], export_path) x = sess.graph.get_tensor_by_name('data:0') y = sess.graph.get_tensor_by_name('fc1/add_1:0') feature = sess.run(y, feed_dict={x: people1_imgs}) feature2 = sess.run(y, feed_dict={x: people2_imgs}) answers = [] for i,f11 in enumerate(feature2): score = 0.0 out_num = 0 check_pt = False for i2,f12 in enumerate(feature): if score < simple(f11, f12): out_num = i2 score = simple(f11, f12) check_pt = True if check_pt == True: print("{} vs {} = {}".format(people1_list[out_num],i,score)) answers.append(people1_list[out_num]) cv2.imshow('detected',box_imgs) for i, img in enumerate(answers): image = cv2.imread(os.path.join(people1_path,img)) cv2.imshow('detected{}'.format(i+1),image) cv2.waitKey(10000) cv2.destroyAllWindows()
[ "noreply@github.com" ]
LeeSiy.noreply@github.com
676fcc1c07c9bc3d2fe08d81889d1dd54d4608fb
266f9ec6f870162cf2313a8f9d49ab5f491bc5ba
/misc/example_op.py
bfc2f350677563b9917d1a5a85bbcd0b63250a4d
[]
no_license
hschoi1/TIL
991a675fd5722c7420ada44e17e449da9e82dea7
d9176811399049f488cbdd0110ea326a9748ada9
refs/heads/master
2021-02-08T04:34:31.112320
2020-06-09T16:53:02
2020-06-09T16:53:02
244,109,948
3
0
null
null
null
null
UTF-8
Python
false
false
144
py
#try examples from https://pytestguide.readthedocs.io/en/latest/pytestGuide/index.html#code-to-test def stat2Num(x, y): return(x+y, (x+y)/2)
[ "hunsun1005@gmail.com" ]
hunsun1005@gmail.com
af6fea87d6f853544358243aa3fee3d9ee5469cb
c5d74b596458b79f42e3cc2eccbaa45544d75f19
/Ctrip/__init__.py
76fdd1594cf42df8de7008a6c9c0fdc9f6d66e34
[]
no_license
XiaolinZHONG/PythonLearn
7c16e870d69c33bc637583c2abd99558dfecc687
15d76375d662c45ce573ecf0fa8d3dce437c3166
refs/heads/master
2020-07-01T03:41:02.507872
2018-01-04T01:27:55
2018-01-04T01:27:55
74,100,074
0
1
null
null
null
null
UTF-8
Python
false
false
94
py
# -*- coding: utf-8 -*- # @Time : 2017/1/16 # @Author : XL ZHONG # @File : __init__.py.py
[ "xlzhong123@163.com" ]
xlzhong123@163.com
390c6ee16b84c3f9123895cf601f21ea1c074eb3
15fa1d48e22b3764d905fc0ca3110bd396f8355b
/_build/jupyter_execute/docs/eda/numeric_vars/K total (kg por ha).py
9bc6c3eb610045ff47b567c10c34b648a7401d87
[]
no_license
SarahNadaud/Test-jupyter-book
1759870df357fed2e0b739c57c5a5435cc181331
27bf960abd8d798bf8d977b512cc52a962ca9dd8
refs/heads/master
2023-02-01T21:16:24.839199
2020-12-17T12:36:43
2020-12-17T12:36:43
322,289,355
0
0
null
null
null
null
UTF-8
Python
false
false
87,659
py
(K total (kg por ha))= # K total (kg por ha) Tipo da variável: numeric ## Relatório geral <pre> +--------------------------+----------+ | | Values | +==========================+==========+ | Count | 2296 | +--------------------------+----------+ | Mín | 0 | +--------------------------+----------+ | Q1 | 0 | +--------------------------+----------+ | Median | 0 | +--------------------------+----------+ | Q3 | 0 | +--------------------------+----------+ | Max | 900 | +--------------------------+----------+ | Mean | 5.6 | +--------------------------+----------+ | Variation | 588.97 | +--------------------------+----------+ | Coefficient of variation | 4.33 | +--------------------------+----------+ | Kurtosis | 804.45 | +--------------------------+----------+ | Na | 2263 | +--------------------------+----------+ | Outliers | 2296 | +--------------------------+----------+ </pre> ## Análise Univariada <div><script src="https://cdn.plot.ly/plotly-latest.min.js"></script><div class="plotly-graph-div" id="6399d0c0-4668-4c16-9f92-218ed52931d9" style="height:370px; width:800px;"></div><script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("6399d0c0-4668-4c16-9f92-218ed52931d9")) { Plotly.newPlot( "6399d0c0-4668-4c16-9f92-218ed52931d9", [{"boxmean": true, "boxpoints": false, "marker": {"color": "rgba(20, 36, 44, 0.7)", "outliercolor": "rgba(233, 75, 59, 1)"}, "name": "", "type": "box", "xaxis": "x", "y": [0.0, 0.0, 0.0, 0.0, 23.0, 0.0, 15.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 60.0, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 7.14067415730337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14.4, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0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0, 0.0, 45.5, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 60.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, null, 0.0, null, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 24.0, 24.0, 0.0, 24.0, 0.0, 0.0, 0.0, 24.0, 24.0, null, 24.0, 24.0, 0.0, 0.0, 0.0, 0.0, 0.0, 36.0, null, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 17.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, 24.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 30.0, 0.0, 0.0, 0.0, 48.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 49.8, 49.8, 49.8, 49.8, 49.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 15.0, 0.0, 40.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 51.0, 51.0, 51.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 31.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.0, 0.0, 0.0, 0.0, 0.0, 7.28089887640449, 7.28089887640449, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 79.5, null, 0.0, 69.0, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, 0.0, null, null, null, 0.0, 0.0, null, null, null, null, 0.0, 0.0, null, null, null, 0.0, null, null, null, null, 0.0, null, null, 0.0, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 78.0, 78.0, 0.0, 0.0, 0.0, 0.0, null, 33.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 42.0, null, 0.0, null, 0.0, 0.0, null, 0.0, null, 0.0, null, null, null, 0.0, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, 0.0, 0.0, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, null, 0.0, 0.0, null, null, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, null, null, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, null, 0.0, 0.0, 0.0, 0.0, null, 0.0, null, null, null, null, 0.0, 0.0, null, null, 0.0, null, 0.0, 0.0, 0.0, null, null, null, 0.0, null, null, null, null, null, 0.0, 0.0, null, null, 0.0, null, 0.0, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, 0.0, 0.0, 0.0, 0.0, 4.0, 36.0, 0.0, 39.0, 0.0, null, 36.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, 138.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, 0.0, null, null, null, null, 0.0, 0.0, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, 0.0, null, 0.0, null, null, 0.0, null, null, 36.0, 0.0, null, null, null, null, null, null, null, 72.0, 0.0, 0.0, 36.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, null, null, 0.0, null, 0.0, null, 0.0, null, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, 0.0, 0.0, 0.0, 0.0, null, null, null, null, 0.0, null, 20.0, 0.0, null, 0.0, 0.0, null, null, null, 0.0, 0.0, 36.0, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, null, 0.0, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 48.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 54.0, 60.0, 48.0, 0.0, 45.0, 0.0, 54.0, 0.0, 60.0, 72.0, 60.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 0.0, null, 0.0, null, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, 30.0, 0.0, 0.0, null, null, 30.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 35.0, null, 0.0, null, null, null, null, null, null, 54.0, null, null, null, null, 42.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 114.0, null, null, null, null, 0.0, 7.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 81.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 84.0, 0.0, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, null, null, null, null, 0.0, null, null, null, null, 0.0, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 33.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 48.0, null, 0.0, 0.0, null, null, null, null, null, 0.0, null, null, 50.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 60.0, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 64.8, 60.0, null, null, 0.0, null, null, null, null, null, null, null, null, 24.3, null, 20.7, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 38.4, null, 38.4, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 41.8, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, 60.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, 33.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 15.0, 15.0, 15.0, 15.0, 15.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 16.305, 16.305, 1.305, null, null, 1.305, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 36.0, 36.0, 36.0, null, null, 60.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, 0.0, 0.0, null, 0.0, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 54.0, 0.0, null, 0.0, 0.0, 0.0, 96.0, null], "yaxis": "y"}, {"marker": {"color": "rgba(20, 36, 44, 0.7)"}, "name": "", "points": false, "type": "violin", "xaxis": "x2", "y": [0.0, 0.0, 0.0, 0.0, 23.0, 0.0, 15.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 60.0, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 7.14067415730337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14.4, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 54.0, 0.0, 11.0, 0.0, 0.0, 42.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 54.0, 42.0, 0.0, 60.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0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0.0, 0.0, 20.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 34.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14.0, 0.0, 0.0, 0.0, 78.0, 0.0, 0.0, 0.0, 29.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 60.0, 0.0, 0.0, 0.0, 0.0, 0.0, 48.0, 0.0, 0.0, 19.5, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 66.0, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, 48.0, 0.0, 60.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 48.0, 0.0, 0.0, 0.0, 48.0, 60.0, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 60.0, 42.0, 0.0, 36.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 23.75, 23.75, 0.0, 0.0, 0.0, 0.0, 0.0, 23.2, 0.0, 0.0, 0.0, 0.0, null, 0.0, 30.0, 0.0, 0.0, 0.0, 45.5, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 60.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, null, 0.0, null, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, 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0, 18.0, 0.0, 0.0, 0.0, 0.0, 7.28089887640449, 7.28089887640449, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 79.5, null, 0.0, 69.0, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, 0.0, null, null, null, 0.0, 0.0, null, null, null, null, 0.0, 0.0, null, null, null, 0.0, null, null, null, null, 0.0, null, null, 0.0, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 78.0, 78.0, 0.0, 0.0, 0.0, 0.0, null, 33.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 42.0, null, 0.0, null, 0.0, 0.0, null, 0.0, null, 0.0, null, null, null, 0.0, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, 0.0, 0.0, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, null, 0.0, 0.0, null, null, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, null, null, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, null, 0.0, 0.0, 0.0, 0.0, null, 0.0, null, null, null, null, 0.0, 0.0, null, null, 0.0, null, 0.0, 0.0, 0.0, null, null, null, 0.0, null, null, null, null, null, 0.0, 0.0, null, null, 0.0, null, 0.0, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, 0.0, 0.0, 0.0, 0.0, 4.0, 36.0, 0.0, 39.0, 0.0, null, 36.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, 138.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, 0.0, null, null, null, null, 0.0, 0.0, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, 0.0, null, 0.0, null, null, 0.0, null, null, 36.0, 0.0, null, null, null, null, null, null, null, 72.0, 0.0, 0.0, 36.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, null, null, 0.0, null, 0.0, null, 0.0, null, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, 0.0, 0.0, 0.0, 0.0, null, null, null, null, 0.0, null, 20.0, 0.0, null, 0.0, 0.0, null, null, null, 0.0, 0.0, 36.0, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, null, 0.0, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 48.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 54.0, 60.0, 48.0, 0.0, 45.0, 0.0, 54.0, 0.0, 60.0, 72.0, 60.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 0.0, null, 0.0, null, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, 30.0, 0.0, 0.0, null, null, 30.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 35.0, null, 0.0, null, null, null, null, null, null, 54.0, null, null, null, null, 42.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 114.0, null, null, null, null, 0.0, 7.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 81.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 84.0, 0.0, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, null, null, null, null, 0.0, null, null, null, null, 0.0, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 33.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 48.0, null, 0.0, 0.0, null, null, null, null, null, 0.0, null, null, 50.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 60.0, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 64.8, 60.0, null, null, 0.0, null, null, null, null, null, null, null, null, 24.3, null, 20.7, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 38.4, null, 38.4, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 41.8, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, 60.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, 33.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 15.0, 15.0, 15.0, 15.0, 15.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 16.305, 16.305, 1.305, null, null, 1.305, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 36.0, 36.0, 36.0, null, null, 60.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, 0.0, 0.0, null, 0.0, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 54.0, 0.0, null, 0.0, 0.0, 0.0, 96.0, null], "yaxis": "y2"}, {"hovertemplate": "%{y:.d}<extra></extra>", "marker": {"color": "rgba(20, 36, 44, 0.7)"}, "type": "histogram", "x": [0.0, 0.0, 0.0, 0.0, 23.0, 0.0, 15.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 60.0, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 7.14067415730337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14.4, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 54.0, 0.0, 11.0, 0.0, 0.0, 42.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 54.0, 42.0, 0.0, 60.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 60.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 42.5862, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 62.9032, 0.0, 0.0, 0.0, 45.0, 0.0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0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 66.0, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, 48.0, 0.0, 60.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 48.0, 0.0, 0.0, 0.0, 48.0, 60.0, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 60.0, 42.0, 0.0, 36.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 23.75, 23.75, 0.0, 0.0, 0.0, 0.0, 0.0, 23.2, 0.0, 0.0, 0.0, 0.0, null, 0.0, 30.0, 0.0, 0.0, 0.0, 45.5, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 60.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, null, 0.0, null, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 24.0, 24.0, 0.0, 24.0, 0.0, 0.0, 0.0, 24.0, 24.0, null, 24.0, 24.0, 0.0, 0.0, 0.0, 0.0, 0.0, 36.0, null, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 17.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, 24.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 30.0, 0.0, 0.0, 0.0, 48.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 49.8, 49.8, 49.8, 49.8, 49.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 15.0, 0.0, 40.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 30.0, 51.0, 51.0, 51.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 31.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.0, 0.0, 0.0, 0.0, 0.0, 7.28089887640449, 7.28089887640449, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 79.5, null, 0.0, 69.0, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, 0.0, null, null, null, 0.0, 0.0, null, null, null, null, 0.0, 0.0, null, null, null, 0.0, null, null, null, null, 0.0, null, null, 0.0, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 78.0, 78.0, 0.0, 0.0, 0.0, 0.0, null, 33.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 42.0, null, 0.0, null, 0.0, 0.0, null, 0.0, null, 0.0, null, null, null, 0.0, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, 0.0, 0.0, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, null, 0.0, 0.0, null, null, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, null, null, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, null, 0.0, 0.0, 0.0, 0.0, null, 0.0, null, null, null, null, 0.0, 0.0, null, null, 0.0, null, 0.0, 0.0, 0.0, null, null, null, 0.0, null, null, null, null, null, 0.0, 0.0, null, null, 0.0, null, 0.0, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, 0.0, 0.0, 0.0, 0.0, 4.0, 36.0, 0.0, 39.0, 0.0, null, 36.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, 138.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, 0.0, null, null, null, null, 0.0, 0.0, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, 0.0, null, 0.0, null, null, 0.0, null, null, 36.0, 0.0, null, null, null, null, null, null, null, 72.0, 0.0, 0.0, 36.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, null, null, 0.0, null, 0.0, null, 0.0, null, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, null, 0.0, 0.0, 0.0, 0.0, null, null, null, null, 0.0, null, 20.0, 0.0, null, 0.0, 0.0, null, null, null, 0.0, 0.0, 36.0, null, null, null, null, 0.0, null, 0.0, 0.0, 0.0, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, null, 0.0, 0.0, 0.0, 48.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, null, 48.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 54.0, 60.0, 48.0, 0.0, 45.0, 0.0, 54.0, 0.0, 60.0, 72.0, 60.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 0.0, null, 0.0, null, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, 0.0, null, null, null, null, 30.0, 0.0, 0.0, null, null, 30.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 35.0, null, 0.0, null, null, null, null, null, null, 54.0, null, null, null, null, 42.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 114.0, null, null, null, null, 0.0, 7.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, null, 0.0, 0.0, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 81.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 84.0, 0.0, 0.0, 0.0, null, null, 0.0, 0.0, 0.0, null, null, null, null, 0.0, null, null, null, null, 0.0, 0.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 33.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 48.0, null, 0.0, 0.0, null, null, null, null, null, 0.0, null, null, 50.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 60.0, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 64.8, 60.0, null, null, 0.0, null, null, null, null, null, null, null, null, 24.3, null, 20.7, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 38.4, null, 38.4, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 41.8, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, 60.0, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, 33.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 15.0, 15.0, 15.0, 15.0, 15.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 16.305, 16.305, 1.305, null, null, 1.305, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 36.0, 36.0, 36.0, null, null, 60.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, 0.0, 0.0, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, 0.0, 0.0, null, 0.0, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.0, null, 54.0, 0.0, null, 0.0, 0.0, 0.0, 96.0, null], "xaxis": "x3", "yaxis": "y3"}], {"height": 370, "hovermode": "x", "margin": {"b": 50, "l": 50, "r": 50, "t": 100}, "paper_bgcolor": "rgba(0, 0, 0, 0)", "plot_bgcolor": "rgb(243, 243, 243)", "separators": ",.", "showlegend": false, "template": {"data": {"bar": [{"error_x": {"color": "#2a3f5f"}, "error_y": {"color": "#2a3f5f"}, "marker": {"line": {"color": "#E5ECF6", "width": 0.5}}, "type": "bar"}], "barpolar": [{"marker": {"line": {"color": "#E5ECF6", "width": 0.5}}, "type": "barpolar"}], "carpet": [{"aaxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "baxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "type": "carpet"}], "choropleth": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "type": "choropleth"}], "contour": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "contour"}], "contourcarpet": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "type": "contourcarpet"}], "heatmap": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "heatmap"}], "heatmapgl": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "heatmapgl"}], "histogram": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "histogram"}], "histogram2d": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "histogram2d"}], "histogram2dcontour": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "histogram2dcontour"}], "mesh3d": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "type": "mesh3d"}], "parcoords": [{"line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "parcoords"}], "pie": [{"automargin": true, "type": "pie"}], "scatter": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatter"}], "scatter3d": [{"line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatter3d"}], "scattercarpet": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattercarpet"}], "scattergeo": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattergeo"}], "scattergl": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattergl"}], "scattermapbox": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattermapbox"}], "scatterpolar": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatterpolar"}], "scatterpolargl": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatterpolargl"}], "scatterternary": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatterternary"}], "surface": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "surface"}], "table": [{"cells": {"fill": {"color": "#EBF0F8"}, "line": {"color": "white"}}, "header": {"fill": {"color": "#C8D4E3"}, "line": {"color": "white"}}, "type": "table"}]}, "layout": {"annotationdefaults": {"arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1}, "coloraxis": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "colorscale": {"diverging": [[0, "#8e0152"], [0.1, "#c51b7d"], [0.2, "#de77ae"], [0.3, "#f1b6da"], [0.4, "#fde0ef"], [0.5, "#f7f7f7"], [0.6, "#e6f5d0"], [0.7, "#b8e186"], [0.8, "#7fbc41"], [0.9, "#4d9221"], [1, "#276419"]], "sequential": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "sequentialminus": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}, "colorway": ["#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52"], "font": {"color": "#2a3f5f"}, "geo": {"bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white"}, "hoverlabel": {"align": "left"}, "hovermode": "closest", "mapbox": {"style": "light"}, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": {"angularaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "bgcolor": "#E5ECF6", "radialaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "scene": {"xaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white"}, "yaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white"}, "zaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white"}}, "shapedefaults": {"line": {"color": "#2a3f5f"}}, "ternary": {"aaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "baxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "bgcolor": "#E5ECF6", "caxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "title": {"x": 0.05}, "xaxis": {"automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "zerolinewidth": 2}, "yaxis": {"automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "zerolinewidth": 2}}}, "title": {"font": {"color": "rgba(20, 36, 44, 0.7)"}, "text": "K total (kg por ha)"}, "width": 800, "xaxis": {"anchor": "y", "domain": [0.0, 0.17333333333333334], "linecolor": "rgba(100, 100, 100, 0)", "showgrid": false, "tickfont": {"color": "rgba(100, 100, 100, 0.8)"}, "zeroline": false}, "xaxis2": {"anchor": "y2", "domain": [0.24, 0.41333333333333333], "linecolor": "rgba(100, 100, 100, 0)", "showgrid": false, "tickfont": {"color": "rgba(100, 100, 100, 0.8)"}, "zeroline": false}, "xaxis3": {"anchor": "y3", "domain": [0.48, 1.0], "hoverformat": ",.0f", "linecolor": "rgba(100, 100, 100, 0)", "showgrid": false, "tickfont": {"color": "rgba(100, 100, 100, 0.8)"}, "zeroline": false}, "yaxis": {"anchor": "x", "domain": [0.0, 1.0], "hoverformat": ",.0f", "linecolor": "rgba(100, 100, 100, 0)", "showgrid": false, "tickfont": {"color": "rgba(100, 100, 100, 0.8)"}, "zeroline": false}, "yaxis2": {"anchor": "x2", "domain": [0.0, 1.0], "hoverformat": ",.0f", "linecolor": "rgba(100, 100, 100, 0)", "showgrid": false, "tickfont": {"color": "rgba(100, 100, 100, 0.8)"}, "zeroline": false}, "yaxis3": {"anchor": "x3", "domain": [0.0, 1.0], "linecolor": "rgba(100, 100, 100, 0)", "showgrid": false, "tickfont": {"color": "rgba(100, 100, 100, 0.8)"}, "zeroline": false}}, {"displayModeBar": false, "showTips": false, "responsive": true} ) }; </script></div>
[ "sarah.nadaud@elogroup.com.br" ]
sarah.nadaud@elogroup.com.br
a28b5e739458397f8701e37081c0593ed88063bc
6376f8a4e4b7f433c6528670461336b975b638ff
/scripts/many_load.py
2c892ac6cd09d68fba5752649e8d764aae1d9651
[]
no_license
ameya-shahu/coursera-django
d04133d6eb975ea54f45a12a62d1495f2dcbd730
3272f513897ec5922e5bbe02d38c303960d09f11
refs/heads/master
2022-12-30T05:39:10.433639
2020-10-13T13:23:26
2020-10-13T13:23:26
288,106,765
0
0
null
null
null
null
UTF-8
Python
false
false
1,395
py
import csv # https://docs.python.org/3/library/csv.html # https://django-extensions.readthedocs.io/en/latest/runscript.html # python3 manage.py runscript many_load from unesco.models import State, Site, Iso, Category, Region def run(): fhand = open('unesco/whc-sites-2018-clean.csv') reader = csv.reader(fhand) next(reader) # Advance past the header State.objects.all().delete() Site.objects.all().delete() Iso.objects.all().delete() Category.objects.all().delete() Region.objects.all().delete() for row in reader: #print(row) cat, created = Category.objects.get_or_create(name=row[7]) sat, created = State.objects.get_or_create(name=row[8]) reg, created = Region.objects.get_or_create(name=row[9]) i, created = Iso.objects.get_or_create(name=row[10]) try: y = int(row[3]) except: y = None try: long = float(row[4]) except: long = None try: lat = float(row[5]) except: lat = None try: area = float(row[6]) except: area = None site = Site(name=row[0], description=row[1], justification=row[2], year=y, longitude=long, latitude=lat, area_hectares=area, category=cat, region=reg, state=sat, iso=i) site.save()
[ "ameyashahu@gmail.com" ]
ameyashahu@gmail.com
2aa575aff205569c313222104ed7b2a61e06ad03
6f31a15cb73175084f2c4485d3dea0b8975b2ec9
/src/pyIdlak/pylib/__init__.py
b5c44a3e37db4e976cb9add9ca83f0ba5f3dfb35
[ "Apache-2.0", "LicenseRef-scancode-public-domain" ]
permissive
Idlak/idlak
c7cd5e6c0b02918cda85dbb2fb5c7333a789c304
4be6f7d951ba0d707a84a2cf8cbfc36689b85a3c
refs/heads/master
2021-11-23T13:28:43.709163
2021-11-01T15:51:46
2021-11-01T15:51:46
127,285,931
65
26
NOASSERTION
2021-11-01T15:51:47
2018-03-29T12:06:52
Shell
UTF-8
Python
false
false
1,414
py
# -*- coding: utf-8 -*- # Copyright 2018 Cereproc Ltd. (author: Matthew Aylett # David Braude) # # 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 # # THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED # WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, # MERCHANTABLITY OR NON-INFRINGEMENT. # See the Apache 2 License for the specific language governing permissions and # limitations under the License. # Note that this is intended to be internal to pyIdlak and not exposed. # SWIG wrapped API from . import pyIdlak_pylib as c_api from .pyIdlak_pylib import ( NONE, AperiodicEnergyOptions, PdfPriorOptions, NnetForwardOptions, ApplyCMVNOptions, DeltaFeaturesOptions, PyReadKaldiDoubleMatrix, PyKaldiMatrixBaseFloat_frmlist, PyKaldiMatrixBaseFloat_tolist, PyKaldiMatrixDouble_frmlist, PyKaldiMatrixDouble_tolist ) from .pyoptions import PyOptions from .utils import ( no_pyIdlak_parse_arkfile, compare_arks, get_rspecifier_keys, get_matrix_by_key, )
[ "dabraude@gmail.com" ]
dabraude@gmail.com
8290e8f45c5e527b27289d1815a583a43214575d
952c682ad7c93d6750de188b063adb56c0468523
/raspi/socket-test.py
67e3dc74f067e6dda1bb99871a4400e23dd18a96
[]
no_license
Jugendhackt/toaster
ff76bb591a801a2f42496f037d0afcda8028088a
d9a0893971e2726a217ebb21d1cf312e5f3a4d04
refs/heads/master
2020-07-15T07:37:47.020187
2019-09-01T14:41:18
2019-09-01T14:41:18
205,513,614
0
0
null
2019-12-29T21:51:26
2019-08-31T07:47:44
TypeScript
UTF-8
Python
false
false
460
py
#!/usr/bin/env python3 import signal signal.signal(signal.SIGINT, signal.SIG_DFL) import asyncio import websockets async def hello(websocket, path): name = await websocket.recv() print(f"< {name}") greeting = f"Hello {name}!" await websocket.send(greeting) print(f"> {greeting}") start_server = websockets.serve(hello, "localhost", 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever()
[ "moritz.ahrens2@gmail.com" ]
moritz.ahrens2@gmail.com
63d46a52a9c3929779b4d498745424b1505a9754
17f29e8f3eab9deb724b10bc7e61c73f1fca21c6
/backend/home/migrations/0004_auto_20200320_0813.py
8596cdb6cafc9245c067cfa29396a8d0c4ff6f09
[]
no_license
crowdbotics-apps/mobilemobapp-dev-2035
91df345e8f6e42760c4156a7dd73a6d8b17250e0
041b1c20c4a14b4595fbcca943cdf46dec445497
refs/heads/master
2022-04-12T06:06:17.910111
2020-03-20T08:13:11
2020-03-20T08:13:11
248,153,145
0
0
null
null
null
null
UTF-8
Python
false
false
1,311
py
# Generated by Django 2.2.11 on 2020-03-20 08:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('home', '0003_customtext_test'), ] operations = [ migrations.CreateModel( name='Test', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('test', models.BigIntegerField()), ], ), migrations.CreateModel( name='Testing', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('test', models.BigIntegerField()), ], ), migrations.CreateModel( name='Testtt', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('testt', models.BinaryField()), ], ), migrations.RemoveField( model_name='customtext', name='test', ), migrations.AddField( model_name='customtext', name='name', field=models.BinaryField(blank=True, null=True), ), ]
[ "team@crowdbotics.com" ]
team@crowdbotics.com
7da594417468f8fff6a257b39670bc08b390a407
daef6ea328be205d289c087f689fa4fb23de935f
/sampling.py
05880d0df0c733d70c8347d30de67bc04b504fe7
[]
no_license
ManulGoyal/GCN_ML_Binary
29e330362b81224941c47a48f1f0ddc94c65c78d
d6949224644852e7ef7d8ca17799cf73c9ed8427
refs/heads/master
2022-11-14T11:55:54.212106
2020-07-07T12:05:36
2020-07-07T12:05:36
277,661,196
5
1
null
null
null
null
UTF-8
Python
false
false
7,420
py
import numpy as np import random # utility function to find class with minimum examples def min_examples_class(annot, dataset): min_cnt = annot.shape[0]+1 min_lbls = [] label_ex_count = np.zeros(annot.shape[1]) for example in dataset: for lbl, tag in enumerate(annot[example, :]): if tag == 0: continue label_ex_count[lbl] += 1 for lbl, cnt in enumerate(label_ex_count): if cnt > 0: if cnt < min_cnt: min_cnt = cnt min_lbls = [lbl] elif cnt == min_cnt: min_lbls.append(lbl) if len(min_lbls) > 0: return random.choice(min_lbls) else: return -1 # utility function to return examples containing a specific label def examples_with_label(lbl, annot, dataset): examples = [] for example in dataset: if annot[example, lbl] == 1: examples.append(example) return examples # utility function to get target subset in which a given example # should be inserted def get_target_subset(desired_ex_cnt, desired_ex_cnt_lbl, target_lbl): max_lbl_desiring_subsets = [] max_lbl_desire = -100000 # finding the subset(s) in which the desired examples # of target_lbl are maximum for subset in range(len(desired_ex_cnt_lbl)): desire = desired_ex_cnt_lbl[subset][target_lbl] if desire > max_lbl_desire: max_lbl_desire = desire max_lbl_desiring_subsets = [subset] elif desire == max_lbl_desire: max_lbl_desiring_subsets.append(subset) max_desiring_subsets = [] max_desire = -100000 # breaking ties by finding those subsets from above # found subsets which have maximum number of desired examples (total) for subset in max_lbl_desiring_subsets: if desired_ex_cnt[subset] > max_desire: max_desire = desired_ex_cnt[subset] max_desiring_subsets = [subset] elif desired_ex_cnt[subset] == max_desire: max_desiring_subsets.append(subset) # further ties are broken randomly return random.choice(max_desiring_subsets) # This function distributes the examples in the dataset among k subsets # according to the proportions [prop[0], prop[1], ..., prop[k-1]] # such that the number of examples of each label in a particular subset # is propotional to the number of examples of that label in the original dataset # For example, if k = 10 and prop = [0.1, 0.1, ..., 0.1], then each subset # will contain approx. 1/10th of the examples and for each label i, the number # of examples with label i in any subset will be approx. 1/10th of the number of # examples with the label i in the original dataset. # k is number of subsets and prop is an array of proportions # of examples in each subset def stratify(annot, dataset, k, prop): assert(k == len(prop)) num_examples = annot.shape[0] num_classes = annot.shape[1] # initially dataset contains all examples # dataset = list(range(num_examples)) desired_ex_cnt = [] desired_ex_cnt_lbl = [] # list of subsets, visually, subsets[i] is a list of examples # that are distributed to the i-th subset subsets = [[] for i in range(k)] for proportion in prop: # calculate desired number of examples in subset desired_ex_cnt.append(int(proportion * num_examples)) # calculate desired number of examples of each label in subset desired_ex_cnt_subset = [] for lbl in range(num_classes): num_examples_with_lbl = len(examples_with_label(lbl, annot, dataset)) desired_ex_cnt_subset.append(int(num_examples_with_lbl * proportion)) desired_ex_cnt_lbl.append(desired_ex_cnt_subset) while len(dataset) > 0: target_lbl = min_examples_class(annot, dataset) # print(target_lbl) if target_lbl == -1: break ex_with_target_lbl = examples_with_label(target_lbl, annot, dataset) for example in ex_with_target_lbl: subset = get_target_subset(desired_ex_cnt, desired_ex_cnt_lbl, target_lbl) # add example to the target subset subsets[subset].append(example) # remove example from the dataset dataset.remove(example) # for each label of example, decrement desired number of examples # for that label in the target subset by 1 for lbl, tag in enumerate(annot[example, :]): if tag == 0: continue desired_ex_cnt_lbl[subset][lbl] -= 1 # decrement total desired number of examples of target subset by 1 desired_ex_cnt[subset] -= 1 return subsets # returns list of negative labels corresponding to positive label lbl # based on semantic paths def get_negative_labels(lbl, sp, nl, annot, singleton_nodes): negative_labels = [] images_count = annot.shape[0] label_considered = np.zeros((annot.shape[1],)) for i, path in enumerate(sp): leaf_node = 0 for j, node in enumerate(path): if node == lbl: leaf_node = -1 lbl_layer = nl[i][j] for k in range(j, len(path)): if nl[i][k] != lbl_layer: leaf_node = k break break if leaf_node == -1: continue if label_considered[path[leaf_node]] == 1: continue negative_labels.append(path[leaf_node]) leaf_node_layer = nl[i][leaf_node] for j in range(leaf_node, len(path)): if nl[i][j] == leaf_node_layer: label_considered[path[j]] = 1 else: break for i in singleton_nodes: if i == lbl or label_considered[i] == 1: continue negative_labels.append(i) return negative_labels def positive_negative_split(lbl, count, sp, nl, annot, singleton_nodes): # get all samples which have label lbl positive_samples_all = examples_with_label(lbl, annot, list(range(annot.shape[0]))) if len(positive_samples_all) <= count: # select all positive samples count = len(positive_samples_all) positive_samples = positive_samples_all else: # randomly sample 'count' number of unique examples positive_samples = random.sample(positive_samples_all, count) negative_labels = get_negative_labels(lbl, sp, nl, annot, singleton_nodes) # select only negative labels negative_annot = annot[:, negative_labels] label_count = negative_annot.sum(axis=1) # select only those images which have atleast one negative label and don't contain lbl negative_samples_dataset = [] for img in range(annot.shape[0]): if label_count[img] > 0 and annot[img, lbl] == 0: negative_samples_dataset.append(img) total_negative_samples = len(negative_samples_dataset) prop = [count/total_negative_samples, 1-count/total_negative_samples] # divide the negative samples into two subsets the first of which # has approx. count number of samples using stratification subsets = stratify(negative_annot, negative_samples_dataset, 2, prop) negative_samples = subsets[0] return positive_samples, negative_samples
[ "goyal.10@iitj.ac.in" ]
goyal.10@iitj.ac.in
fb3b2fd6f3497e8dd1ded9a6c54a330aac22db31
3fa1b23746232975b3b014db2f525007a3b49991
/anna_code/demographics/rct_consented/subset_values_to_randomized_people.py
a4791706554ee798896de773f5da39c3e0e96e89
[]
no_license
AshleyLab/myheartcounts
ba879e10abbde085b5c9550f0c13ab3f730d7d03
0f80492f7d3fc53d25bdb2c69f14961326450edf
refs/heads/master
2021-06-17T05:41:58.405061
2021-02-28T05:33:08
2021-02-28T05:33:08
32,551,526
7
1
null
2020-08-17T22:37:43
2015-03-19T23:25:01
OpenEdge ABL
UTF-8
Python
false
false
325
py
import pandas as pd import sys import pdb data=pd.read_csv(sys.argv[1],header=None,sep='\t') subjects=pd.read_csv('subjects.txt',header=None) subset=data[data[0].isin(subjects[0])] #nums=pd.to_numeric(subset[1],errors='coerce') #mean_val=nums.mean() #print(mean_val) #std_val=nums.std() #print(std_val) pdb.set_trace()
[ "annashcherbina@gmail.com" ]
annashcherbina@gmail.com
79ac61a468fd1369f69a7ecf1add11e0fbb9ba5e
8a6bac97182629f426e442308f6db53ee932e537
/venv/Lib/site-packages/twisted/python/_inotify.py
d5203df3c388a80029a2286d2706155e395eeddf
[]
no_license
AmalioF96/DashBoard
8b8af75e7db7ab095c0cd05acb8b2b2764ab5fd5
4500a84a934fd5c24199d1864f0667c0d90e6174
refs/heads/master
2023-01-08T02:03:05.168925
2020-11-07T12:19:53
2020-11-07T12:19:53
230,789,973
1
0
null
null
null
null
UTF-8
Python
false
false
3,454
py
# -*- test-case-name: twisted.internet.test.test_inotify -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Very low-level ctypes-based interface to Linux inotify(7). ctypes and a version of libc which supports inotify system calls are required. """ import ctypes import ctypes.util class INotifyError(Exception): """ Unify all the possible exceptions that can be raised by the INotify API. """ def init(): """ Create an inotify instance and return the associated file descriptor. """ fd = libc.inotify_init() if fd < 0: raise INotifyError("INotify initialization error.") return fd def add(fd, path, mask): """ Add a watch for the given path to the inotify file descriptor, and return the watch descriptor. @param fd: The file descriptor returned by C{libc.inotify_init}. @type fd: L{int} @param path: The path to watch via inotify. @type path: L{twisted.python.filepath.FilePath} @param mask: Bitmask specifying the events that inotify should monitor. @type mask: L{int} """ wd = libc.inotify_add_watch(fd, path.asBytesMode().path, mask) if wd < 0: raise INotifyError("Failed to add watch on '%r' - (%r)" % (path, wd)) return wd def remove(fd, wd): """ Remove the given watch descriptor from the inotify file descriptor. """ # When inotify_rm_watch returns -1 there's an error: # The errno for this call can be either one of the following: # EBADF: fd is not a valid file descriptor. # EINVAL: The watch descriptor wd is not valid; or fd is # not an inotify file descriptor. # # if we can't access the errno here we cannot even raise # an exception and we need to ignore the problem, one of # the most common cases is when you remove a directory from # the filesystem and that directory is observed. When inotify # tries to call inotify_rm_watch with a non existing directory # either of the 2 errors might come up because the files inside # it might have events generated way before they were handled. # Unfortunately only ctypes in Python 2.6 supports accessing errno: # http://bugs.python.org/issue1798 and in order to solve # the problem for previous versions we need to introduce # code that is quite complex: # http://stackoverflow.com/questions/661017/access-to-errno-from-python # # See #4310 for future resolution of this issue. libc.inotify_rm_watch(fd, wd) def initializeModule(libc): """ Initialize the module, checking if the expected APIs exist and setting the argtypes and restype for C{inotify_init}, C{inotify_add_watch}, and C{inotify_rm_watch}. """ for function in ("inotify_add_watch", "inotify_init", "inotify_rm_watch"): if getattr(libc, function, None) is None: raise ImportError("libc6 2.4 or higher needed") libc.inotify_init.argtypes = [] libc.inotify_init.restype = ctypes.c_int libc.inotify_rm_watch.argtypes = [ ctypes.c_int, ctypes.c_int] libc.inotify_rm_watch.restype = ctypes.c_int libc.inotify_add_watch.argtypes = [ ctypes.c_int, ctypes.c_char_p, ctypes.c_uint32] libc.inotify_add_watch.restype = ctypes.c_int name = ctypes.util.find_library('c') if not name: raise ImportError("Can't find C library.") libc = ctypes.cdll.LoadLibrary(name) initializeModule(libc)
[ "amaliocabeza.16@gmail.com" ]
amaliocabeza.16@gmail.com
a27dae32c239b9c924dc4fb6da5cfae518d6f2ab
1d5c13c3f628de90674a3bf11a5ca6819813bd54
/eletivaspro/authenticacao/views.py
6aa8993427a435e4b8f0478eb28cfd40760c7db5
[ "MIT" ]
permissive
flavioVitoriano/EletivasPro
7e5870378598dcc6d7c7c7e844603caeb8862d1c
34447081a1923286d78c56bd1f019214a8b25999
refs/heads/master
2022-12-07T11:37:32.340065
2020-09-04T02:04:42
2020-09-04T02:05:36
159,074,296
0
0
MIT
2022-11-22T04:23:11
2018-11-25T21:02:10
JavaScript
UTF-8
Python
false
false
1,913
py
from django.utils.http import is_safe_url from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth import REDIRECT_FIELD_NAME, login as auth_login, logout as auth_logout from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required from django.views.decorators.cache import never_cache from django.views.decorators.csrf import csrf_protect from django.views.decorators.debug import sensitive_post_parameters from django.views.generic import FormView, RedirectView, TemplateView from django.shortcuts import reverse from backend.models import Aluno, Eletiva, Registro class LoginView(FormView): """ Provides the ability to login as a user with a username and password """ success_url = "/gestao" form_class = AuthenticationForm redirect_field_name = REDIRECT_FIELD_NAME template_name = "gestao/login_page.html" @method_decorator(sensitive_post_parameters('password')) @method_decorator(csrf_protect) @method_decorator(never_cache) def dispatch(self, request, *args, **kwargs): # Sets a test cookie to make sure the user has cookies enabled request.session.set_test_cookie() return super(LoginView, self).dispatch(request, *args, **kwargs) def form_valid(self, form): auth_login(self.request, form.get_user()) if self.request.session.test_cookie_worked(): self.request.session.delete_test_cookie() return super(LoginView, self).form_valid(form) def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) return context class LogoutView(RedirectView): """ Provides users the ability to logout """ url = '/auth/login/' def get(self, request, *args, **kwargs): auth_logout(request) return super(LogoutView, self).get(request, *args, **kwargs)
[ "flavio.vitorianodev@gmail.com" ]
flavio.vitorianodev@gmail.com
3363b24c53c076531c61d750405dddc40ee83282
2cb7968701bd1f9fb32b55a5efccddf7a9504c29
/python/remove_elements.py
ca05c62278dc9c9cb6949c32e0fd930a7ddb11d8
[]
no_license
sgn255/algorithms
35153567e40ff2ca78110f19f21f9f87c49fe236
d66c9fe68a12463a6d3a314df8d61f22bbaa79fd
refs/heads/master
2020-06-30T01:02:52.108135
2019-08-10T14:04:45
2019-08-10T14:04:45
200,667,525
0
0
null
null
null
null
UTF-8
Python
false
false
179
py
# Given an array and a value: # remove all instances of that value in-place def remove_element(arr, val): while val in arr : del arr[arr.index(val)] return arr
[ "scott-green89@hotmail.com" ]
scott-green89@hotmail.com
c48fcf7a93643c3bd44ec66eded5c44ff6bcc940
f0b14db2538fb49b3cc70d7c01fdae35c148624b
/config.py
cd63a9e6ddcf330b17d71e2a52b167e1c21e1372
[ "MIT" ]
permissive
ICRA-2021/PoseGrouping
12a5725355f28e67ef0dce4673b09f5f8431d373
7e896aa00d947520f9240d6681536c5ef79e9b49
refs/heads/main
2023-05-23T16:20:26.926759
2021-06-17T05:43:39
2021-06-17T05:43:52
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,574
py
import logging class Config(object): def __init__(self): self.logger = logging.getLogger("Config") self.params = set() self.set("inference_split", "valid") self.set("exp_root", "exps") self.set("batch_size", 4) self.set("num_workers", 0) self.set("gpu", 0) self.set("anno_file_train", "data/coco/annotations/person_keypoints_train2017.json") self.set("anno_file_valid", "data/coco/annotations/person_keypoints_val2017.json") self.set("anno_file_test", "data/coco/annotations/image_info_test-dev2017.json") self.set("cache_dir", "data/coco/cache") self.set("max_n_det", 250) self.set("gnn_n_layers_geometry", 3) self.set("gnn_n_layers_visual", 1) self.set("learning_rate", 5e-4) self.set("num_epochs", 500) self.set("num_steps_per_epoch", 2000) self.set("training", True) self.set("validation", True) self.set("save_prediction", True) self.set("save_model", True) def set(self, k, v): self.logger.debug("Setting {}({}) to {}({})".format(k, type(k), v, type(v))) self.__setattr__(k, v) self.params.add(k) def get(self, k): if k in self.params and k in self.__dict__: return self.__getattribute__(k) else: return None def print_all_params(self): self.logger.debug("Printing configs:") for k in sorted(self.params): self.logger.debug("\t{}: {}".format(k, self.get(k))) cfg = Config()
[ "jiahao@comp.nus.edu.sg" ]
jiahao@comp.nus.edu.sg
54cc6c350996f8692a63f7d0531f0d5639f868c9
1a8cda5c58f524fd73cb7472681c0d85e07fe8bb
/utils/eval_tool.py
39343c2a4e668f8df21b35181d4799f8b80e7ff6
[]
no_license
shujunge/FasterRCNN_pytorch
93feb144e987cafa9ee9e5c6302708e36c5837e6
a37436e7f77e141fb7c673234c79e88538b99aad
refs/heads/master
2020-05-03T08:43:27.072424
2019-03-31T04:14:53
2019-03-31T04:14:53
178,534,290
0
0
null
null
null
null
UTF-8
Python
false
false
14,023
py
from __future__ import division from collections import defaultdict import itertools import numpy as np import six def bbox_iou(bbox_a, bbox_b): """Calculate the Intersection of Unions (IoUs) between bounding boxes. IoU is calculated as a ratio of area of the intersection and area of the union. This function accepts both :obj:`numpy.ndarray` and :obj:`cupy.ndarray` as inputs. Please note that both :obj:`bbox_a` and :obj:`bbox_b` need to be same type. The output is same type as the type of the inputs. Args: bbox_a (array): An array whose shape is :math:`(N, 4)`. :math:`N` is the number of bounding boxes. The dtype should be :obj:`numpy.float32`. bbox_b (array): An array similar to :obj:`bbox_a`, whose shape is :math:`(K, 4)`. The dtype should be :obj:`numpy.float32`. Returns: array: An array whose shape is :math:`(N, K)`. \ An element at index :math:`(n, k)` contains IoUs between \ :math:`n` th bounding box in :obj:`bbox_a` and :math:`k` th bounding \ box in :obj:`bbox_b`. """ if bbox_a.shape[1] != 4 or bbox_b.shape[1] != 4: raise IndexError # top left tl = np.maximum(bbox_a[:, None, :2], bbox_b[:, :2]) # bottom right br = np.minimum(bbox_a[:, None, 2:], bbox_b[:, 2:]) area_i = np.prod(br - tl, axis=2) * (tl < br).all(axis=2) area_a = np.prod(bbox_a[:, 2:] - bbox_a[:, :2], axis=1) area_b = np.prod(bbox_b[:, 2:] - bbox_b[:, :2], axis=1) return area_i / (area_a[:, None] + area_b - area_i) def eval_detection_voc( pred_bboxes, pred_labels, pred_scores, gt_bboxes, gt_labels, gt_difficults=None, iou_thresh=0.5, use_07_metric=False): """Calculate average precisions based on evaluation code of PASCAL VOC. This function evaluates predicted bounding boxes obtained from a dataset which has :math:`N` images by using average precision for each class. The code is based on the evaluation code used in PASCAL VOC Challenge. Args: pred_bboxes (iterable of numpy.ndarray): An iterable of :math:`N` sets of bounding boxes. Its index corresponds to an index for the base dataset. Each element of :obj:`pred_bboxes` is a set of coordinates of bounding boxes. This is an array whose shape is :math:`(R, 4)`, where :math:`R` corresponds to the number of bounding boxes, which may vary among boxes. The second axis corresponds to :math:`y_{min}, x_{min}, y_{max}, x_{max}` of a bounding box. pred_labels (iterable of numpy.ndarray): An iterable of labels. Similar to :obj:`pred_bboxes`, its index corresponds to an index for the base dataset. Its length is :math:`N`. pred_scores (iterable of numpy.ndarray): An iterable of confidence scores for predicted bounding boxes. Similar to :obj:`pred_bboxes`, its index corresponds to an index for the base dataset. Its length is :math:`N`. gt_bboxes (iterable of numpy.ndarray): An iterable of ground truth bounding boxes whose length is :math:`N`. An element of :obj:`gt_bboxes` is a bounding box whose shape is :math:`(R, 4)`. Note that the number of bounding boxes in each image does not need to be same as the number of corresponding predicted boxes. gt_labels (iterable of numpy.ndarray): An iterable of ground truth labels which are organized similarly to :obj:`gt_bboxes`. gt_difficults (iterable of numpy.ndarray): An iterable of boolean arrays which is organized similarly to :obj:`gt_bboxes`. This tells whether the corresponding ground truth bounding box is difficult or not. By default, this is :obj:`None`. In that case, this function considers all bounding boxes to be not difficult. iou_thresh (float): A prediction is correct if its Intersection over Union with the ground truth is above this value. use_07_metric (bool): Whether to use PASCAL VOC 2007 evaluation metric for calculating average precision. The default value is :obj:`False`. Returns: dict: The keys, value-types and the description of the values are listed below. * **ap** (*numpy.ndarray*): An array of average precisions. \ The :math:`l`-th value corresponds to the average precision \ for class :math:`l`. If class :math:`l` does not exist in \ either :obj:`pred_labels` or :obj:`gt_labels`, the corresponding \ value is set to :obj:`numpy.nan`. * **map** (*float*): The average of Average Precisions over classes. """ prec, rec = calc_detection_voc_prec_rec( pred_bboxes, pred_labels, pred_scores, gt_bboxes, gt_labels, gt_difficults, iou_thresh=iou_thresh) ap = calc_detection_voc_ap(prec, rec, use_07_metric=use_07_metric) return {'ap': ap, 'map': np.nanmean(ap)} def calc_detection_voc_prec_rec( pred_bboxes, pred_labels, pred_scores, gt_bboxes, gt_labels, gt_difficults=None, iou_thresh=0.5): """Calculate precision and recall based on evaluation code of PASCAL VOC. This function calculates precision and recall of predicted bounding boxes obtained from a dataset which has :math:`N` images. The code is based on the evaluation code used in PASCAL VOC Challenge. Args: pred_bboxes (iterable of numpy.ndarray): An iterable of :math:`N` sets of bounding boxes. Its index corresponds to an index for the base dataset. Each element of :obj:`pred_bboxes` is a set of coordinates of bounding boxes. This is an array whose shape is :math:`(R, 4)`, where :math:`R` corresponds to the number of bounding boxes, which may vary among boxes. The second axis corresponds to :math:`y_{min}, x_{min}, y_{max}, x_{max}` of a bounding box. pred_labels (iterable of numpy.ndarray): An iterable of labels. Similar to :obj:`pred_bboxes`, its index corresponds to an index for the base dataset. Its length is :math:`N`. pred_scores (iterable of numpy.ndarray): An iterable of confidence scores for predicted bounding boxes. Similar to :obj:`pred_bboxes`, its index corresponds to an index for the base dataset. Its length is :math:`N`. gt_bboxes (iterable of numpy.ndarray): An iterable of ground truth bounding boxes whose length is :math:`N`. An element of :obj:`gt_bboxes` is a bounding box whose shape is :math:`(R, 4)`. Note that the number of bounding boxes in each image does not need to be same as the number of corresponding predicted boxes. gt_labels (iterable of numpy.ndarray): An iterable of ground truth labels which are organized similarly to :obj:`gt_bboxes`. gt_difficults (iterable of numpy.ndarray): An iterable of boolean arrays which is organized similarly to :obj:`gt_bboxes`. This tells whether the corresponding ground truth bounding box is difficult or not. By default, this is :obj:`None`. In that case, this function considers all bounding boxes to be not difficult. iou_thresh (float): A prediction is correct if its Intersection over Union with the ground truth is above this value.. Returns: tuple of two lists: This function returns two lists: :obj:`prec` and :obj:`rec`. * :obj:`prec`: A list of arrays. :obj:`prec[l]` is precision \ for class :math:`l`. If class :math:`l` does not exist in \ either :obj:`pred_labels` or :obj:`gt_labels`, :obj:`prec[l]` is \ set to :obj:`None`. * :obj:`rec`: A list of arrays. :obj:`rec[l]` is recall \ for class :math:`l`. If class :math:`l` that is not marked as \ difficult does not exist in \ :obj:`gt_labels`, :obj:`rec[l]` is \ set to :obj:`None`. """ pred_bboxes = iter(pred_bboxes) pred_labels = iter(pred_labels) pred_scores = iter(pred_scores) gt_bboxes = iter(gt_bboxes) gt_labels = iter(gt_labels) if gt_difficults is None: gt_difficults = itertools.repeat(None) else: gt_difficults = iter(gt_difficults) n_pos = defaultdict(int) score = defaultdict(list) match = defaultdict(list) for pred_bbox, pred_label, pred_score, gt_bbox, gt_label, gt_difficult in \ six.moves.zip( pred_bboxes, pred_labels, pred_scores, gt_bboxes, gt_labels, gt_difficults): if gt_difficult is None: gt_difficult = np.zeros(gt_bbox.shape[0], dtype=bool) for l in np.unique(np.concatenate((pred_label, gt_label)).astype(int)): pred_mask_l = pred_label == l pred_bbox_l = pred_bbox[pred_mask_l] pred_score_l = pred_score[pred_mask_l] # sort by score order = pred_score_l.argsort()[::-1] pred_bbox_l = pred_bbox_l[order] pred_score_l = pred_score_l[order] gt_mask_l = gt_label == l gt_bbox_l = gt_bbox[gt_mask_l] gt_difficult_l = gt_difficult[gt_mask_l] n_pos[l] += np.logical_not(gt_difficult_l).sum() score[l].extend(pred_score_l) if len(pred_bbox_l) == 0: continue if len(gt_bbox_l) == 0: match[l].extend((0,) * pred_bbox_l.shape[0]) continue # VOC evaluation follows integer typed bounding boxes. pred_bbox_l = pred_bbox_l.copy() pred_bbox_l[:, 2:] += 1 gt_bbox_l = gt_bbox_l.copy() gt_bbox_l[:, 2:] += 1 iou = bbox_iou(pred_bbox_l, gt_bbox_l) gt_index = iou.argmax(axis=1) # set -1 if there is no matching ground truth gt_index[iou.max(axis=1) < iou_thresh] = -1 del iou selec = np.zeros(gt_bbox_l.shape[0], dtype=bool) for gt_idx in gt_index: if gt_idx >= 0: if gt_difficult_l[gt_idx]: match[l].append(-1) else: if not selec[gt_idx]: match[l].append(1) else: match[l].append(0) selec[gt_idx] = True else: match[l].append(0) for iter_ in ( pred_bboxes, pred_labels, pred_scores, gt_bboxes, gt_labels, gt_difficults): if next(iter_, None) is not None: raise ValueError('Length of input iterables need to be same.') n_fg_class = max(n_pos.keys()) + 1 prec = [None] * n_fg_class rec = [None] * n_fg_class for l in n_pos.keys(): score_l = np.array(score[l]) match_l = np.array(match[l], dtype=np.int8) order = score_l.argsort()[::-1] match_l = match_l[order] tp = np.cumsum(match_l == 1) fp = np.cumsum(match_l == 0) # If an element of fp + tp is 0, # the corresponding element of prec[l] is nan. prec[l] = tp / (fp + tp) # If n_pos[l] is 0, rec[l] is None. if n_pos[l] > 0: rec[l] = tp / n_pos[l] return prec, rec def calc_detection_voc_ap(prec, rec, use_07_metric=False): """Calculate average precisions based on evaluation code of PASCAL VOC. This function calculates average precisions from given precisions and recalls. The code is based on the evaluation code used in PASCAL VOC Challenge. Args: prec (list of numpy.array): A list of arrays. :obj:`prec[l]` indicates precision for class :math:`l`. If :obj:`prec[l]` is :obj:`None`, this function returns :obj:`numpy.nan` for class :math:`l`. rec (list of numpy.array): A list of arrays. :obj:`rec[l]` indicates recall for class :math:`l`. If :obj:`rec[l]` is :obj:`None`, this function returns :obj:`numpy.nan` for class :math:`l`. use_07_metric (bool): Whether to use PASCAL VOC 2007 evaluation metric for calculating average precision. The default value is :obj:`False`. Returns: ~numpy.ndarray: This function returns an array of average precisions. The :math:`l`-th value corresponds to the average precision for class :math:`l`. If :obj:`prec[l]` or :obj:`rec[l]` is :obj:`None`, the corresponding value is set to :obj:`numpy.nan`. """ n_fg_class = len(prec) ap = np.empty(n_fg_class) for l in six.moves.range(n_fg_class): if prec[l] is None or rec[l] is None: ap[l] = np.nan continue if use_07_metric: # 11 point metric ap[l] = 0 for t in np.arange(0., 1.1, 0.1): if np.sum(rec[l] >= t) == 0: p = 0 else: p = np.max(np.nan_to_num(prec[l])[rec[l] >= t]) ap[l] += p / 11 else: # correct AP calculation # first append sentinel values at the end mpre = np.concatenate(([0], np.nan_to_num(prec[l]), [0])) mrec = np.concatenate(([0], rec[l], [1])) mpre = np.maximum.accumulate(mpre[::-1])[::-1] # to calculate area under PR curve, look for points # where X axis (recall) changes value i = np.where(mrec[1:] != mrec[:-1])[0] # and sum (\Delta recall) * prec ap[l] = np.sum((mrec[i + 1] - mrec[i]) * mpre[i + 1]) return ap
[ "zfwang@stu.xidian.edu.cn" ]
zfwang@stu.xidian.edu.cn
ecf4436b8a78f9d5ddaa025ab1322e91b1b42fd3
42f5eaf16bfd7076cb5a598cf2f239faa575f28b
/05-grpc-google-cloud-speech/python/google/watcher/v1/watch_pb2.py
09760ad4eca095c7ba8e69b44ef548c3cbe4de21
[]
no_license
jiriklepl/IMW-2019
ab0e1c791a794ccf8a6a8d8d4e732c29acee134c
921c85d3c8132114ad90db8deb52eb5ddc06c720
refs/heads/master
2020-08-28T13:29:15.087785
2019-12-15T17:12:24
2019-12-15T17:12:24
217,711,235
0
0
null
null
null
null
UTF-8
Python
false
true
9,093
py
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/watcher/v1/watch.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='google/watcher/v1/watch.proto', package='google.watcher.v1', syntax='proto3', serialized_options=b'\n\025com.google.watcher.v1B\nWatchProtoP\001Z8google.golang.org/genproto/googleapis/watcher/v1;watcher', serialized_pb=b'\n\x1dgoogle/watcher/v1/watch.proto\x12\x11google.watcher.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/protobuf/any.proto\x1a\x1bgoogle/protobuf/empty.proto\"0\n\x07Request\x12\x0e\n\x06target\x18\x01 \x01(\t\x12\x15\n\rresume_marker\x18\x02 \x01(\x0c\"9\n\x0b\x43hangeBatch\x12*\n\x07\x63hanges\x18\x01 \x03(\x0b\x32\x19.google.watcher.v1.Change\"\xe6\x01\n\x06\x43hange\x12\x0f\n\x07\x65lement\x18\x01 \x01(\t\x12.\n\x05state\x18\x02 \x01(\x0e\x32\x1f.google.watcher.v1.Change.State\x12\"\n\x04\x64\x61ta\x18\x06 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x15\n\rresume_marker\x18\x04 \x01(\x0c\x12\x11\n\tcontinued\x18\x05 \x01(\x08\"M\n\x05State\x12\n\n\x06\x45XISTS\x10\x00\x12\x12\n\x0e\x44OES_NOT_EXIST\x10\x01\x12\x19\n\x15INITIAL_STATE_SKIPPED\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x32\x63\n\x07Watcher\x12X\n\x05Watch\x12\x1a.google.watcher.v1.Request\x1a\x1e.google.watcher.v1.ChangeBatch\"\x11\x82\xd3\xe4\x93\x02\x0b\x12\t/v1/watch0\x01\x42_\n\x15\x63om.google.watcher.v1B\nWatchProtoP\x01Z8google.golang.org/genproto/googleapis/watcher/v1;watcherb\x06proto3' , dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_protobuf_dot_any__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,]) _CHANGE_STATE = _descriptor.EnumDescriptor( name='State', full_name='google.watcher.v1.Change.State', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='EXISTS', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DOES_NOT_EXIST', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='INITIAL_STATE_SKIPPED', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='ERROR', index=3, number=3, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=401, serialized_end=478, ) _sym_db.RegisterEnumDescriptor(_CHANGE_STATE) _REQUEST = _descriptor.Descriptor( name='Request', full_name='google.watcher.v1.Request', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='target', full_name='google.watcher.v1.Request.target', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='resume_marker', full_name='google.watcher.v1.Request.resume_marker', index=1, number=2, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=138, serialized_end=186, ) _CHANGEBATCH = _descriptor.Descriptor( name='ChangeBatch', full_name='google.watcher.v1.ChangeBatch', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='changes', full_name='google.watcher.v1.ChangeBatch.changes', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=188, serialized_end=245, ) _CHANGE = _descriptor.Descriptor( name='Change', full_name='google.watcher.v1.Change', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='element', full_name='google.watcher.v1.Change.element', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='state', full_name='google.watcher.v1.Change.state', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='data', full_name='google.watcher.v1.Change.data', index=2, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='resume_marker', full_name='google.watcher.v1.Change.resume_marker', index=3, number=4, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='continued', full_name='google.watcher.v1.Change.continued', index=4, number=5, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _CHANGE_STATE, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=248, serialized_end=478, ) _CHANGEBATCH.fields_by_name['changes'].message_type = _CHANGE _CHANGE.fields_by_name['state'].enum_type = _CHANGE_STATE _CHANGE.fields_by_name['data'].message_type = google_dot_protobuf_dot_any__pb2._ANY _CHANGE_STATE.containing_type = _CHANGE DESCRIPTOR.message_types_by_name['Request'] = _REQUEST DESCRIPTOR.message_types_by_name['ChangeBatch'] = _CHANGEBATCH DESCRIPTOR.message_types_by_name['Change'] = _CHANGE _sym_db.RegisterFileDescriptor(DESCRIPTOR) Request = _reflection.GeneratedProtocolMessageType('Request', (_message.Message,), { 'DESCRIPTOR' : _REQUEST, '__module__' : 'google.watcher.v1.watch_pb2' # @@protoc_insertion_point(class_scope:google.watcher.v1.Request) }) _sym_db.RegisterMessage(Request) ChangeBatch = _reflection.GeneratedProtocolMessageType('ChangeBatch', (_message.Message,), { 'DESCRIPTOR' : _CHANGEBATCH, '__module__' : 'google.watcher.v1.watch_pb2' # @@protoc_insertion_point(class_scope:google.watcher.v1.ChangeBatch) }) _sym_db.RegisterMessage(ChangeBatch) Change = _reflection.GeneratedProtocolMessageType('Change', (_message.Message,), { 'DESCRIPTOR' : _CHANGE, '__module__' : 'google.watcher.v1.watch_pb2' # @@protoc_insertion_point(class_scope:google.watcher.v1.Change) }) _sym_db.RegisterMessage(Change) DESCRIPTOR._options = None _WATCHER = _descriptor.ServiceDescriptor( name='Watcher', full_name='google.watcher.v1.Watcher', file=DESCRIPTOR, index=0, serialized_options=None, serialized_start=480, serialized_end=579, methods=[ _descriptor.MethodDescriptor( name='Watch', full_name='google.watcher.v1.Watcher.Watch', index=0, containing_service=None, input_type=_REQUEST, output_type=_CHANGEBATCH, serialized_options=b'\202\323\344\223\002\013\022\t/v1/watch', ), ]) _sym_db.RegisterServiceDescriptor(_WATCHER) DESCRIPTOR.services_by_name['Watcher'] = _WATCHER # @@protoc_insertion_point(module_scope)
[ "jiriklepl@seznam.cz" ]
jiriklepl@seznam.cz
751a0292d7f84b53fc00ed0ad383672d8562de3a
2e83e004d8a69a773d1e305152edd16e4ea35ed8
/students/eric_grandeo/lesson03/logic_1.py
3be7081d76217fb959a59ab909527edf01a7b953
[]
no_license
UWPCE-PythonCert-ClassRepos/SP_Online_PY210
9b170efbab5efedaba8cf541e8fc42c5c8c0934d
76224d0fb871d0bf0b838f3fccf01022edd70f82
refs/heads/master
2021-06-16T20:14:29.754453
2021-02-25T23:03:19
2021-02-25T23:03:19
161,077,720
19
182
null
2021-02-25T23:03:19
2018-12-09T20:18:25
Python
UTF-8
Python
false
false
631
py
#cigar_party def cigar_party(cigars, is_weekend): if not is_weekend: return 40 <= cigars <= 60 else: return is_weekend and cigars > 40 assert cigar_party(30, False) == False assert cigar_party(50, False) == True assert cigar_party(70, True) == True print("Cigar party tests passed") #date_fashion def date_fashion(you, date): if you <= 2 or date <= 2: return 0 elif you >= 8 or date >= 8: return 2 else: return 1 assert date_fashion(5, 10) == 2 assert date_fashion(5, 2) == 0 assert date_fashion(5, 5) == 1 print("date fashion tests passed") #squirrel_play
[ "10297305+Eric74nyc@users.noreply.github.com" ]
10297305+Eric74nyc@users.noreply.github.com
c69aecc288d88a2e3af39ea33a0433e6bfda7f6a
86ba8693711e25f8cc5488ebb249bbed2f825383
/assault/stats.py
abbc729e7eacbee08263f77a8e539b0cf6217ccb
[]
no_license
lcwalina/assault
207f8b2f3e2530e38a6cb7414284262592d5d0d6
50b7c67a61256446ca4f6f060a8882cf13bf14be
refs/heads/main
2023-08-10T19:07:33.808941
2021-10-06T13:42:46
2021-10-06T13:42:46
413,843,292
0
0
null
null
null
null
UTF-8
Python
false
false
3,962
py
from typing import List, Dict from statistics import mean class Results: """ Results handles calculating statistics based on a list of requests that were made Here's an example of what the information will look like: Successful requests 3000 Slowest 0.010s Fastest 0.001s Average 0.003s Total time 2.400s Requests Per Minute 90000 Requests Per Second 1250 """ def __init__(self, total_time: float, requests: List[Dict]): self.total_time = total_time self.requests = sorted(requests, key=lambda x: x["request_time"]) def slowest(self) -> float: """ Returns the slowest request completion time >>> results = Results(10.6, [{ ... 'status_code': 200, ... 'request_time': 3.4 ... }, ... { ... 'status_code': 500, ... 'request_time': 6.1 ... }, ... { ... 'status_code': 200, ... 'request_time': 1.04 ... }]) >>> results.slowest() 6.1 """ return self.requests[-1]["request_time"] def fastest(self) -> float: """ Returns the fastest request completion time >>> results = Results(10.6, [{ ... 'status_code': 200, ... 'request_time': 3.4 ... }, ... { ... 'status_code': 500, ... 'request_time': 6.1 ... }, ... { ... 'status_code': 200, ... 'request_time': 1.04 ... }]) >>> results.fastest() 1.04 """ return self.requests[0]["request_time"] def average_time(self) -> float: """ Returns the average request completion time >>> results = Results(10.6, [{ ... 'status_code': 200, ... 'request_time': 3.4 ... }, ... { ... 'status_code': 500, ... 'request_time': 6.1 ... }, ... { ... 'status_code': 200, ... 'request_time': 1.04 ... }]) >>> results.average_time() 3.513333333333333 """ return mean([x["request_time"] for x in self.requests]) def successful_requests(self) -> int: """ Returns the number of successful requests >>> results = Results(10.6, [{ ... 'status_code': 200, ... 'request_time': 3.4 ... }, ... { ... 'status_code': 500, ... 'request_time': 6.1 ... }, ... { ... 'status_code': 200, ... 'request_time': 1.04 ... }]) >>> results.successful_requests() 2 """ return len([x for x in self.requests if x["status_code"] in range(200, 299)]) def requests_per_minute(self) -> int: """ Returns the number of requests that could be made in a minute >>> results = Results(2.5, [{ ... 'status_code': 200, ... 'request_time': 1.5 ... }, ... { ... 'status_code': 500, ... 'request_time': 0.4 ... }, ... { ... 'status_code': 200, ... 'request_time': 0.5 ... }]) >>> results.requests_per_minute() 72 """ return round(len(self.requests) / self.total_time * 60) def requests_per_second(self) -> int: """ Returns the number of requests that could be made in a second >>> results = Results(2.5, [{ ... 'status_code': 200, ... 'request_time': 1.5 ... }, ... { ... 'status_code': 500, ... 'request_time': 0.4 ... }, ... { ... 'status_code': 200, ... 'request_time': 0.5 ... }]) >>> results.requests_per_second() 1 """ return round(len(self.requests) / self.total_time)
[ "me@me.me" ]
me@me.me
144d3955135b79d4c7c8c739e6e9fb378ce90c42
7adc922990876440a10de51c2f210cdbc12fc5a6
/LogicaUna.py
33fed1b62cbd3bc9feb68afb4cae4d37094ed15a
[]
no_license
Asigeo/termostatoasigeo6z
db064c60bb91690116ee4d59f70289e2b128730b
d18f1e9afaf4ae7b670590729b6e41efd7bacca2
refs/heads/master
2023-09-01T13:14:22.552509
2021-10-29T08:49:47
2021-10-29T08:49:47
381,743,151
0
0
null
null
null
null
UTF-8
Python
false
false
15,388
py
import json from time import sleep from Relay_Module import Relees # funcionando = 0 parar # funcionando = 1 abriendo largo # funcionando = 2 abriendo corto # funcionando = 3 cerrando largo reles = Relees() def curva(x, b, m): y = b - m * x return y class LogicaZonaDirecta: def __init__(self,rele): self.t_amb = 20 self.consigna = 20 self.modo = 'invierno' self.rele = rele def logica(self,modo): funcionando = 0 if modo == 'invierno': if self.consigna > self.t_amb: funcionando = 1 reles.relayon(self.rele) else: reles.relayoff(self.rele) funcionando = 0 elif modo == 'verano': if self.consigna < self.t_amb: reles.relayon(self.rele) funcionando = 1 else: reles.relayoff(self.rele) funcionando = 0 else: reles.relayoff(self.rele) funcionando = 0 return funcionando class LogicaZona: TEMP_LARGA = 6 TEMP_CORTA = 2 def __init__(self, zona): # seguridades self.zona = zona self.sched = False self.temporizador = 0 self.modo_bomba = False # False = Continua True = Termostato self.grado_confort = 0 self.modo_curva = 0 # 0 modo normal #1 modo intenso # 2 reducido self.sonda_exterior = 0 self.sonda_ambiente = 0 self.sonda_agua = 0 self.sonda_suelo = 0 self.funcionando = 0 self.invierno = True self.verano = False self.antihielo = False self.consigna = 20 with open('/home/pi/ASIGEO/json_f/seguridades.json', 'r') as file: seguridades = json.load(file) # seguridades if zona == 1: self.inv_tmax_agua = seguridades["inv_tmax_agua1"] self.inv_tmax_suelo = seguridades["inv_tmax_suelo1"] self.inv_tmin_suelo = seguridades["inv_tmin_suelo1"] self.ver_tmin_agua = seguridades["ver_tmin_agua1"] self.ver_tmin_suelo = seguridades["ver_tmin_suelo1"] self.ant_tmax_agua = seguridades["ant_tmax_agua1"] self.ant_tmin_agua = seguridades["ant_tmin_agua1"] self.ant_tmin_suelo = seguridades["ant_tmin_suelo1"] elif zona == 2: self.inv_tmax_agua = seguridades["inv_tmax_agua2"] self.inv_tmax_suelo = seguridades["inv_tmax_suelo2"] self.inv_tmin_suelo = seguridades["inv_tmin_suelo2"] self.ver_tmin_agua = seguridades["ver_tmin_agua2"] self.ver_tmin_suelo = seguridades["ver_tmin_suelo2"] self.ant_tmax_agua = seguridades["ant_tmax_agua2"] self.ant_tmin_agua = seguridades["ant_tmin_agua2"] self.ant_tmin_suelo = seguridades["ant_tmin_suelo2"] self.ant_tmin_ext = seguridades["ant_tmin_ext"] self.ver_tmin_ext = seguridades["ver_tmin_ext"] def bool_mod(self, modoact): if modoact == "invierno": self.verano = False self.antihielo = False self.invierno = True elif modoact == "verano": self.antihielo = False self.invierno = False self.verano = True elif modoact == "antihielo": self.invierno = False self.verano = False self.antihielo = True def seguridad(self): reles.seguridad() def act_seguridades(self): with open('/home/pi/ASIGEO/json_f/seguridades.json', 'r') as file: seguridades = json.load(file) # seguridades if self.zona == 1: self.inv_tmax_agua = seguridades["inv_tmax_agua1"] self.inv_tmax_suelo = seguridades["inv_tmax_suelo1"] self.inv_tmin_suelo = seguridades["inv_tmin_suelo1"] self.ver_tmin_agua = seguridades["ver_tmin_agua1"] self.ver_tmin_suelo = seguridades["ver_tmin_suelo1"] self.ant_tmax_agua = seguridades["ant_tmax_agua1"] self.ant_tmin_agua = seguridades["ant_tmin_agua1"] self.ant_tmin_suelo = seguridades["ant_tmin_suelo1"] elif self.zona == 2: self.inv_tmax_agua = seguridades["inv_tmax_agua2"] self.inv_tmax_suelo = seguridades["inv_tmax_suelo2"] self.inv_tmin_suelo = seguridades["inv_tmin_suelo2"] self.ver_tmin_agua = seguridades["ver_tmin_agua2"] self.ver_tmin_suelo = seguridades["ver_tmin_suelo2"] self.ant_tmax_agua = seguridades["ant_tmax_agua2"] self.ant_tmin_agua = seguridades["ant_tmin_agua2"] self.ant_tmin_suelo = seguridades["ant_tmin_suelo2"] self.ant_tmin_ext = seguridades["ant_tmin_ext"] self.ver_tmin_ext = seguridades["ver_tmin_ext"] def logica(self, modo): print(self.sonda_exterior, self.sonda_ambiente, self.sonda_agua, self.sonda_suelo) self.bool_mod(modo) calor = self.invierno frio = self.verano antih = self.antihielo if calor and not frio and not antih: reles.relayon(8) # Encender ZONA BAÑO tmaxAgua = self.sonda_agua > self.inv_tmax_agua tminSuelo = self.sonda_suelo < self.inv_tmin_suelo tmaxSuelo = self.sonda_suelo > self.inv_tmax_suelo seguridadmax = (calor and tmaxAgua) or (calor and tmaxSuelo) termostato = self.sonda_ambiente < self.consigna - self.grado_confort print("Termostato",self.zona,termostato) if self.modo_curva == 0: m = 1 b = 40 # modo normal elif self.modo_curva == 1: m = 1.5 b = 50 # modo intenso elif self.modo_curva == 2: m = 0.8 b = 36 # modo reducido consigna = curva(self.sonda_exterior, b, m) diferencial = consigna - self.sonda_agua print("Curva= " + str(consigna)) print("Diferencial= " + str(diferencial)) pideLargo = diferencial > 6 pideCorto = 1 < diferencial <= 6 tempCorrecta = -1 <= diferencial <= 1 excesoCalor = diferencial < -1 # LOGICA DE APERTURAS B006 = termostato and not seguridadmax and pideLargo B012 = tminSuelo and not seguridadmax B007 = termostato and not seguridadmax and pideCorto B014 = B006 or B012 # activa Temporizacion larga B018 = B007 and not B014 # Activa temporizacion corta # LOGICA DE CIERRES B022 = not termostato and not tminSuelo B024 = excesoCalor and not tminSuelo B025 = B022 or B024 or seguridadmax # ACTIVA TEMPORIZACION LARGA # Logica de parada B019 = tempCorrecta and not tminSuelo and not B025 and not (B014 or B018) # Temperatura correcta if not self.modo_bomba or (self.modo_bomba and (B014 or B018)): reles.abrir_bomba(self.zona) else: reles.cerrar_bomba(self.zona) if B019: reles.parar_zona(self.zona) self.temporizador = 0 sleep(5) self.funcionando = 0 elif B014: reles.abrir_zona(self.zona) if self.funcionando == 2: # antes estaba abriendo corto self.temporizador = 0 # activo rele elif self.funcionando == 3: self.temporizador = 0 else: # funcionando = 1 o funcionando = 0 self.temporizador += 1 if self.temporizador == self.TEMP_LARGA: reles.parar_zona(self.zona) self.temporizador = 0 self.funcionando = 1 sleep(5) elif B018: # abrir corto reles.abrir_zona(self.zona) if self.funcionando == 1: # antes estaba abriendo largo self.temporizador = 0 # activo rele #print("Abriendo") sleep(5) elif self.funcionando == 3: self.temporizador = 0 sleep(5) else: # funcionando = 2 o 0 self.temporizador += 1 sleep(5) if self.temporizador == self.TEMP_CORTA: reles.parar_zona(self.zona) sleep(5) self.temporizador = 0 self.funcionando = 2 elif B025: # Cerrar largo reles.cerrar_zona(self.zona) if (self.funcionando == 1) or (self.funcionando == 2): #print("Paro abrir y empiezo a cerrar") # cierro CH1 y abro CH2 self.temporizador = 0 sleep(5) else: # Antes ya estaba cerrando o parado #print("cerrando") self.temporizador += 1 sleep(5) if self.temporizador == 6: reles.parar_zona(self.zona) # paro de cerrar print("Paro 5 seg") sleep(5) self.temporizador = 0 #print("Enciendo relee CH2") # Abro relee CH2 self.funcionando = 3 else: print('La has liao primo') elif frio and not calor and not antih: # modo verano reles.relayoff(8) tmin_ext = self.sonda_exterior < self.ver_tmin_ext tmin_agua = self.sonda_agua < self.ver_tmin_agua tmin_suelo = self.sonda_suelo < self.ver_tmin_suelo termostato = self.sonda_ambiente > self.consigna seg_verano = frio and (tmin_ext or tmin_agua or tmin_suelo) # LOGICA CIERRE cerrar = not termostato or seg_verano abrir = not seg_verano and termostato and not cerrar if not self.modo_bomba or (self.modo_bomba and abrir): reles.abrir_bomba(self.zona) else: reles.cerrar_bomba(self.zona) if cerrar: reles.cerrar_zona(self.zona) if (self.funcionando == 1) or (self.funcionando == 2): print("Paro abrir y empiezo a cerrar") # cierro CH1 y abro CH2 self.temporizador = 0 sleep(5) else: # Antes ya estaba cerrando #print("cerrando") self.temporizador += 1 if self.temporizador == 6: reles.parar_zona(self.zona) print("Paro 5 seg") sleep(5) self.temporizador = 0 #print("Enciendo relee CH2") # Abro relee CH2 else: sleep(5) self.funcionando = 3 elif abrir: reles.abrir_zona(self.zona) if self.funcionando == 1: # antes estaba abriendo largo print("Paro abriendo largo, abro corto") # cambio temporizador self.temporizador = 0 # activo rele #print("Abriendo") sleep(5) elif self.funcionando == 3: #print("Paro cerrar, abro corto") # cierro CH2, abro CH1 self.temporizador = 0 sleep(5) else: # funcionando = 2 #print("Sigo abriendo") self.temporizador += 1 if self.temporizador == self.TEMP_CORTA: reles.parar_zona(self.zona) #print("Paro relee") # cierro relee CH1 sleep(5) self.temporizador = 0 #print("Enciendo relee CH1") # Abro relee CH1 else: sleep(5) self.funcionando = 2 elif antih and not calor and not frio: reles.relayoff(8) tmax_agua = self.sonda_agua > self.ant_tmax_agua tmin_agua = self.sonda_agua < self.ant_tmin_agua tmin_suelo = self.sonda_suelo < self.ant_tmin_suelo tmin_ext = self.sonda_exterior < self.ant_tmin_ext abrir = tmin_agua or (tmin_ext and not tmin_agua) or (tmin_suelo and not tmax_agua) if not self.modo_bomba or (self.modo_bomba and abrir): reles.abrir_bomba(self.zona) else: reles.cerrar_bomba(self.zona) if abrir: reles.abrir_zona(1) if self.funcionando == 3: self.temporizador = 0 sleep(5) else: # antes ya estaba abriendo self.temporizador += 1 if self.temporizador == self.TEMP_CORTA: reles.parar_zona(self.zona) sleep(5) self.temporizador = 0 else: sleep(5) self.funcionando = 2 else: reles.cerrar_zona(self.zona) if self.funcionando == 2: self.temporizador = 0 sleep(5) else: # antes ya estaba cerrando self.temporizador += 1 if self.temporizador == self.TEMP_LARGA: reles.parar_zona(self.zona) sleep(5) self.temporizador = 0 else: sleep(5) self.funcionando = 3 return self.funcionando class ZonaDirecta: def __init__(self): self.modo = "invierno" self.invierno = True self.verano = False self.antihielo = False reles = Relees() self.consigna = 20 self.sonda_ambiente = 20 def bool_mod(self, modoact): if modoact == "invierno": self.verano = False self.antihielo = False self.invierno = True elif modoact == "verano": self.antihielo = False self.invierno = False self.verano = True elif modoact == "antihielo": self.invierno = False self.verano = False self.antihielo = True def logica(self, modo): print(self.sonda_exterior, self.sonda_ambiente, self.sonda_agua, self.sonda_suelo) self.bool_mod(modo) calor = self.invierno frio = self.verano antih = self.antihielo if calor: if self.consigna > self.sonda_ambiente: reles.abrir_bomba(3) else: reles.cerrar_bomba(3) elif frio: if self.consigna < self.sonda_ambiente: reles.abrir_bomba(3) else: reles.cerrar_bomba(3) sleep(5)
[ "jgonzalez@inartecnologias.es" ]
jgonzalez@inartecnologias.es
9a02a4515ac66a6af1c48bfd0115ffbef8f9ff1b
ada6419027215f0c73ff2916c16030bdb89cd213
/05_CodingNature/treeAngel 003.py
6201df5eab4c266bdb18dfdacc6e539bd098db25
[]
no_license
Pythones/Ejercicios
42eab02dbd3c425d13079fdc820ae13490c5d451
f96812845afd202548f2f03abd3acf8ff5356268
refs/heads/master
2016-09-05T18:01:05.151802
2014-11-25T12:56:50
2014-11-25T12:56:50
7,753,567
0
0
null
null
null
null
UTF-8
Python
false
false
815
py
#Testing new algorithms based on screensaver logic. import rhinoscriptsyntax as rs import math as m import random as r i = 0 def main(): #asking for data. dblLength = rs.GetReal("Initial growing length",1,0.01,10) dblAngle = m.radians(rs.GetReal("Random angle limit",10,0,90)) strPt = rs.GetPoint("Growing point") intLimit = rs.GetInteger("Iterations limit",20,1,1000) tree(strPt,dblLength, dblAngle, intLimit, i) def tree(Pto,dblStep,dblAngle,intLimit,x): if x>intLimit: return dblRand = r.uniform(-dblAngle,dblAngle) v3dRand = (m.cos(dblRand+(m.pi/2)),m.sin(dblRand+(m.pi/2)),0) PtM = rs.PointAdd(Pto,v3dRand) rs.AddLine(Pto,PtM) intBranch = r.randint(1,5) x+=1 for x in range(1,intBranch): tree(PtM,dblStep,dblAngle*1.1,intLimit*0.5,x+1) main()
[ "angellinaresgarcia@gmail.com" ]
angellinaresgarcia@gmail.com
53ff44496cb0984d03f5da6f7271f4c8652cc91d
14561adc9918f32b7f9334fa4dde08a3bfa17c26
/pipeline/Bacteria_denovo/Bacteria_denovo.pipeline.py
d4951738835c6a9781c9201f9ea8cd6c6fcab482
[]
no_license
ZhikunWu/awesome-metagenomic
b932169f505d39864a91067283ad7ce954280923
71183f262aa539a3983af4de47f7cc69be8cf7a6
refs/heads/master
2021-10-08T00:00:00.181593
2018-12-06T02:07:42
2018-12-06T02:07:42
111,966,593
2
0
null
null
null
null
UTF-8
Python
false
false
2,029
py
#!/usr/bin/env python import yaml import os import sys IN_PATH = config["IN_PATH"] PIPE_DIR = config["PIPE_DIR"] THREADS = config["THREADS"] ThreadFold = config["ThreadFold"] SAMPLES = config["SAMPLES"] PROJECTS = config["PROJECTS"] include: PIPE_DIR + "/Nano_QualityControl.rule.py" include: PIPE_DIR + "/GenePridiction.rule.py" rule all: input: expand(IN_PATH + "/clean/{sample}.fastq", sample=SAMPLES), expand(IN_PATH + "/qualityControl/raw/nanoQC/{sample}/nanoQC.html", sample=SAMPLES), expand(IN_PATH + "/qualityControl/raw/NanoPlot/{sample}/NanoPlot-report.html", sample=SAMPLES), expand(IN_PATH + '/annotation/{project}/Prokka/assembly.faa', project=PROJECTS), expand(IN_PATH + "/annotation/{project}/tRNAscan/assembly_tRNA_gene.fna", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/RepeatMasker/assembly.fasta.out", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/RepeatModeler/assembly_RepeatModeler.txt", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/LTRFinder/LTR.txt", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/TandemRepeatFinder/TandemRepeat.txt", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/LTRFinder/finder.scn", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/LTRretriever/assembly.fasta.mod.pass.list", project=PROJECTS), expand(IN_PATH + "/assembly/{project}/assembly.fasta.mod.out.LAI", project=PROJECTS), expand(IN_PATH + "/assembly/{project}/assembly_index.esq", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/LTRharvest/assembly_ltrharvest.gff3", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/LTRharvest/assembly_ltrdigest.gff3", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/RepeatScout/seq_freq.txt", project=PROJECTS), expand(IN_PATH + "/annotation/{project}/RepeatScout/seq_repeat.txt", project=PROJECTS),
[ "598466208@qq.com" ]
598466208@qq.com
38e53a8d35e8f0436f46b05a7eedf0fa39b63dea
1f96ecaf42f3e502f603f6beb990f97d83feb5ca
/y_2015/d_6/run_2.py
11a412b84359827a076b9fc6d60c7ed3bc49bcf1
[]
no_license
moroznoeytpo/adventofcode
5ddf62261c7c729aba2aa66f9c45884a3ab1ce0b
cd64655e8f90d44fe6684e622de1feec7d6af6aa
refs/heads/master
2020-11-28T08:55:21.940771
2020-11-12T19:13:53
2020-11-12T19:13:53
229,762,949
0
0
null
null
null
null
UTF-8
Python
false
false
554
py
import re with open('2015/6/input.txt', 'r') as input_file: l = 1000 grid = [[0 for j in range(l)] for i in range(l)] total = 0 for rule in input_file: match = re.search(r"([\w\s]*) (\d*),(\d*) through (\d*),(\d*)", rule) for i in range(int(match[2]), int(match[4]) + 1): for j in range(int(match[3]), int(match[5]) + 1): if match[1] == 'turn on': grid[i][j] += 1 total += 1 elif match[1] == 'turn off': if grid[i][j]: grid[i][j] -= 1 total -= 1 else: grid[i][j] += 2 total += 2 print(total)
[ "moroznoeytpo@gmail.com" ]
moroznoeytpo@gmail.com
0291973159aef28b73a1a59386890d16e8dcba96
afff833c39b47ce6c0fde5af4d831e068b49d0af
/CNN_lab_data.py
51b1410ebcf75e70fed9e18d8d8f69c5c7e3a6ad
[]
no_license
xzang/Deep-learning-for-sonar-images
21ed1c2f46f1edaadb9342976cb89c37432083b0
1a8d09f8ef68a7c683423f3d4f553da7076f50ce
refs/heads/master
2020-10-01T05:43:10.133989
2020-07-13T03:13:43
2020-07-13T03:13:43
227,470,507
7
0
null
null
null
null
UTF-8
Python
false
false
3,955
py
# -*- coding: utf-8 -*- """ Written by Tim Yin and Xiaoqin Zang Last editted by Xiaoqin Zang on Nov. 8, 2019 """ from __future__ import print_function import keras from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten from keras.layers import Conv2D, MaxPooling2D from keras import backend as K import imageio import glob import numpy as np from sklearn.model_selection import RepeatedKFold ######## read eel data eel_array = np.empty((0, 104, 104)) for im_path in glob.glob("C:/Users/****/Documents/sonar_camera/coding/eel/eel_diff_wave/*.png"): result = np.zeros((104, 104)) im = imageio.imread(im_path) result[22:(im.shape[0]+22),22:(im.shape[1]+22)] = im eel_array = np.append(eel_array, [result], axis=0) #eel_array.shape ######### downsample eel_array = eel_array[0::7] ########## read short stick data stick_array_short = np.empty((0, 104, 104)) for im_path in glob.glob("C:/Users/****/Documents/sonar_camera/coding/sti_diff_wave_short/*.png"): result = np.zeros((104, 104)) im = imageio.imread(im_path) result[22:(im.shape[0]+22),22:(im.shape[1]+22)] = im stick_array_short = np.append(stick_array_short, [result], axis=0) #stick_array_short.shape stick_array_short = stick_array_short[0::7] stick_array = stick_array_short eel_size = eel_array.shape[0] stick_size = stick_array.shape[0] all_array = np.concatenate((eel_array, stick_array), axis=0) y = np.repeat(np.array([1, 0], dtype=np.int64), [eel_size, stick_size], axis=0) ##### shuffle the dataset shuffle_ix_1 = list(range(len(all_array))) np.random.seed(567) np.random.shuffle(shuffle_ix_1) all_array = all_array[shuffle_ix_1] y = y[shuffle_ix_1] seed = 987 np.random.seed(seed) # ten-fold cross validation kfold = RepeatedKFold(n_splits=10, n_repeats=5, random_state=seed) cvscores = [] batch_size = 32 #64 if the dataset is bigger num_classes = 1 epochs = 5 # input image dimensions img_rows, img_cols = 104, 104 for train, test in kfold.split(all_array, y): x_train = all_array[train] y_train = y[train] x_test = all_array[test] y_test = y[test] if K.image_data_format() == 'channels_first': x_train = x_train.reshape(x_train.shape[0], 1, img_rows, img_cols) x_test = x_test.reshape(x_test.shape[0], 1, img_rows, img_cols) input_shape = (1, img_rows, img_cols) else: x_train = x_train.reshape(x_train.shape[0], img_rows, img_cols, 1) x_test = x_test.reshape(x_test.shape[0], img_rows, img_cols, 1) input_shape = (img_rows, img_cols, 1) x_train = x_train.astype('float32') x_test = x_test.astype('float32') x_train /= 255 x_test /= 255 model = Sequential() model.add(Conv2D(32, kernel_size=(5, 5), activation='relu', input_shape=input_shape, padding='valid')) model.add(Conv2D(64, (5, 5), activation='relu')) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Dropout(0.25)) model.add(Flatten()) model.add(Dense(128, activation='relu')) model.add(Dropout(0.5)) model.add(Dense(num_classes, activation='sigmoid')) model.compile(loss=keras.losses.binary_crossentropy, optimizer=keras.optimizers.Adam(lr=0.001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.0, amsgrad=False), metrics=['accuracy']) model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, verbose = 0, shuffle = 1, #validation_data=(x_test, y_test) ) scores = model.evaluate(x_test, y_test) print("%s: %.2f%%" % (model.metrics_names[1], scores[1]*100)) cvscores.append(scores[1] * 100) print("%.2f%% (+/- %.2f%%)" % (np.mean(cvscores), np.std(cvscores)))
[ "noreply@github.com" ]
xzang.noreply@github.com
7e5dbb102fab53228104ce9a43c6407ab1972c45
50989266203628be7649d152392f4a1789997b90
/lisp.py
9c96a7942a34631c24cce5c62058308aa3242b27
[]
no_license
cheery/snakelisp
b2820819959be4ed0b62a60c511b15623ae5589e
c62c0401e7d8cbd63afb8a7242850f7740420614
refs/heads/master
2020-05-15T08:53:26.443191
2014-09-16T15:55:43
2014-09-16T15:55:43
23,539,541
1
0
null
null
null
null
UTF-8
Python
false
false
6,257
py
#!/usr/bin/env python from pythonboot.blip import ListNode, TextNode, MarkNode, isList, isText, isMark, open_list import json import transpiler from cps import Call, Lambda, Assign, Variable, Constant, Environ, null, true, false import subprocess import sys import re # call = Call([arguments]), call[i] # lambda = Lambda([arguments], body), lambda[i] # Assign(var, val, body) # Variable(name, value) # Constant(value) def main(): path = sys.argv[1] mks = [] env = Environ() ret = env.new_argument("cont", False) env = env.new_environ() ret = env.new_argument('cont', False) exprs = open_list(path).strip_rec() #exprs = list(open_list("base.sl")) + list(open_list(path)) program = env.close(compile_list(exprs, env, ret)) program = program.coalesce() snakesource = "snakelisp.c" rootdecl = re.compile(r'newRoot\("(.+)",') with open(snakesource) as fd: src = fd.read() c_roots = dict((decl, "(root+{})".format(i)) for i, decl in enumerate(rootdecl.findall(src))) c_api = { "uncallable-hook": "&uncallable_hook", "type-error-hook": "&type_error_hook", } c_use = set() for var in env.seal(): if var.name in c_roots: var.c_handle = c_roots[var.name] continue var.c_handle = c_api[var.name] c_use.add(var.c_handle) cdefns = ["extern value_t {};".format(value[1:]) for value in c_use] #import visuals #visuals.create_graph("demo.png", program) source = transpiler.transpile(program, cdefns, path) open(path+'.c', 'w').write(source) subprocess.call(["gcc", path+'.c', snakesource, "-I.", "-lm"]) constants = {'null': null, 'true':true, 'false':false} def compile(expr, env, k): if isList(expr, 'include') and isText(expr[0]): return compile_list(open_list(expr[0].text).strip_rec(), env, k) if isList(expr, 'let') and isText(expr[0]): var = env.get_local(expr[0].text) return compile(expr[1], env, (lambda val: Assign(var, val, retrieve(k, val)))) if isList(expr, 'set') and isText(expr[0]): var = env.lookup(expr[0].text) return compile(expr[1], env, (lambda val: Assign(var, val, retrieve(k, val)))) if isList(expr, 'cond'): return compile_cond(expr, env, k) if isList(expr, 'while'): return compile_while(expr, env, k) if isList(expr, 'func'): env = env.new_environ() ret = env.new_argument('cont', False) for sym in expr[0]: assert sym.label == '' env.new_argument(sym.text) return retrieve(k, env.close(compile_list(expr[1:], env, ret))) if isList(expr, 'infix') and len(expr) == 3: return compile(ListNode([expr[1], expr[0], expr[2]]), env, k) if isList(expr, ''): params = [] seq = list(expr) def next_parameter(param): params.append(param) if len(seq) > 0: return compile(seq.pop(0), env, next_parameter) else: callee = params.pop(0) return Call([callee, lift(k)] + params) return compile(seq.pop(0), env, next_parameter) #if expr.group == 'integer': # return retrieve(k, Constant(expr.value)) #if expr.group == 'double': # return retrieve(k, Constant(expr.value)) if isText(expr, "string"): return retrieve(k, Constant(expr.text)) if isText(expr, ''): if expr.text[:1].isdigit(): return retrieve(k, Constant(int(expr.text))) if expr.text in constants: param = constants[expr.text] else: param = env.lookup(expr.text) return retrieve(k, param) raise Exception("what is {}?".format(expr)) def compile_list(exprs, env, k): seq = list(exprs) def next_parameter(param): if len(seq) > 1: return compile(seq.pop(0), env, next_parameter) else: return compile(seq.pop(0), env, k) if len(exprs) == 0: return retrieve(k, null) return next_parameter(null) def retrieve(k, param): if callable(k): return k(param) else: return Call([k, param]) def lift(k): if callable(k): x = Variable() return Lambda([x], k(x)) else: return k def compile_cond(expr, env, k): seq = list(expr[0:]) if len(seq) == 0: return retrieve(k, null) def next_cond(k): if len(seq) == 0: return retrieve(k, null) head = seq.pop(0) if len(seq) == 0 and isList(head, 'else'): return compile_list(head[0:], env, k) if isList(head, 'else'): raise Exception("invalid cond expression") return compile(head[0], env, (lambda truth: pick(env, k, truth, enclose(head[1:], env), lambdaCont(next_cond)))) return next_cond(k) def compile_while(expr, env, k): self = Variable() seq = expr[1:] def compile_body(k): return compile_list(expr[1:], env, (lambda _: Call([self, lift(k)]))) cont = Variable() looplambda = Lambda([cont], compile(expr[0], env, (lambda truth: pick(env, cont, truth, lambdaCont(compile_body), lambdaNull())))) return Assign(self, looplambda, Call([self, lift(k)]), True) def pick(env, k, truth, yes, no): return Call([env.new_implicit('pick'), lift(k), truth, yes, no]) def lambdaNull(): cont = Variable() return Lambda([cont], Call([cont, null])) def lambdaCont(func): cont = Variable() return Lambda([cont], func(cont)) def enclose(exprs, env): cont = Variable() return Lambda([cont], compile_list(exprs, env, cont)) #def open_list(path): # with open(path, 'r') as fd: # plop = json.load(fd) # return decodeJson(plop) # #def decodeJson(node): # if node["type"] == "list": # return ListNode([decodeJson(a) for a in node["list"]], node["label"] or '').strip() # elif node["type"] == 'text': # return TextNode(node["text"], node["label"] or '') # elif node["type"] == 'mark': # return MarkNode(node["label"] or '') # else: # raise Exception("unknown {}".format(node)) if __name__ == '__main__': main()
[ "cheery@boxbase.org" ]
cheery@boxbase.org
fd038588e1514db2ce8a3b98d9a04bf9c08b8692
9c3c83007c5bf0f36635b0045b2aad7f8a11ac11
/novice/04-05/graphql/venv/lib/python3.6/site-packages/graphql/utils/value_from_ast.py
7ad52bca43bf423c08c5f077dd51404ba8164137
[ "MIT" ]
permissive
septiannurtrir/praxis-academy
bc58f9484db36b36c202bf90fdfd359482b72770
1ef7f959c372ae991d74ccd373123142c2fbc542
refs/heads/master
2021-06-21T17:04:58.379408
2019-09-13T16:46:08
2019-09-13T16:46:08
203,007,994
1
0
MIT
2021-03-20T01:43:24
2019-08-18T13:38:23
Python
UTF-8
Python
false
false
2,920
py
from ..language import ast from ..type import ( GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, GraphQLScalarType, ) # Necessary for static type checking if False: # flake8: noqa from ..language.ast import Node from ..type.definition import GraphQLType from typing import Dict, Union, Optional, List def value_from_ast(value_ast, type, variables=None): # type: (Optional[Node], GraphQLType, Optional[Dict[str, Union[List, Dict, int, float, bool, str, None]]]) -> Union[List, Dict, int, float, bool, str, None] """Given a type and a value AST node known to match this type, build a runtime value.""" if isinstance(type, GraphQLNonNull): # Note: we're not checking that the result of coerceValueAST is non-null. # We're assuming that this query has been validated and the value used here is of the correct type. return value_from_ast(value_ast, type.of_type, variables) if value_ast is None: return None if isinstance(value_ast, ast.Variable): variable_name = value_ast.name.value if not variables or variable_name not in variables: return None # Note: we're not doing any checking that this variable is correct. We're assuming that this query # has been validated and the variable usage here is of the correct type. return variables.get(variable_name) if isinstance(type, GraphQLList): item_type = type.of_type if isinstance(value_ast, ast.ListValue): return [ value_from_ast(item_ast, item_type, variables) for item_ast in value_ast.values ] else: return [value_from_ast(value_ast, item_type, variables)] if isinstance(type, GraphQLInputObjectType): fields = type.fields if not isinstance(value_ast, ast.ObjectValue): return None field_asts = {} for field_ast in value_ast.fields: field_asts[field_ast.name.value] = field_ast obj = {} for field_name, field in fields.items(): if field_name not in field_asts: if field.default_value is not None: # We use out_name as the output name for the # dict if exists obj[field.out_name or field_name] = field.default_value continue field_ast = field_asts[field_name] field_value_ast = field_ast.value field_value = value_from_ast(field_value_ast, field.type, variables) # We use out_name as the output name for the # dict if exists obj[field.out_name or field_name] = field_value return type.create_container(obj) assert isinstance(type, (GraphQLScalarType, GraphQLEnumType)), "Must be input type" return type.parse_literal(value_ast)
[ "septiannurtrir@gmail.com" ]
septiannurtrir@gmail.com
4a9d5d358f8e395181b4755283707fc8c2222b93
e688f5939fb7ece6b5626f2e6aeeab34377841fe
/mysite/mysite/urls.py
425723419fd208e764cb54798e298410dd86ef02
[]
no_license
tarq138/my_project
643c02fdfaa5d2445dbe87ef7679379d5289f503
37917b03426a7f846eac1c382a74b89c793439bf
refs/heads/master
2022-12-11T20:43:52.719760
2018-06-09T21:57:10
2018-06-09T21:57:10
136,760,643
0
0
null
2022-11-22T02:19:24
2018-06-09T21:52:17
Python
UTF-8
Python
false
false
618
py
from django.contrib import admin from django.conf.urls import url, include from django.conf import settings from django.conf.urls.static import static admin.autodiscover() urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^accounts/', include('django.contrib.auth.urls')), url(r'^sip/', include('sip.urls')), url(r'^', include('mainApp.urls')), url(r'^', include('products.urls')), url(r'^$', include('orders.urls')), ] \ + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) \ + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
[ "tarq138@gmail.com" ]
tarq138@gmail.com
d4c44550df6570a3c03d89d628513a25c2868572
0ae589f33fbf37a6af830dd7494cc576f267f202
/scenario/settings.py
ea8db96a3b7c5d412a773b2d60a74cbfa2abfd55
[]
no_license
vamsi9477/sosioHosting
85be712762738604625a13569f85aa986c31d5b0
42dbe2171a32b4cf40d202f16d89c49db9b3c10e
refs/heads/master
2020-04-05T01:09:02.486917
2018-11-06T18:03:07
2018-11-06T18:03:07
156,425,173
0
0
null
null
null
null
UTF-8
Python
false
false
3,136
py
""" Django settings for scenario project. Generated by 'django-admin startproject' using Django 2.1.1. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '*l#4^7y1%o0r9p01f)lz7mcdw-nc9#2iet=ak3ma9rj53f+zyh' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'sc1.apps.Sc1Config', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'scenario.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')] , 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'scenario.wsgi.application' # Database # https://docs.djangoproject.com/en/2.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/2.1/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.1/howto/static-files/ STATIC_URL = '/static/'
[ "vamsikrishna6668@gmail.com" ]
vamsikrishna6668@gmail.com
b67811ab9cab13cf550d69e2c4dda72fc58a0535
d4deb8d62d95876488e4f2d555d1edce11cd7b8c
/fixture/group.py
0cdf31543c3ee7c58b8254f4e628bc0064a591a6
[ "Apache-2.0" ]
permissive
alen4ik/python_training
ce54b19b255358c692c63c84a7e7fe7b7edbf000
37faa663089ff610a85fb92b89b7b953d4ddc9e7
refs/heads/master
2016-09-07T18:50:40.983369
2015-08-29T19:37:27
2015-08-29T19:37:27
40,011,105
0
0
null
null
null
null
UTF-8
Python
false
false
2,048
py
__author__ = 'ASUS' class GroupHelper: def __init__(self, app): self.app = app def open_groups_page(self): wd = self.app.wd wd.find_element_by_link_text("groups").click() def create(self, group): self.open_groups_page() self.init_group_creation() self.fill_group_form(group) self.submit_group_creation() self.return_to_groups_page() def init_group_creation(self): wd = self.app.wd wd.find_element_by_name("new").click() def change_field_value(self, field_name, text): wd = self.app.wd if text is not None: wd.find_element_by_name(field_name).click() wd.find_element_by_name(field_name).clear() wd.find_element_by_name(field_name).send_keys(text) def fill_group_form(self, group): wd = self.app.wd self.change_field_value("group_name", group.name) self.change_field_value("group_header", group.header) self.change_field_value("group_footer", group.footer) def submit_group_creation(self): wd = self.app.wd wd.find_element_by_name("submit").click() def select_first_group(self): wd = self.app.wd wd.find_element_by_name("selected[]").click() def delete_first_group(self): wd = self.app.wd self.open_groups_page() self.select_first_group() #submit deletion wd.find_element_by_name("delete").click() self.return_to_groups_page() def modify_first_group(self, new_group_data): wd = self.app.wd self.open_groups_page() self.select_first_group() # open modification form wd.find_element_by_name("edit").click() # fill group form self.fill_group_form(new_group_data) # submit modification wd.find_element_by_name("update").click() self.return_to_groups_page() def return_to_groups_page(self): wd = self.app.wd wd.find_element_by_link_text("group page").click()
[ "alexa10@ya.ru" ]
alexa10@ya.ru
29a6b6297c5a13c3841db250af023df7df17c8d3
cad4fb2a3bcdcb42b0be85681f7455fa2b4e658d
/flow_transforms.py
de5a2570ea9c080e6d5f33c5c87faf52d2eb260d
[]
no_license
spillai/FlowNetPytorch
a994171217920293d0a9299dfb31fc5805c4f890
90a408e5df0fb2cb8d12adde8685964d94be93a9
refs/heads/master
2021-01-11T14:47:08.784506
2017-01-27T15:01:28
2017-01-27T15:01:28
80,218,622
1
0
null
2017-01-27T15:24:05
2017-01-27T15:24:05
null
UTF-8
Python
false
false
9,766
py
from __future__ import division import torch import math import random from PIL import Image, ImageOps import numpy as np import numbers import types import scipy.ndimage as ndimage '''Set of tranform random routines that takes both input and target as arguments, in order to have random but coherent transformations. inputs are PIL Image pairs and targets are ndarrays''' class Compose(object): """ Composes several co_transforms together. For example: >>> co_transforms.Compose([ >>> co_transforms.CenterCrop(10), >>> co_transforms.ToTensor(), >>> ]) """ def __init__(self, co_transforms): self.co_transforms = co_transforms def __call__(self, input, target): for t in self.co_transforms: input,target = t(input,target) return input,target class Lambda(object): """Applies a lambda as a transform""" def __init__(self, lambd): assert type(lambd) is types.LambdaType self.lambd = lambd def __call__(self, input,target): return self.lambd(input,target) class CenterCrop(object): """Crops the given PIL.Image at the center to have a region of the given size. size can be a tuple (target_height, target_width) or an integer, in which case the target will be of a square shape (size, size) """ def __init__(self, size): if isinstance(size, numbers.Number): self.size = (int(size), int(size)) else: self.size = size def __call__(self, inputs, target): w, h = inputs[0].size th, tw = self.size x1 = int(round((w - tw) / 2.)) y1 = int(round((h - th) / 2.)) inputs[0] = inputs[0].crop((x1, y1, x1 + tw, y1 + th)) inputs[1] = inputs[1].crop((x1, y1, x1 + tw, y1 + th)) target = target[y1 : y1 + th, x1 : x1 + tw] return inputs,target class Scale(object): """ Rescales the input PIL.Image to the given 'size'. 'size' will be the size of the smaller edge. For example, if height > width, then image will be rescaled to (size * height / width, size) size: size of the smaller edge interpolation: Default: PIL.Image.BILINEAR """ def __init__(self, size, interpolation=Image.BILINEAR): self.size = size self.interpolation = interpolation def __call__(self, inputs, target): w, h = inputs[0].size if (w <= h and w == self.size) or (h <= w and h == self.size): return inputs,target if w < h: ow = self.size oh = int(self.size * h / w) ratio = ow/w else: oh = self.size ow = int(self.size * w / h) ratio = oh/h inputs[0] = inputs[0].resize((ow, oh), self.interpolation) inputs[1] = inputs[1].resize((ow, oh), self.interpolation) target = ndimage.interpolation.zoom(target,ratio) target*=ow/w return inputs, target[:oh,:ow] class RandomCrop(object): """Crops the given PIL.Image at a random location to have a region of the given size. size can be a tuple (target_height, target_width) or an integer, in which case the target will be of a square shape (size, size) """ def __init__(self, size, padding=0): if isinstance(size, numbers.Number): self.size = (int(size), int(size)) else: self.size = size self.padding = padding def __call__(self, inputs,target): if self.padding > 0: inputs[0] = ImageOps.expand(inputs[0], border=self.padding, fill=0) inputs[1] = ImageOps.expand(inputs[1], border=self.padding, fill=0) w, h = inputs[0].size th, tw = self.size if w == tw and h == th: return inputs,target x1 = random.randint(0, w - tw) y1 = random.randint(0, h - th) inputs[0] = inputs[0].crop((x1, y1, x1 + tw, y1 + th)) inputs[1] = inputs[1].crop((x1, y1, x1 + tw, y1 + th)) return inputs,target[y1 : y1 + th,x1 : x1 + tw] class RandomHorizontalFlip(object): """Randomly horizontally flips the given PIL.Image with a probability of 0.5 """ def __call__(self, inputs, target): if random.random() < 0.5: input[0] = input[0].transpose(Image.FLIP_LEFT_RIGHT) input[1] = input[1].transpose(Image.FLIP_LEFT_RIGHT) target = target.fliplr() target[:,:,0]*=-1 return inputs,target class RandomVerticalFlip(object): """Randomly horizontally flips the given PIL.Image with a probability of 0.5 """ def __call__(self, inputs, target): if random.random() < 0.5: input[0] = input[0].transpose(Image.FLIP_UP_DOWN) input[1] = input[1].transpose(Image.FLIP_UP_DOWN) target = target.flipud() target[:,:,1]*=-1 return inputs,target class RandomRotate(object): """Random rotation of the image from -angle to angle (in degrees) This is useful for dataAugmentation, especially for geometric problems such as FlowEstimation angle: max angle of the rotation resample: Default: PIL.Image.BILINEAR expand: Default: false. If set to true, image size will be set to keep every pixel in the image. diff_angle: Default: 0. Must stay less than 10 degrees, or linear approximation of flowmap will be off. Careful when rotating more than 45 degrees, w and h will be inverted """ def __init__(self, angle, resample=Image.BILINEAR, expand=False, diff_angle=0): self.angle = angle self.resample = resample self.expand = expand self.diff_angle = diff_angle assert(angle+diff_angle < 45) def __call__(self, inputs,target): applied_angle = random.uniform(-self.angle,self.angle) diff = random.uniform(-self.diff_angle,self.diff_angle) angle1 = applied_angle + diff/2 angle2 = applied_angle - diff/2 w, h = inputs[0].size def rotate_flow(i,j,k): if k==0: return (i-w/2)*(diff*math.pi/180) else: return (j-h/2)*(-diff*math.pi/180) rotate_flow_map = np.fromfunction(rotate_flow, target.shape) target += rotate_flow_map inputs[0] = inputs[0].rotate(angle1,resample=self.resample, expand=self.expand) inputs[1] = inputs[1].rotate(angle2,resample=self.resample, expand=self.expand) target = ndimage.interpolation.rotate(target,reshape=False) return inputs,target class RandomCropRotate(object): """Random rotation of the image from -angle to angle (in degrees) A crop is done to keep same image ratio, and no black pixels angle: max angle of the rotation cannot be more than 180 degrees resample: Default: PIL.Image.BILINEAR """ def __init__(self, angle, size, diff_angle=0, resample=Image.BILINEAR): self.angle = angle self.resample = resample self.expand = True self.diff_angle = diff_angle self.size = size def __call__(self, inputs,target): applied_angle = random.uniform(-self.angle,self.angle) diff = random.uniform(-self.diff_angle,self.diff_angle) angle1 = applied_angle + diff/2 angle2 = applied_angle - diff/2 angle1_rad = angle1*np.pi/180 angle2_rad = angle2*np.pi/180 w, h = inputs[0].size def rotate_flow(i,j,k): return k*(i-w/2)*(diff*np.pi/180) + (k-1)*(j-h/2)*(-diff*np.pi/180) rotate_flow_map = np.fromfunction(rotate_flow, target.shape) target += rotate_flow_map inputs[0] = inputs[0].rotate(angle1,resample=self.resample, expand=True) inputs[1] = inputs[1].rotate(angle2,resample=self.resample, expand=True) target = ndimage.interpolation.rotate(target,angle1,reshape=True) #flow vectors must be rotated too! target_=np.array(target, copy=True) target[:,:,0] = np.cos(angle1_rad)*target_[:,:,0] - np.sin(angle1_rad)*target[:,:,1] target[:,:,0] = np.sin(angle1_rad)*target_[:,:,0] + np.cos(angle1_rad)*target[:,:,1] #keep angle1 and angle2 within [0,pi/2] with a reflection at pi/2: -1rad is 1rad, 2rad is pi - 2 rad angle1_rad = np.pi/2 - np.abs(angle1_rad%np.pi - np.pi/2) angle2_rad = np.pi/2 - np.abs(angle2_rad%np.pi - np.pi/2) c1 = np.cos(angle1_rad) s1 = np.sin(angle1_rad) c2 = np.cos(angle2_rad) s2 = np.sin(angle2_rad) c_diag = h/np.sqrt(h*h+w*w) s_diag = w/np.sqrt(h*h+w*w) ratio = c_diag/max(c1*c_diag+s1*s_diag,c2*c_diag+s2*s_diag) crop = CenterCrop((int(h*ratio),int(w*ratio))) scale = Scale(self.size) inputs, target = crop(inputs, target) return scale(inputs,target) class RandomTranslate(object): def __init__(self, translation): if isinstance(translation, numbers.Number): self.translation = (int(translation), int(translation)) else: self.translation = translation def __call__(self, inputs,target): w,h = inputs[0].size th, tw = self.translation tw = random.randint(-tw, tw) th = random.randint(-th, th) if tw==0 and th==0: return inputs, target #compute x1,x2,y1,y2 for img1 and target, and x3,x4,y3,y4 for img2 x1,x2,x3,x4 = max(0,-tw), min(w-tw,w), max(0,tw), min(w+tw,w) y1,y2,y3,y4 = max(0,-th), min(h-th,h), max(0,th), min(h+th,h) inputs[0] = inputs[0].crop((x1, y1, x2, y2)) inputs[1] = inputs[1].crop((x3, y3, x4, y4)) target= target[y1:y2,x1:x2] target[:,:,0]+= tw target[:,:,1]+= th return inputs, target
[ "clement.pinard@parrot.com" ]
clement.pinard@parrot.com
992f8823515ccee3a140f890755137552e8928d4
438ee853669a67cd46537f6d02cf356d05e03681
/doctor_dashboard/urls.py
47694bb78b753fc56cdb14fe68d5c7380a309fe8
[]
no_license
tngeene/doc_appointment
a6648bed5c3d1d27e25131945910c5c425468fa1
6d1f320db03ad9fcc42b09e19a0d0a73e5af233a
refs/heads/master
2023-02-22T05:37:36.510685
2021-01-19T11:46:01
2021-01-19T11:46:01
324,834,090
0
1
null
null
null
null
UTF-8
Python
false
false
424
py
from django.urls import path, include app_name = "doctor_dashboard" urlpatterns = [ path('', include('doctor_dashboard.routes.index')), path('appointments/', include('doctor_dashboard.routes.appointments')), # path('doctors/', include('doctor_dashboard.routes.doctors')), # path('patients/', include('doctor_dashboard.routes.patients')), path('events/', include('doctor_dashboard.routes.events')), ]
[ "tngeene27@gmail.com" ]
tngeene27@gmail.com
d29ecd2dab536aba7307bb95697055dbc30cf2aa
711756b796d68035dc6a39060515200d1d37a274
/output_cog_tags/initial_3377.py
561d811f19c812512cfb3db4c9e030dcd1210575
[]
no_license
batxes/exocyst_scripts
8b109c279c93dd68c1d55ed64ad3cca93e3c95ca
a6c487d5053b9b67db22c59865e4ef2417e53030
refs/heads/master
2020-06-16T20:16:24.840725
2016-11-30T16:23:16
2016-11-30T16:23:16
75,075,164
0
0
null
null
null
null
UTF-8
Python
false
false
4,331
py
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_sets={} surf_sets={} if "Cog1_Anch" not in marker_sets: s=new_marker_set('Cog1_Anch') marker_sets["Cog1_Anch"]=s s= marker_sets["Cog1_Anch"] mark=s.place_marker((262, 533, 768), (0, 0, 1), 21.9005) if "Cog2_GFPN" not in marker_sets: s=new_marker_set('Cog2_GFPN') marker_sets["Cog2_GFPN"]=s s= marker_sets["Cog2_GFPN"] mark=s.place_marker((911, 601, 823), (1, 0.5, 0), 21.9005) if "Cog2_GFPC" not in marker_sets: s=new_marker_set('Cog2_GFPC') marker_sets["Cog2_GFPC"]=s s= marker_sets["Cog2_GFPC"] mark=s.place_marker((932, 878, 424), (1, 0.5, 0), 21.9005) if "Cog2_Anch" not in marker_sets: s=new_marker_set('Cog2_Anch') marker_sets["Cog2_Anch"]=s s= marker_sets["Cog2_Anch"] mark=s.place_marker((897, 147, 198), (1, 0.5, 0), 21.9005) if "Cog3_GFPN" not in marker_sets: s=new_marker_set('Cog3_GFPN') marker_sets["Cog3_GFPN"]=s s= marker_sets["Cog3_GFPN"] mark=s.place_marker((654, 184, 344), (1, 0.87, 0), 21.9005) if "Cog3_GFPC" not in marker_sets: s=new_marker_set('Cog3_GFPC') marker_sets["Cog3_GFPC"]=s s= marker_sets["Cog3_GFPC"] mark=s.place_marker((563, 71, 808), (1, 0.87, 0), 21.9005) if "Cog3_Anch" not in marker_sets: s=new_marker_set('Cog3_Anch') marker_sets["Cog3_Anch"]=s s= marker_sets["Cog3_Anch"] mark=s.place_marker((515, 319, 492), (1, 0.87, 0), 21.9005) if "Cog4_GFPN" not in marker_sets: s=new_marker_set('Cog4_GFPN') marker_sets["Cog4_GFPN"]=s s= marker_sets["Cog4_GFPN"] mark=s.place_marker((194, 440, 798), (0.97, 0.51, 0.75), 21.9005) if "Cog4_GFPC" not in marker_sets: s=new_marker_set('Cog4_GFPC') marker_sets["Cog4_GFPC"]=s s= marker_sets["Cog4_GFPC"] mark=s.place_marker((535, 777, 166), (0.97, 0.51, 0.75), 21.9005) if "Cog4_Anch" not in marker_sets: s=new_marker_set('Cog4_Anch') marker_sets["Cog4_Anch"]=s s= marker_sets["Cog4_Anch"] mark=s.place_marker((143, 239, 358), (0.97, 0.51, 0.75), 21.9005) if "Cog5_GFPN" not in marker_sets: s=new_marker_set('Cog5_GFPN') marker_sets["Cog5_GFPN"]=s s= marker_sets["Cog5_GFPN"] mark=s.place_marker((320, 498, 370), (0.39, 0.31, 0.14), 21.9005) if "Cog5_GFPC" not in marker_sets: s=new_marker_set('Cog5_GFPC') marker_sets["Cog5_GFPC"]=s s= marker_sets["Cog5_GFPC"] mark=s.place_marker((288, 147, 63), (0.39, 0.31, 0.14), 21.9005) if "Cog5_Anch" not in marker_sets: s=new_marker_set('Cog5_Anch') marker_sets["Cog5_Anch"]=s s= marker_sets["Cog5_Anch"] mark=s.place_marker((949, 360, 485), (0.39, 0.31, 0.14), 21.9005) if "Cog6_GFPN" not in marker_sets: s=new_marker_set('Cog6_GFPN') marker_sets["Cog6_GFPN"]=s s= marker_sets["Cog6_GFPN"] mark=s.place_marker((436, 819, 284), (0.6, 0.31, 0.64), 21.9005) if "Cog6_GFPC" not in marker_sets: s=new_marker_set('Cog6_GFPC') marker_sets["Cog6_GFPC"]=s s= marker_sets["Cog6_GFPC"] mark=s.place_marker((44, 825, 43), (0.6, 0.31, 0.64), 21.9005) if "Cog6_Anch" not in marker_sets: s=new_marker_set('Cog6_Anch') marker_sets["Cog6_Anch"]=s s= marker_sets["Cog6_Anch"] mark=s.place_marker((11, 479, 395), (0.6, 0.31, 0.64), 21.9005) if "Cog7_GFPN" not in marker_sets: s=new_marker_set('Cog7_GFPN') marker_sets["Cog7_GFPN"]=s s= marker_sets["Cog7_GFPN"] mark=s.place_marker((991, 520, 392), (0.89, 0.1, 0.1), 21.9005) if "Cog7_GFPC" not in marker_sets: s=new_marker_set('Cog7_GFPC') marker_sets["Cog7_GFPC"]=s s= marker_sets["Cog7_GFPC"] mark=s.place_marker((788, 680, 50), (0.89, 0.1, 0.1), 21.9005) if "Cog7_Anch" not in marker_sets: s=new_marker_set('Cog7_Anch') marker_sets["Cog7_Anch"]=s s= marker_sets["Cog7_Anch"] mark=s.place_marker((475, 141, 883), (0.89, 0.1, 0.1), 21.9005) if "Cog8_GFPC" not in marker_sets: s=new_marker_set('Cog8_GFPC') marker_sets["Cog8_GFPC"]=s s= marker_sets["Cog8_GFPC"] mark=s.place_marker((184, 381, 961), (0.3, 0.69, 0.29), 21.9005) if "Cog8_Anch" not in marker_sets: s=new_marker_set('Cog8_Anch') marker_sets["Cog8_Anch"]=s s= marker_sets["Cog8_Anch"] mark=s.place_marker((694, 467, 322), (0.3, 0.69, 0.29), 21.9005) for k in surf_sets.keys(): chimera.openModels.add([surf_sets[k]])
[ "batxes@gmail.com" ]
batxes@gmail.com
fa959aa6f4a922c56b0970dcb74658e61c42d1f2
4ef98e50c40dc9f79ac9e422a208427f034f804d
/maps/models.py
1e2a9a1d04f3ff48376a6325fbc92a1d1d52468a
[]
no_license
couleurmate/DeweyMaps
5bd4eef11d429a7f252b8fb3141a7a47697154b4
063e9e7e412d57d2fdaf976728aaff66eb5fd38a
refs/heads/master
2021-01-17T04:51:22.226762
2015-07-05T10:38:57
2015-07-05T10:38:57
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,404
py
from django.contrib.gis.db import models from closet.models import Subcategory class Marker(models.Model): name = models.CharField(blank=False, max_length=255) position = models.PointField(geography=True, blank=False) comment = models.TextField(blank=True, null=False, default="") subcategories = models.ManyToManyField(Subcategory) web = models.URLField(default="") phone = models.CharField(max_length=15, default="") adress = models.CharField(max_length=1000, default="") public = models.BooleanField(default=True) created = models.DateTimeField(auto_now_add=True) objects = models.GeoManager() def __str__(self): return self.name @property def content(self): return self.comment @property def lat(self): return self.position.y @property def lon(self): return self.position.x @property def popup(self): tpl = """<h5>{0.name}</h5>""" if self.adress != "": tpl += "<em>Adresse</em> : {0.adress}<br><br>" if self.phone != "": tpl += "<em>Téléphone</em> : {0.phone}<br><br>" if self.web != "": tpl += '<b><a target="_blank" href="{0.web}">Site web</a></b><br><br>' tpl += "{0.comment}<br><br>" tpl += '<a href="http://dewey.be/contact.html">Signaler un problème</a>' return tpl.format(self)
[ "nikita.marchant@gmail.com" ]
nikita.marchant@gmail.com
1093b9c3c57519cf4dc597bf6df497b6e31fe0fe
e15f86312db3109bbda053063557693518af4ead
/pcsk9/select_fam.py
35318362eec5e7e8604254ceeeedd5879854dcdc
[]
no_license
heichiyidui/dev
3aecf0f92e4af4184b4eae2b1935f281b7746c86
73c20c19928eb94d9aec10f0d307604b147b8088
refs/heads/master
2020-12-29T01:54:24.236229
2016-07-01T14:51:01
2016-07-01T14:51:01
35,271,765
1
0
null
null
null
null
UTF-8
Python
false
false
1,000
py
#!/usr/bin/env python3 # tail -n +2 plink.genome | awk '{print $2,$4}' > t.in edges = [] ifile =open('t.in') for line in ifile: cols = line[:-1].split() edges.append([cols[0],cols[1]]) ifile.close() import collections node_dgres = collections.Counter() nodes_1 = [x[0] for x in edges] nodes_2 = [x[1] for x in edges] node_dgres.update(nodes_1) node_dgres.update(nodes_2) # lets remove nodes according to their connection degrees to_remove_list = [] for l in range(10000): if edges == []: break # find the most connected node to_remove_id = node_dgres.most_common(1)[0][0] to_remove_list.append(to_remove_id) # update edge set new_edges = [x for x in edges if to_remove_id not in x] edges = new_edges # update node connection degree node_dgres = collections.Counter() nodes_1 = [x[0] for x in edges] nodes_2 = [x[1] for x in edges] node_dgres.update(nodes_1) node_dgres.update(nodes_2) for id in to_remove_list: print(id)
[ "kuanggong@gmail.com" ]
kuanggong@gmail.com
c433f2523757ab9ccef83f3d10b3e3ecb22c1afd
e88a5dd494f82911c12601f7d474c5ac8c068bbc
/train-resnet.py
39b61e1015f7ce84fadfb2b5f7064e3c8cc1df3a
[]
no_license
Nortrom1213/Chinese-Character-Recognition-Demo
aeecba14b4bf6a7dada3cab70490d75cdc7f2bf7
eb80287027de597068cba306bec2f2a2b5683b90
refs/heads/master
2022-10-26T04:18:00.628845
2020-06-12T16:19:35
2020-06-12T16:19:35
271,825,358
1
0
null
null
null
null
UTF-8
Python
false
false
4,275
py
from tensorflow.python.keras import backend as K from tensorflow.python.keras.models import Model from tensorflow.python.keras.layers import Flatten, Dense, Dropout from tensorflow.python.keras.applications.resnet50 import ResNet50 from tensorflow.python.keras.applications.vgg19 import VGG19 from tensorflow.python.keras.applications.inception_v3 import InceptionV3 from tensorflow.python.keras.optimizers import Adam from tensorflow.python.keras.preprocessing.image import ImageDataGenerator import matplotlib.pyplot as plt # 資料路徑 DATASET_PATH = 'train_dataset' DATATEST_PATH = 'test_dataset' # 影像大小 IMAGE_SIZE = (224, 224) # 影像類別數 NUM_CLASSES = 20 # 若 GPU 記憶體不足,可調降 batch size 或凍結更多層網路 BATCH_SIZE = 8 # 凍結網路層數 FREEZE_LAYERS = 2 # Epoch 數 NUM_EPOCHS = 20 # 模型輸出儲存的檔案 WEIGHTS_FINAL = 'model-ResNet50-final.h5' # 透過 data augmentation 產生訓練與驗證用的影像資料 train_datagen = ImageDataGenerator(rotation_range=40, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, zoom_range=0.2, channel_shift_range=10, horizontal_flip=True, fill_mode='nearest') train_batches = train_datagen.flow_from_directory(DATASET_PATH, target_size=IMAGE_SIZE, interpolation='bicubic', class_mode='categorical', shuffle=True, batch_size=BATCH_SIZE) valid_datagen = ImageDataGenerator() valid_batches = valid_datagen.flow_from_directory(DATATEST_PATH, target_size=IMAGE_SIZE, interpolation='bicubic', class_mode='categorical', shuffle=False, batch_size=BATCH_SIZE) # 輸出各類別的索引值 for cls, idx in train_batches.class_indices.items(): print('Class #{} = {}'.format(idx, cls)) # 以訓練好的 ResNet50 為基礎來建立模型, # 捨棄 ResNet50 頂層的 fully connected layers net = ResNet50(include_top=False, weights='imagenet', input_tensor=None, input_shape=(IMAGE_SIZE[0], IMAGE_SIZE[1], 3)) x = net.output x = Flatten()(x) # 增加 DropOut layer x = Dropout(0.5)(x) # 增加 Dense layer,以 softmax 產生個類別的機率值 output_layer = Dense(NUM_CLASSES, activation='softmax', name='softmax')(x) # 設定凍結與要進行訓練的網路層 net_final = Model(inputs=net.input, outputs=output_layer) for layer in net_final.layers[:FREEZE_LAYERS]: layer.trainable = False for layer in net_final.layers[FREEZE_LAYERS:]: layer.trainable = True # 使用 Adam optimizer,以較低的 learning rate 進行 fine-tuning net_final.compile(optimizer=Adam(lr=1e-5), loss='categorical_crossentropy', metrics=['accuracy']) # 輸出整個網路結構 print(net_final.summary()) # 訓練模型 hist = net_final.fit_generator(train_batches, steps_per_epoch=train_batches.samples // BATCH_SIZE, validation_data=valid_batches, validation_steps=valid_batches.samples // BATCH_SIZE, epochs=NUM_EPOCHS) # 画图 def plot_training(history): acc = history.history['acc'] val_acc = history.history['val_acc'] loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(len(acc)) plt.plot(epochs, acc, 'b-') plt.plot(epochs, val_acc, 'r') plt.title('Training and validation accuracy') plt.figure() plt.plot(epochs, loss, 'b-') plt.plot(epochs, val_loss, 'r-') plt.title('Training and validation loss') plt.show() plot_training(hist) # 儲存訓練好的模型 net_final.save(WEIGHTS_FINAL)
[ "nortrom@berkeley.edu" ]
nortrom@berkeley.edu
bd0868604e0235e290ac2c3da89d7d5fd1be98ee
7b4b8a7fc438603425ba09a8988b27626951c4a3
/scripts-general/bin/bg-cycle.py
dcba9d75a3dd8d29142a0e19016e2fc42ee48d91
[ "MIT" ]
permissive
raehik/dotfiles
a728ea46f2219887595d9dec1a6445bcd7761fdd
0e3b695038f4e1e41ad53a3f7e9bad746a340dce
refs/heads/master
2023-04-29T15:55:24.942379
2023-04-20T16:58:47
2023-04-20T16:58:52
21,466,079
3
0
null
null
null
null
UTF-8
Python
false
false
7,875
py
#!/usr/bin/env python3 # # Create backgrounds for applications. # import sys, os, argparse, logging, subprocess from pathlib import Path import random, glob ## Boilerplate utils class {{{ class BoilerplateClass: def _deinit(self): self.logger.debug("deinitialising...") def _init_logging(self): self.logger = logging.getLogger(os.path.basename(sys.argv[0])) lh = logging.StreamHandler() lh.setFormatter(logging.Formatter("%(name)s: %(levelname)s: %(message)s")) self.logger.addHandler(lh) def _parse_verbosity(self): if self.args.verbose == 1: self.logger.setLevel(logging.INFO) elif self.args.verbose >= 2: self.logger.setLevel(logging.DEBUG) if self.args.quiet >= 1: # reset verbosity (to make verbose/quiet checks easier) self.args.verbose = 0 self.logger.setLevel(logging.NOTSET) def run(self): """Run from CLI: parse arguments, run main, deinitialise.""" self._init_logging() self._parse_args() self.main() self._deinit() def fail(self, msg="internal error", ret=1): """Exit with a message and a return code. Should only be used for errors -- if you want to deinitialise and exit safely, simply return from main. Suggested to use no parameters for internal functions that the user doesn't need to know about (which generally indicates a logic error, rather than an input one.) """ self.logger.error(msg) self._deinit() sys.exit(ret) def get_shell(self, cmd, cwd=None): """Run a shell command, blocking execution, detaching stdin, stdout and stderr. Useful for grabbing shell command outputs, or if you want to run something silently and wait for it to finish. @param cmd command to run as an array, where each element is an argument @param cwd if present, directory to use as CWD @return the command's return code, stdout and stderr (respectively, as a tuple) """ proc = subprocess.run(cmd, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd) return proc.returncode, \ proc.stdout.decode("utf-8", "replace").strip(), \ proc.stderr.decode("utf-8", "replace").strip() def get_shell_with_input(self, cmd, stdin_in, cwd=None): """Run a shell command with a given string passed to stdin, blocking execution and detaching stdout and stderr. We put a newline on the end of stdin_in, because that appears to be important for some programs (e.g. bc). TODO though, unsure. Maybe should be an option. @param cmd command to run as an array, where each element is an argument @param std_in string to pass to stdin @param cwd if present, directory to use as CWD @return the command's return code, stdout and stderr (respectively, as a tuple) """ proc = subprocess.run(cmd, input=bytes("{}\n".format(stdin_in), "utf-8"), stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd) return proc.returncode, \ proc.stdout.decode("utf-8", "replace").strip(), \ proc.stderr.decode("utf-8", "replace").strip() def drop_to_shell(self, cmd, cwd=None): """Run a shell command, blocking execution. Doesn't touch any pipes. Like dropping to shell during execution. @param cmd command to run as an array, where each element is an argument @param cwd if present, directory to use as CWD @return the command's exit code """ return subprocess.run(cmd, cwd=cwd).returncode ## Boilerplate utils class }}} class BGCycler(BoilerplateClass): DEF_IMG_DIR = Path(os.environ.get("HOME"), "proj", "media", "backgrounds") DEF_OUT_DIR = Path(os.environ.get("XDG_DATA_HOME"), "backgrounds") DEF_WIDTH = "1920" DEF_HEIGHT = "1080" DEF_BRIGHTNESS = "-81" DEF_CONTRAST = "-91" ERR_IMG_CONVERSION_FAILED = 2 ERR_IMG_FILE_ERROR = 3 DEF_BG_NAME = "desktop" ## CLI-related {{{ def _parse_args(self): self.parser = argparse.ArgumentParser( description="Create backgrounds for applications.", epilog="I use a rule of contrast = brightness-10 for a nice image.") self.parser.add_argument("-v", "--verbose", help="be verbose", action="count", default=0) self.parser.add_argument("-q", "--quiet", help="be quiet (overrides -v)", action="count", default=0) self.parser.add_argument("-d", "--img-dir", help="directory to read for images") self.parser.add_argument("-o", "--out-dir", help="directory to place backgrounds in") self.parser.add_argument("-n", "--bg-name", help="background name (= filename in background directory)", default=BGCycler.DEF_BG_NAME) self.parser.add_argument("-w", "--width", help="width to resize images to (when required)", default=BGCycler.DEF_WIDTH) self.parser.add_argument("-u", "--height", help="height to resize images to (when required)", default=BGCycler.DEF_HEIGHT) self.parser.add_argument("-b", "--brightness", help="converted image brightness", default=BGCycler.DEF_BRIGHTNESS) self.parser.add_argument("-c", "--contrast", help="converted image contrast", default=BGCycler.DEF_CONTRAST) self.parser.add_argument("images", nargs="*", help="images to use (instead of picking randomly)") self.args = self.parser.parse_args() self.args.verbose += 1 # force some verbosity self._parse_verbosity() if self.args.img_dir is not None: self.img_dir = Path(self.args.img_dir) else: self.img_dir = BGCycler.DEF_IMG_DIR if self.args.out_dir is not None: self.out_dir = Path(self.args.out_dir) else: self.out_dir = BGCycler.DEF_OUT_DIR ## }}} def create_background(self, bg_name, image, brightness, contrast, width, height): self.logger.info("{} -> {}".format(bg_name, image)) background_path = Path(self.out_dir, bg_name+".png") cmd_convert_img = ["convert", str(image), "-brightness-contrast", "{}x{}".format(brightness, contrast)] if width == "0" or height == "0": pass else: cmd_convert_img += [ "-gravity", "center", "-crop", "{}x{}+0+0".format(width, height)] cmd_convert_img.append(str(background_path)) self.logger.debug("cmd: {}".format(" ".join(cmd_convert_img))) ret = self.drop_to_shell(cmd_convert_img) if ret != 0: self.fail("failed converting for background {}, image: {}".format(bg_name, image), BGCycler.ERR_IMG_CONVERSION_FAILED) def main(self): """Main entrypoint after program setup.""" imgs = [x for x in self.img_dir.glob("**/*") if x.is_file()] random.shuffle(imgs) for img in self.args.images: imgs.append(img) if len(imgs) == 0: self.fail("no images available", BGCycler.ERR_IMG_FILE_ERROR) self.create_background(self.args.bg_name, imgs.pop(), self.args.brightness, self.args.contrast, self.args.width, self.args.height) if __name__ == "__main__": program = BGCycler() program.run()
[ "thefirstmuffinman@gmail.com" ]
thefirstmuffinman@gmail.com
937277b439813ae6dc3be0fe527ec358ddf48bc8
ae366ff5e8f8d01b4c36c43baa9159d8aa71efee
/96.py
6f4d7fe3c67e079353ea154fd4686282ab02871a
[]
no_license
lampard1010/python_foundation
3b464f05ff9ebbbf86e140929ebf0c54aba1dfd4
6bc8773af9b10e64e35e2d5255835b18722fef50
refs/heads/master
2021-01-02T04:43:35.260597
2020-04-20T01:35:55
2020-04-20T01:35:55
239,493,804
0
0
null
null
null
null
UTF-8
Python
false
false
82
py
str = "lkdasjfepojckjdfnkfdjalkdjfeikjf.dfad.falsfl" c = "l" print(str.count(c))
[ "261893396@qq.com" ]
261893396@qq.com
891003afd300b40669b199a1656cb107cd5cee6c
94be38d1f532a2d79e8559780fed11f9d7f3c374
/bin/wheel
678f987df6f3a74016b24a0f050ec9638d865afd
[]
no_license
aibolTungatarov/Algorithms
f81b134e3a9cf17f17f3b173f4af92de9c26b725
411b5c33aace65aba586933e5fd1b91ea467a1f4
refs/heads/master
2020-04-01T13:45:35.762752
2018-10-18T07:44:54
2018-10-18T07:44:54
153,266,145
2
0
null
null
null
null
UTF-8
Python
false
false
245
#!/Users/macpro/Desktop/Alghoritms/venv/bin/python # -*- coding: utf-8 -*- import re import sys from wheel.tool import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(main())
[ "aibolseed@gmail.com" ]
aibolseed@gmail.com
0cbcbbcdedfab5d7e39c18b76eb226601632f8cb
770710253983911ea0ed00cb3111f2d3fbadd200
/Functions/TextTranslate.py
33a9411488a23ffa5324c6d8cb0a2ea4ffb62b22
[]
no_license
anshdholakia/Full-Voice-Assistant-Application
4185ec88ed50f7477853bbf75905708dc3bb5c6d
c0b88aaece48c2aac4e159f5f7772e1df4c7dd1c
refs/heads/main
2023-05-27T16:38:31.500721
2021-06-14T20:43:48
2021-06-14T20:43:48
376,944,730
0
0
null
null
null
null
UTF-8
Python
false
false
345
py
from translate import Translator First_language = input("Enter the language :") Second_language = input("which language do you want to translate in:") trans = input("what do you want to translate:") translator= Translator(from_lang = First_language, to_lang = Second_language ) translation = translator.translate(trans) print (translation)
[ "anshhiro.dholakia@gmail.com" ]
anshhiro.dholakia@gmail.com
a7996adaf8325122bea98102d171858b89532aa3
37781f86b30df6b31ee51ceeca01d391f9081b35
/player.py
a94d32f4ea2ee36a10494e5f8529af80611561f7
[]
no_license
Dek18/CM1101
2956d77631ba824f3d855da264a285e6fd2297c9
b2ac69015214db279d5bb23906a9e7ad3f44d715
refs/heads/master
2020-04-01T17:50:32.308366
2018-10-19T12:07:50
2018-10-19T12:07:50
153,453,951
0
0
null
null
null
null
UTF-8
Python
false
false
157
py
from items import * from map import rooms inventory = [item_id, item_laptop, item_money] # Start game at the reception current_room = rooms["Reception"]
[ "noreply@github.com" ]
Dek18.noreply@github.com
bd048537d034b6848abcda59d8df2095488bf975
db258fdb98d36eef012f527f05270cb1eab8b5bf
/ListeNomB.py
aa6bf01ed99a91cb379897800f5eefe06ae13c23
[]
no_license
lisalam/Code_VRD
31440e4b4897deb705c578c1c9557b9160ffea4c
bda284754b1095cea07bbe231f53448dcb67d2d7
refs/heads/master
2021-01-10T08:10:12.278550
2013-05-15T13:59:23
2013-05-15T13:59:23
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,497
py
#!/usr/bin/python # -*- coding: iso-8859-15 -*- import os, sys import javax.swing as swing import java.awt as awt from javax.swing import BorderFactory from javax.swing.border import EtchedBorder, TitledBorder from java.awt import Font from java.awt import TextField, Panel, GridLayout, ComponentOrientation, Label, Checkbox, BorderLayout, Button, Color, FileDialog, Frame, Font import sys import os import time import glob import os.path as path import getpass import shutil import random import math username=getpass.getuser() mypath=os.path.expanduser(os.path.join("~","Dropbox","Macros_Lisa","Code_VRD")) sys.path.append(mypath) from org.python.core import codecs codecs.setDefaultEncoding('utf-8') class ListeNomB(swing.JFrame): def __init__(self, listnomb): swing.JFrame.__init__(self, title="Nom de boite") self.setDefaultCloseOperation(swing.JFrame.DISPOSE_ON_CLOSE) self.__listnomb = listnomb self.run() def run(self): self.size = (200, 400) self.contentPane.layout = awt.BorderLayout() line = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED) Panel1=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER)) Panel1.setBorder(line) label=swing.JLabel("") label.setText("Liste des noms de boites") Panel1.add(label) Panel2=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER)) Panel2.setBorder(line) self.__displistnomb = swing.JList(self.__listnomb) Panel2.add(self.__displistnomb) barre = swing.JScrollPane(self.__displistnomb) Panel2.add(barre) Panel3=swing.JPanel(awt.FlowLayout(awt.FlowLayout.RIGHT)) Panel3.setBorder(line) select = swing.JButton("Select", actionPerformed=self.__select) Panel3.add(select) close = swing.JButton("Close", size=(100, 70), actionPerformed=self.__close) Panel3.add(close) self.contentPane.add(Panel1, awt.BorderLayout.NORTH) self.contentPane.add(Panel2, awt.BorderLayout.CENTER) self.contentPane.add(Panel3, awt.BorderLayout.SOUTH) def __select(self, event): print self.__listnomb.getSelectedValues() def __close(self, event): time.sleep(0.01) self.dispose() if __name__ == "__main__": listnomb=[] nom1 = ("20130219_120830_632") nom2 = ("20130219_140840_141") nom3 = ("20130220_104435_275") nom4 = ("20130227_102727_525") listnomb=[nom1,nom2,nom3,nom4] ens=set() listnomb=list(ens) nomb = ListeNomB(listnomb) nomb.show()
[ "lisalamasse@gmail.com" ]
lisalamasse@gmail.com
334884019f2b56715e5a878c947780be070c15b6
5dad0bee1bceb2fcb29d5cd917891341e58901a6
/project_model/project_model/ATA/migrations/0002_auto_20190722_1713.py
5a44e306f936084aa5e200d6f016e49fa17108b1
[]
no_license
fikriamri/DJANGO_MVC
7b727c726e9b3a80fc9cae0c1c69b14d8b8ad531
fbb1df52a68847595408973493edf89414db19d5
refs/heads/master
2022-02-22T06:23:35.877150
2019-07-24T03:39:23
2019-07-24T03:39:23
198,142,007
0
0
null
null
null
null
UTF-8
Python
false
false
366
py
# Generated by Django 2.2.3 on 2019-07-22 10:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ATA', '0001_initial'), ] operations = [ migrations.AlterField( model_name='mentee', name='nomor_absen', field=models.IntegerField(), ), ]
[ "famri@alterra.id" ]
famri@alterra.id
c331620af8d90516d5621093dfcd5f6600132054
b8e70677484e357d941468b7b6335e2cdc32917b
/svenweb/lib.py
e4bbd2fae38f0094d11806fd7f937c79001735a2
[]
no_license
socialplanning/svenweb
b8ee3b095ba7711692fbba2a09c04eab9a1022fa
eadef6372d03b9439e64d1e72636304c90cb85f9
refs/heads/master
2016-09-06T01:18:55.797089
2011-05-16T21:13:01
2011-05-16T21:13:01
1,653,573
0
0
null
null
null
null
UTF-8
Python
false
false
158
py
def location(request): location = '/'.join((request.script_name.rstrip('/'), request.path_info.lstrip('/'))) return location
[ "ethan.jucovy+github@gmail.com" ]
ethan.jucovy+github@gmail.com
82f573ab57442baca38130076f8b17ddd1163034
a665f561b103a51404785f35d0026c60f0083cb4
/0x05-python-exceptions/101-safe_function.py
38683ee508361b035c621dad79ea63525fad197f
[]
no_license
Joshua-Enrico/holbertonschool-higher_level_programming
c5f3c9ab55167ea2e7ea3b31dd8edf2e22a18bde
8c1559f9c772b60186e899e17c67d299f88de726
refs/heads/main
2023-07-31T17:45:16.723947
2021-09-23T00:29:25
2021-09-23T00:29:25
361,960,411
1
5
null
null
null
null
UTF-8
Python
false
false
235
py
#!/usr/bin/python3 def safe_function(fct, *args): try: div = fct(*args) return div except Exception as error: import sys print("Exception: {}".format(error), file=sys.stderr) return None
[ "tmrfack@gmail.com" ]
tmrfack@gmail.com
fc0bbcd096df9fe751b943cfd1fd20e466ee4baf
f82757475ea13965581c2147ff57123b361c5d62
/gi-stubs/repository/Poppler/PageLayout.py
605c3665f4dee50e741e5800be5b7e77e834cdc8
[]
no_license
ttys3/pygobject-stubs
9b15d1b473db06f47e5ffba5ad0a31d6d1becb57
d0e6e93399212aada4386d2ce80344eb9a31db48
refs/heads/master
2022-09-23T12:58:44.526554
2020-06-06T04:15:00
2020-06-06T04:15:00
269,693,287
8
2
null
2020-06-05T15:57:54
2020-06-05T15:57:54
null
UTF-8
Python
false
false
13,686
py
# encoding: utf-8 # module gi.repository.Poppler # from /usr/lib64/girepository-1.0/Poppler-0.18.typelib # by generator 1.147 """ An object which wraps an introspection typelib. This wrapping creates a python module like representation of the typelib using gi repository as a foundation. Accessing attributes of the module will dynamically pull them in and create wrappers for the members. These members are then cached on this introspection module. """ # imports import gi as __gi import gi.overrides.GObject as __gi_overrides_GObject import gobject as __gobject class PageLayout(__gobject.GEnum): # no doc def as_integer_ratio(self): # real signature unknown; restored from __doc__ """ Return integer ratio. Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator. >>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1) """ pass def bit_length(self): # real signature unknown; restored from __doc__ """ Number of bits necessary to represent self in binary. >>> bin(37) '0b100101' >>> (37).bit_length() 6 """ pass def conjugate(self, *args, **kwargs): # real signature unknown """ Returns self, the complex conjugate of any int. """ pass def from_bytes(self, *args, **kwargs): # real signature unknown """ Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte array. If byteorder is 'little', the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder' as the byte order value. signed Indicates whether two's complement is used to represent the integer. """ pass def to_bytes(self, *args, **kwargs): # real signature unknown """ Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte array. If byteorder is 'little', the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder' as the byte order value. signed Determines whether two's complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised. """ pass def __abs__(self, *args, **kwargs): # real signature unknown """ abs(self) """ pass def __add__(self, *args, **kwargs): # real signature unknown """ Return self+value. """ pass def __and__(self, *args, **kwargs): # real signature unknown """ Return self&value. """ pass def __bool__(self, *args, **kwargs): # real signature unknown """ self != 0 """ pass def __ceil__(self, *args, **kwargs): # real signature unknown """ Ceiling of an Integral returns itself. """ pass def __delattr__(self, *args, **kwargs): # real signature unknown """ Implement delattr(self, name). """ pass def __dir__(self, *args, **kwargs): # real signature unknown """ Default dir() implementation. """ pass def __divmod__(self, *args, **kwargs): # real signature unknown """ Return divmod(self, value). """ pass def __eq__(self, *args, **kwargs): # real signature unknown """ Return self==value. """ pass def __float__(self, *args, **kwargs): # real signature unknown """ float(self) """ pass def __floordiv__(self, *args, **kwargs): # real signature unknown """ Return self//value. """ pass def __floor__(self, *args, **kwargs): # real signature unknown """ Flooring an Integral returns itself. """ pass def __format__(self, *args, **kwargs): # real signature unknown pass def __getattribute__(self, *args, **kwargs): # real signature unknown """ Return getattr(self, name). """ pass def __getnewargs__(self, *args, **kwargs): # real signature unknown pass def __ge__(self, *args, **kwargs): # real signature unknown """ Return self>=value. """ pass def __gt__(self, *args, **kwargs): # real signature unknown """ Return self>value. """ pass def __hash__(self, *args, **kwargs): # real signature unknown """ Return hash(self). """ pass def __index__(self, *args, **kwargs): # real signature unknown """ Return self converted to an integer, if self is suitable for use as an index into a list. """ pass def __init_subclass__(self, *args, **kwargs): # real signature unknown """ This method is called when a class is subclassed. The default implementation does nothing. It may be overridden to extend subclasses. """ pass def __init__(self, *args, **kwargs): # real signature unknown pass def __int__(self, *args, **kwargs): # real signature unknown """ int(self) """ pass def __invert__(self, *args, **kwargs): # real signature unknown """ ~self """ pass def __le__(self, *args, **kwargs): # real signature unknown """ Return self<=value. """ pass def __lshift__(self, *args, **kwargs): # real signature unknown """ Return self<<value. """ pass def __lt__(self, *args, **kwargs): # real signature unknown """ Return self<value. """ pass def __mod__(self, *args, **kwargs): # real signature unknown """ Return self%value. """ pass def __mul__(self, *args, **kwargs): # real signature unknown """ Return self*value. """ pass def __neg__(self, *args, **kwargs): # real signature unknown """ -self """ pass @staticmethod # known case of __new__ def __new__(*args, **kwargs): # real signature unknown """ Create and return a new object. See help(type) for accurate signature. """ pass def __ne__(self, *args, **kwargs): # real signature unknown """ Return self!=value. """ pass def __or__(self, *args, **kwargs): # real signature unknown """ Return self|value. """ pass def __pos__(self, *args, **kwargs): # real signature unknown """ +self """ pass def __pow__(self, *args, **kwargs): # real signature unknown """ Return pow(self, value, mod). """ pass def __radd__(self, *args, **kwargs): # real signature unknown """ Return value+self. """ pass def __rand__(self, *args, **kwargs): # real signature unknown """ Return value&self. """ pass def __rdivmod__(self, *args, **kwargs): # real signature unknown """ Return divmod(value, self). """ pass def __reduce_ex__(self, *args, **kwargs): # real signature unknown """ Helper for pickle. """ pass def __reduce__(self, *args, **kwargs): # real signature unknown pass def __repr__(self, *args, **kwargs): # real signature unknown """ Return repr(self). """ pass def __rfloordiv__(self, *args, **kwargs): # real signature unknown """ Return value//self. """ pass def __rlshift__(self, *args, **kwargs): # real signature unknown """ Return value<<self. """ pass def __rmod__(self, *args, **kwargs): # real signature unknown """ Return value%self. """ pass def __rmul__(self, *args, **kwargs): # real signature unknown """ Return value*self. """ pass def __ror__(self, *args, **kwargs): # real signature unknown """ Return value|self. """ pass def __round__(self, *args, **kwargs): # real signature unknown """ Rounding an Integral returns itself. Rounding with an ndigits argument also returns an integer. """ pass def __rpow__(self, *args, **kwargs): # real signature unknown """ Return pow(value, self, mod). """ pass def __rrshift__(self, *args, **kwargs): # real signature unknown """ Return value>>self. """ pass def __rshift__(self, *args, **kwargs): # real signature unknown """ Return self>>value. """ pass def __rsub__(self, *args, **kwargs): # real signature unknown """ Return value-self. """ pass def __rtruediv__(self, *args, **kwargs): # real signature unknown """ Return value/self. """ pass def __rxor__(self, *args, **kwargs): # real signature unknown """ Return value^self. """ pass def __setattr__(self, *args, **kwargs): # real signature unknown """ Implement setattr(self, name, value). """ pass def __sizeof__(self, *args, **kwargs): # real signature unknown """ Returns size in memory, in bytes. """ pass def __str__(self, *args, **kwargs): # real signature unknown """ Return str(self). """ pass def __subclasshook__(self, *args, **kwargs): # real signature unknown """ Abstract classes can override this to customize issubclass(). This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached). """ pass def __sub__(self, *args, **kwargs): # real signature unknown """ Return self-value. """ pass def __truediv__(self, *args, **kwargs): # real signature unknown """ Return self/value. """ pass def __trunc__(self, *args, **kwargs): # real signature unknown """ Truncating an Integral returns itself. """ pass def __xor__(self, *args, **kwargs): # real signature unknown """ Return self^value. """ pass denominator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """the denominator of a rational number in lowest terms""" imag = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """the imaginary part of a complex number""" numerator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """the numerator of a rational number in lowest terms""" real = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """the real part of a complex number""" value_name = property(lambda self: object(), lambda self, v: None, lambda self: None) # default value_nick = property(lambda self: object(), lambda self, v: None, lambda self: None) # default ONE_COLUMN = 2 SINGLE_PAGE = 1 TWO_COLUMN_LEFT = 3 TWO_COLUMN_RIGHT = 4 TWO_PAGE_LEFT = 5 TWO_PAGE_RIGHT = 6 UNSET = 0 __class__ = type __dict__ = None # (!) real value is "mappingproxy({'__module__': 'gi.repository.Poppler', '__dict__': <attribute '__dict__' of 'PageLayout' objects>, '__doc__': None, '__gtype__': <GType PopplerPageLayout (94391899009456)>, '__enum_values__': {0: <enum POPPLER_PAGE_LAYOUT_UNSET of type Poppler.PageLayout>, 1: <enum POPPLER_PAGE_LAYOUT_SINGLE_PAGE of type Poppler.PageLayout>, 2: <enum POPPLER_PAGE_LAYOUT_ONE_COLUMN of type Poppler.PageLayout>, 3: <enum POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT of type Poppler.PageLayout>, 4: <enum POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT of type Poppler.PageLayout>, 5: <enum POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT of type Poppler.PageLayout>, 6: <enum POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT of type Poppler.PageLayout>}, '__info__': gi.EnumInfo(PageLayout), 'UNSET': <enum POPPLER_PAGE_LAYOUT_UNSET of type Poppler.PageLayout>, 'SINGLE_PAGE': <enum POPPLER_PAGE_LAYOUT_SINGLE_PAGE of type Poppler.PageLayout>, 'ONE_COLUMN': <enum POPPLER_PAGE_LAYOUT_ONE_COLUMN of type Poppler.PageLayout>, 'TWO_COLUMN_LEFT': <enum POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT of type Poppler.PageLayout>, 'TWO_COLUMN_RIGHT': <enum POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT of type Poppler.PageLayout>, 'TWO_PAGE_LEFT': <enum POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT of type Poppler.PageLayout>, 'TWO_PAGE_RIGHT': <enum POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT of type Poppler.PageLayout>})" __enum_values__ = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, } __gtype__ = None # (!) real value is '<GType PopplerPageLayout (94391899009456)>' __info__ = gi.EnumInfo(PageLayout)
[ "ttys3@outlook.com" ]
ttys3@outlook.com
eeedc6e06be66be4ba83b0914b71cabc517a8dc2
ad010f3ecdaa260b2d8732b8b784d58b3c812b9e
/spider_admin_pro/config/yaml_config.py
a43dc91138192f1c70a92ea9429b25cabd30f721
[]
no_license
laashub-soa/spider-admin-pro
52261816015afa672176423f38d0206f9bbafa15
5faefebd25ad6a163a6a7d18076dc10adba7d970
refs/heads/master
2023-08-14T01:24:15.659796
2021-09-27T04:15:52
2021-09-27T04:15:52
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,533
py
# -*- coding: utf-8 -*- ################################# # 读取用户自定义变量 ################################# import os import yaml from spider_admin_pro.config import env_config from spider_admin_pro.logger import logger config_file = os.path.join(os.getcwd(), 'config.yml') logger.info('config_file: %s', config_file) if os.path.exists(config_file): f = open(config_file, "rb") config = yaml.safe_load(f) f.close() else: config = {} # flask 服务配置 FLASK_PORT = config.get('PORT', env_config.FLASK_PORT) FLASK_HOST = config.get('HOST', env_config.FLASK_HOST) # 登录账号密码 BASIC_AUTH_USERNAME = config.get('USERNAME', env_config.BASIC_AUTH_USERNAME) BASIC_AUTH_PASSWORD = config.get('PASSWORD', env_config.BASIC_AUTH_PASSWORD) BASIC_AUTH_JWT_KEY = config.get('JWT_KEY', env_config.BASIC_AUTH_JWT_KEY) # token过期时间,单位天 BASIC_AUTH_EXPIRES = config.get('EXPIRES', env_config.BASIC_AUTH_EXPIRES) # scrapyd地址, 结尾不要加斜杆 SCRAPYD_SERVER = config.get('SCRAPYD', env_config.SCRAPYD_SERVER) # 调度器 调度历史存储设置 # mysql or sqlite and other, any database for peewee support SCHEDULE_HISTORY_DATABASE_URL = config.get('SCHEDULE_HISTORY_DATABASE_URL', env_config.SCHEDULE_HISTORY_DATABASE_URL) # 调度器 定时任务存储地址 JOB_STORES_DATABASE_URL = config.get('JOB_STORES_DATABASE_URL', env_config.JOB_STORES_DATABASE_URL) # 日志文件夹 LOG_DIR = config.get("LOG_DIR", env_config.LOG_DIR)
[ "1940607002@qq.com" ]
1940607002@qq.com
bdde9f777bdf20d7a7c2236af816571c9a9d3bd1
5eed367617654c0b1182ad9ddbb4c949e68cde75
/main.py
a311a9aebdacd0c031e9658eb6f72a06225c100c
[]
no_license
nipunatheekshana/jarvis
c8d6eb50f34f988216b4f2bbe07a454715dbfda0
21f96254e0f346a7e42f60594660f423ad61725c
refs/heads/master
2023-02-13T14:08:03.410846
2021-01-11T19:22:03
2021-01-11T19:22:03
328,769,009
0
0
null
null
null
null
UTF-8
Python
false
false
1,361
py
import speech_recognition as sr import pyttsx3 import pywhatkit import datetime import wikipedia import pyjokes listner = sr.Recognizer() engine = pyttsx3.init() def talk(word): engine.say(word) engine.runAndWait() def receive_command(): try: with sr.Microphone() as source: talk("yes sir") voice = listner.listen(source) command = listner.recognize_google(voice) command = command.lower() if 'jarvis' in command: command = command.replace('jarvis', '') talk(command) except: pass return command def run_jarvis(): command = receive_command() print(command) if 'play' in command: song = command.replace('play', '') talk('playing'+song) pywhatkit.playonyt(song) elif 'time' in command: time = datetime.datetime.now().strftime('%I %M %p') # I is 12 hour format of time talk('current time is'+time) elif 'who' in command: query = command.replace('who', '') result = wikipedia.summary(query, 1) print(result) talk(result) elif 'joke' in command: talk(pyjokes.get_joke()) elif 'name' in command: talk('i am jarvis your personal assistant') else: talk('please say again') while True: run_jarvis()
[ "nipunatheekshana8@gmail.com" ]
nipunatheekshana8@gmail.com
43b3dcc73cfdcbc4c2c4e592fd97bc7d88a60d21
fde6081d838481a2451e435d7ce1e8efd41d8c2c
/Util.py
4bdaced86fbd3fafe543135c25e5b4d54a20dc30
[]
no_license
parthivpatel1106/SleepBot
b067bbf27275b4ab35136c912a167a411da57ad2
09979d273fa761da09201d5166bbbf3dc4819c01
refs/heads/main
2023-01-21T21:45:39.471169
2020-12-03T12:48:49
2020-12-03T12:48:49
318,178,217
0
0
null
2020-12-03T11:57:42
2020-12-03T11:57:42
null
UTF-8
Python
false
false
2,592
py
import discord from discord.ext import commands import asyncio import os import random # For Database related stuff import sqlite3 from dotenv import load_dotenv from datetime import datetime from datetime import date POINT = {} # Open and connect to Database File conn = sqlite3.connect('Database.db') c = conn.cursor() c.execute("SELECT channel_ID FROM channel_table WHERE title='LOG';") LOG = c.fetchone() c.execute("SELECT user_id, points FROM point_table;") DB_POINT = c.fetchall() c.execute("SELECT channel_ID FROM channel_table WHERE title='POINT';") POINTCMD = c.fetchone() POINTCMD = int(POINTCMD[0]) def is_point_cmd_chnl(): def predicate(ctx): return int(ctx.channel.id) == int(POINTCMD) return commands.check(predicate) conn.close() # For Backup to Database async def Backup(client): await client.wait_until_ready() global POINT global DB_POINT while not client.is_closed(): await client.get_channel(LOG[0]).send(f"Backup OK: ```{datetime.now()}```") # Repeat every 1 hour await asyncio.sleep(1800) conn = sqlite3.connect('Database.db') c = conn.cursor() c.execute("SELECT user_id, points FROM point_table;") DB_POINT = c.fetchall() await client.get_channel(int(LOG[0])).send(f"Performing Backup: ```{datetime.now()}```") # POINT BACKUP for user in DB_POINT: if user[0] in POINT: c.execute("UPDATE point_table SET points = {} WHERE user_ID = {}".format(POINT[user[0]]+user[1],user[0])) is_instance = False for user in POINT: for elm in DB_POINT: if user in elm: is_instance = True break if not is_instance: c.execute("INSERT INTO point_table VALUES (NULL, {}, {});".format(user,POINT[user])) is_instance = False c.execute("SELECT user_ID, points FROM point_table;") DB_POINT = c.fetchall() conn.commit() conn.close() POINT = {} # Function to log commands async def command_log(client, ctx, cmd_name): embed = discord.Embed( title = "SleepBot Command Logs", description = ("Command: {}\nMessage Content: {}".format(cmd_name, ctx.message.content)), colour = random.randint(0, 0xffffff) ) embed.add_field(name = "In Guild:", value = "{}".format(ctx.guild), inline = False) embed.add_field(name = "In Channel:", value = "{} Channel_ID: {}".format(ctx.channel, ctx.channel.id), inline = False) embed.add_field(name = "Author:", value = "{}, Nick: {}, ID: {}".format(ctx.author, ctx.author.nick, ctx.author.id), inline = False) embed.add_field(name = "Time:", value = "{}".format(datetime.now()), inline = False) await client.get_channel(LOG[0]).send(embed = embed)
[ "62468954+ZeusAbhijeet@users.noreply.github.com" ]
62468954+ZeusAbhijeet@users.noreply.github.com
834db63d639b48b74456b466a1a37de5eec65799
c5a013595c7f5000d817c37f94db174751fba865
/asyncpy/asyncpy/__init__.py
fcbdb02e7bff8b3a5e36ea7fbc6107adceff159b
[ "MIT" ]
permissive
Fenfenrao/asyncpy
c3b8d7ee5399f11e49c711d917fd8f9fd2b370d5
9c0b4ebe2f30cd4381c8cc0407f7dc98b1fd72c3
refs/heads/master
2022-07-28T20:08:43.063804
2020-05-25T05:05:21
2020-05-25T05:05:21
266,761,650
1
0
null
2020-05-25T11:28:34
2020-05-25T11:28:34
null
UTF-8
Python
false
false
1,620
py
# -*- coding: utf-8 -*- """Asyncpy Usage: asyncpy genspider <name> asyncpy (-h | --help | --version) Options: --version Show version. """ from asyncpy.middleware import Middleware from asyncpy.request import Request from asyncpy.response import Response from asyncpy.spider import Spider from asyncpy.exceptions import IgnoreThisItem from pathlib import Path from docopt import docopt __all__ = ["Middleware","Request","Response","Spider","IgnoreThisItem"] VERSION = '1.1.5' DEFAULT_ENCODING = 'utf-8' import os import shutil def create_base(name): template = 'templates' template_path = Path(__file__).parent / template project_path = os.path.join(os.getcwd(), name) if not os.path.exists(project_path): shutil.copytree(template_path, project_path) os.rename(project_path,project_path) spider_path = os.path.join(project_path, 'spiders/templates.py') new_spider_path = os.path.join(project_path, 'spiders/{}.py'.format(name)) os.rename(spider_path,new_spider_path) with open(file=new_spider_path,mode='r',encoding='utf-8')as f: doc = f.read() doc = doc.replace('templates',name).replace('Demo',name.capitalize()) with open(file=new_spider_path,mode='w',encoding='utf-8')as f1: f1.write(doc) print("Created successfully") else: print("file already exist") def cli(): """ Commandline for Asyncpy :d """ argv = docopt(__doc__, version=VERSION) if argv.get('genspider'): name = argv['<name>'] create_base(name=name)
[ "125066648@qq.com" ]
125066648@qq.com
41edfbdd80492e88bc1f100c372ba51fd0c98a92
71788a22dcaeb2fbde56b87fabf7ee21df3a770f
/students/matthew_denko/lesson05/mailroom_pt3.py
4786a37f7981960ed69bbf09917b1619138c8d18
[]
no_license
UWPCE-PythonCert-ClassRepos/Python210_Fall2019
5bdfc1c919666eccb42ee07a1d7e385b21f11652
e45481671684a3cc8a469461a15cd9f660752ee0
refs/heads/master
2020-08-05T16:33:53.068983
2019-12-29T09:57:59
2019-12-29T09:57:59
212,615,940
4
34
null
2019-12-29T09:58:00
2019-10-03T15:38:40
Python
UTF-8
Python
false
false
8,603
py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Nov 12 06:34:53 2019 @author: matt.denko """ # pt 3 description ------------------------------------------------------------ """Exceptions Now that you’ve learned about exception handling, you can update your code to handle errors better, such as when a user inputs bad data.""" """Comprehensions Can you use comprehensions to clean up your code a bit? List comprehensions are designed for a very specific use case: Processing a sequence of items to create another sequence.""" # importing packages ---------------------------------------------------------- import sys import os # Creating donor list---------------------------------------------------------- donors = dict() "Convert main donor data structure to be a dict" def new_donor(name, total=0, gifts=0, avg_gift=0): "function to add new donor to dictionary - along with average gift, total gift, number of gifts" if name not in donors: "if donor not in original list then add it to list, if it already exists do nothing" if gifts > 0: "If gift value is 0 or less do not add - not a valid donation" avg_gift = round(total/gifts, 2) donors[name] = {'donation_total':round(total, 2), 'donation_ct':int(gifts), 'donation_avg':avg_gift} def create_donors(): "function to create donor list, col1 - donor, col2 - average gift, col3 - number of gifts" new_donor("Dennis Rodman", 1111, 1) new_donor("Suge Knight", 2222.22, 2) new_donor("Dumbledore", 33333.33, 3) new_donor("Grizzly Adams", 44444, 1) new_donor("Bob Evans", 555,2) new_donor("Barron Trump", 66.55, 1) # exit program ---------------------------------------------------------------- def exit_program(): "Creating a function to exit and stop program at any time" print("Now exiting....goodbye\n") "fixing from pt 1 - actually exiting :)" sys.exit() # Creating home screen text --------------------------------------------------- home_screen_text = ("\nWelcome to the home screen please select one of option 1 through 3:\n" "1: Make a Thank You\n" "2: Make a Report\n" "3: Make a letter\n" "4: Exit\n") def create_thank_you_note(name,amount): "custom thank you note to automatically send the option is chose" print(f"\nTo my dearest {name}:\n\n Thank you so much for your giant donation of ${amount}.",\ "We are extremely thankful for your donation.\n\n.") # home screen function creation ----------------------------------------------- def home_screen(_): "function to print text of home screen - unless an action is chosen" while True: print(home_screen_text) action = input("") if action in _: _[action]() if action == "exit": "if action is exit chosen then break this function" break # creating custom thank you function ------------------------------------------ donor_new = () def make_thank_you(): """"Function to create custom thank you note for donor, the function also prompts user to add a new donor and will add the donor to the existing dictionary if it does not already exist""" try: user_text = "" thank_you = """"To go to home screen please enter 'exit'. \nType the name of a donor or type 'donors' to view list of donors\n""" while user_text != "exit": user_text = input(thank_you) while user_text == "donors": for name in donors: print(name) user_text = input(thank_you) if user_text == "exit": break donation_amount = input("Please enter donation amount: ") if donation_amount == "exit": break "new list comprehension" donors_new = [new_donor(user_text) for _ in user_text if user_text not in donors] "if the users input is a donor not in the current list then add it" donors[user_text]['donation_total'] += float(donation_amount) "total as a float" donors[user_text]['donation_ct'] += 1 "count as an int" donors[user_text]['donation_avg'] = donors[user_text]['donation_total']/donors[user_text]['donation_ct'] "avg will be a float due to dividing by float" create_thank_you_note(user_text,donation_amount) user_text = "q" except ValueError as error: "Adding exception handling for ValueError" print('Please donate an actual amount of money....aka a float or int!') donation_amount = input("Please enter donation amount: ") "new list comprehension" donors_new = [new_donor(user_text) for _ in user_text if user_text not in donors] "if the users input is a donor not in the current list then add it" donors[user_text]['donation_total'] += float(donation_amount) "total as a float" donors[user_text]['donation_ct'] += 1 "count as an int" donors[user_text]['donation_avg'] = donors[user_text]['donation_total']/donors[user_text]['donation_ct'] "avg will be a float due to dividing by float" create_thank_you_note(user_text,donation_amount) user_text = "q" finally: "finally in case of double exception" line1 = '\n lets start over...back to main menu....\n\n' line2 = 'Please this time if you choose to make a thank you enter an integer or float in the amount!!!!!...\n\n ' lp = '\n'.join([line1, line2]) print(lp) home_screen(home_screen_summary) # making report --------------------------------------------------------------- def make_report(): """Function to create a custom report if the action is choosen by the user. The report will contain the donation total, the count of donations, and the average donation for each donor""" output = sorted(donors.items(), key = lambda e: e[1]['donation_total'], reverse=True) print("Donor Name"," Total Given - Num Gifts - Average Gift") for item in output: print("{:25} ${:>11.2f}{:>12d} ${:>12.2f}".format(item[0], item[1]['donation_total'], item[1]['donation_ct'], item[1]['donation_avg'])) # letter prompt --------------------------------------------------------------- def letter_prompt(): "function to create letter prompt for custom donor letters" line1 = 'To my dearest and special friend {name},\n\n' \ + 'Thank you for your awe inspiring donation of ${last:.2f}!' line2 = 'With this latest personal sacrifice your lifetime donations total is ${total:.2f}!!!!!! ' \ + 'Best Wishes,\n\nMatthew Denko, Decider of Things\n' lp = '\n'.join([line1, line2]) "returning joined prompt" return lp # writing letters ------------------------------------------------------------- def make_letter(): "function to create custom letter files for each donor" try: "creating a new folder in the current working directory named thank_you_notes" new_folder = os.mkdir(os.getcwd() + '//donationletters') new_folder = os.getcwd() + '//donationletters' except FileExistsError: "exception in case file is already there" new_folder = os.getcwd() + '//donationletters' "loop to create note" for i in donors: donors2 = donors[i] letter_details = {'name': i, 'last': donors2['donation_avg'], 'total': donors2['donation_total']} file = new_folder + '//' + letter_details['name'].replace(' ', '_') + '.txt' with open(file, 'w') as letter: "using .format() method to produce the letter as one big template" letter_note = letter_prompt() letter.write(letter_note.format(**letter_details)) # home screen summary --------------------------------------------------------- "See if you can use a dict to switch between the user’s selections" home_screen_summary = {"1": make_thank_you, "2":make_report, "3":make_letter, "4":exit_program} # if _name_ == '_main_' block ------------------------------------------------- if __name__ == '__main__': "If this is the main file then execute these functions" create_donors() "create donors function generates donor list" home_screen(home_screen_summary) """home screen function prints home_screen_summary which contains functions for all of the menu prompts"""
[ "denkmatt@umich.edu" ]
denkmatt@umich.edu
2bf35fe27a37fa9abcd436ee6d574981f541f759
26e3146ce5f3b27ae867aa7238f377b109e7a0e3
/bot_4.py
a11e1ff499174f3c4c11f3d20bf6a15cf43fa020
[]
no_license
Mattix-M/chatbot1
1fa64512facc406a68d6ee797dc7d8c3d174300a
9eb9226fb8cde5186895c39d753fe16d56b32d13
refs/heads/master
2022-07-10T20:19:22.882513
2020-05-12T15:02:05
2020-05-12T15:02:05
263,369,140
0
0
null
null
null
null
UTF-8
Python
false
false
1,393
py
import datetime import vk_api from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType import random vk_session = vk_api.VkApi( token=TOKEN) longpoll = VkBotLongPoll(vk_session, GROUP_ID) vk = vk_session.get_api() day = {0: 'понедельник', 1: 'вторник', 2: 'среда', 3: 'четверг', 4: 'пятница', 5: 'суббота', 6: 'воскресенье'} def weekday_response(request_data): date = datetime.datetime.strptime(request_data, '%Y-%m-%d').weekday() return day[date] def help(): return f"Write the date in the format 'YYYY-MM-DD' and I will say the day of the week." def main(): flag_data, flag_help = False, True for event in longpoll.listen(): if event.type == VkBotEventType.MESSAGE_NEW and flag_help: flag_data = not flag_data flag_help = not flag_help vk.messages.send(user_id=event.obj.message['from_id'], message=help(), random_id=random.randint(0, 2 ** 64)) elif event.type == VkBotEventType.MESSAGE_NEW and flag_data: vk.messages.send(user_id=event.obj.message['from_id'], message=f"{weekday_response(event.obj.message['text'])}\n\n{help()}", random_id=random.randint(0, 2 ** 64)) if __name__ == '__main__': main()
[ "noreply@github.com" ]
Mattix-M.noreply@github.com
013f62d1095057fe79083d89f83110ecb8c70f3f
dc99d95671170444cd7bf02e37da6ecda4a5f19e
/apps/courses/views.py
744bef09fd1699bd93842b7c1d3d4a04ab7d3ca9
[]
no_license
bbright3493/python_real_war
734d49ed9f7e1800d24dc754424a07b69d7d8c1f
6e43bb7d814920222f3310bd6fd9f04cb3d5bbf1
refs/heads/master
2020-03-30T06:08:40.249185
2018-10-22T07:33:41
2018-10-22T07:33:41
150,841,381
0
0
null
null
null
null
UTF-8
Python
false
false
24,305
py
# -*- coding: utf-8 -*- import json from django.shortcuts import render, HttpResponse from django.views.generic.base import View from pure_pagination import Paginator, EmptyPage, PageNotAnInteger from utils.mixin_utils import LoginRequiredMixin from .models import Course, Lesson, ChoiceQuestion, Video, ProgramQuestion, ChoiceBank, ProgramUpload, CourseCategory, \ Faq from .models import CourseDirection, KnowledgePoint from article.models import Article from operation.models import UserCourse, UserPass, UserErrorChoice from integral.models import UserIntergral, IntergralDemand from .forms import ProgramUploadForm from project.models import ProjectShow # Create your views here. class CourseListView(View): """ 课程列表页 """ def get(self, request): all_category = CourseCategory.objects.all() all_direction = CourseDirection.objects.all() click_direction = request.GET.get("direction", "all") click_category = request.GET.get("category", "all") click_degree = request.GET.get("degree", "all") click_sort = request.GET.get("sort", "new") print(click_direction) if click_direction == "all": if click_category == "all": if click_degree == "all": all_course = Course.objects.all().order_by("-add_time") if click_sort == "hot": all_course = Course.objects.all().order_by("-students") else: all_course = Course.objects.filter(degree=click_degree).order_by("-add_time") if click_sort == "hot": all_course = all_course.order_by("-students") else: if click_degree == "all": all_course = Course.objects.filter(coursecategory__category=click_category).order_by("-add_time") if click_sort == "hot": all_course = all_course.order_by("-students") else: all_course = Course.objects.filter(coursecategory__category=click_category, degree=click_category).order_by("-add_time") if click_sort == "hot": all_course = all_course.order_by("-students") else: all_course = Course.objects.filter(direction=click_direction) print("all:", all_course) if click_category == "all": if click_degree == "all": all_course = all_course.order_by("-add_time") if click_sort == "hot": all_course = all_course.order_by("-students") else: all_course = all_course.filter(degree=click_degree).order_by("-add_time") if click_sort == "hot": all_course = all_course.order_by("-students") else: if click_degree == "all": all_course = all_course.filter(coursecategory__category=click_category).order_by("-add_time") if click_sort == "hot": all_course = all_course.order_by("-students") else: all_course = all_course.filter(coursecategory__category=click_category, degree=click_category).order_by("-add_time") if click_sort == "hot": all_course = all_course.order_by("-students") try: page = request.GET.get('page', 1) except PageNotAnInteger: page = 1 p = Paginator(all_course, 6, request=request) courses = p.page(page) print(type(courses)) print("session:", request.session.get('Linux', default="Html")) return render(request, 'course_list.html', { "all_direction": all_direction, "all_course": courses, "all_category": all_category, "click_direction": click_direction, "click_category": click_category, "click_degree": click_degree, "click_sort": click_sort, }) class CourseLevelView(View): """ 课程关卡列表页 显示关卡时同时查询用户关卡信息 需要显示用户对应关卡对学习情况 """ def get(self, request, course_id): course = Course.objects.get(id=int(course_id)) # 查询用户是否已经关联了该课程 try: user_course = UserCourse.objects.get(user=request.user, course=course) except: user_course = UserCourse(user=request.user, course=course) user_course.save() students = UserCourse.objects.all().count() course.students = int(students) course.save() all_level = Lesson.objects.filter(course=course_id).order_by("add_time") this_level = Lesson.objects.filter(course=course_id).first() # 对该课程对所有关卡 查询对应对用户关卡表 如果没有 则新建 for level in all_level: try: cur_user_level = UserPass.objects.get(user=request.user, lesson=level) except: cur_user_level = UserPass(user=request.user, lesson=level) cur_user_level.save() user_levels = UserPass.objects.filter(user=request.user, lesson__course=course).order_by("lesson") # # 下一关关卡 # try: # next_level = Lesson.objects.filter(course=course_id).order_by("add_time")[Level_num+1] # except IndexError: # next_level = Lesson.objects.filter(course=course_id).order_by("add_time")[Level_num] # # # 开通下一关关卡 # if this_level.pass_level: # next_level.pass_level = True last_level = Lesson.objects.filter(course=course_id).last() projects = ProjectShow.objects.filter(course=course) return render(request, 'course_level.html', locals()) class CourseDetailView(View): """ 关卡详情页 """ def get(self, request, course_id, lesson_id): course = Course.objects.get(id=course_id) # 查询用户课程状态 如果是未学习 则将状态改为正在学习 user_course = UserCourse.objects.get(user=request.user, course=course) if user_course.study_status == 1: user_course.study_status = 2 user_course.save() lesson = Lesson.objects.get(id=lesson_id) try: user_lesson = UserPass.objects.get(user=request.user, lesson=lesson) except: user_lesson = UserPass(user=request.user, lesson=lesson) user_lesson.save() print(lesson) # user_intergral = UserIntergral.objects.get(user=request.user) extend_demand = IntergralDemand.objects.get(lesson_id=int(lesson_id), demand='extend_download') # explain_demand = IntergralDemand.objects.get(lesson_id=int(lesson_id), demand='pro_explain') all_vedio = Video.objects.filter(lesson_id=lesson_id) all_article = Article.objects.filter(lesson=lesson).order_by('no') choice_bank = lesson.get_choice_bank() program_bank = lesson.get_program_bank() faqs = Faq.objects.filter(lesson=lesson) knowledge_points = KnowledgePoint.objects.filter(lesson=lesson) lesson_projects = ProjectShow.objects.filter(lesson=lesson) return render(request, 'course_detail.html', locals()) class ChoiceQuestionAnswerView(View): """ 选择题题目 """ def get(self, request, course_id, lesson_id, choice_id): lesson_choices = ChoiceQuestion.objects.filter(lesson_id=int(lesson_id)) this_question = ChoiceQuestion.objects.get(id=choice_id) all_question_num = ChoiceQuestion.objects.filter(lesson_id=int(lesson_id)).count() is_last = False if int(choice_id) == all_question_num: is_last = True return render(request, 'choice_answer.html', locals()) class ChoiceQuestionView(View): """ 选择题题目 """ def get(self, request, course_id, lesson_id, choice_id): lesson_choices = ChoiceQuestion.objects.filter(lesson_id=int(lesson_id)) this_question = ChoiceQuestion.objects.get(id=choice_id) all_question_num = ChoiceQuestion.objects.filter(lesson_id=int(lesson_id)).count() print(all_question_num) if int(this_question.question_num) == 1: request.session['right_count'] = 0 request.session['error'] = [] is_last = False if this_question.question_num == all_question_num: is_last = True next_question = this_question else: next_question = ChoiceQuestion.objects.get(question_num=this_question.question_num+1, choicebank=this_question.choicebank) return render(request, 'choice_pra.html', locals()) class NextQuestionView(View): """ 下一题 """ def post(self, request): this_question = request.POST.get("practice_num", 1) user_answer = request.POST.get("user_answer", "") if int(user_answer) != -1: # 得到本题的正确答案 right = ChoiceQuestion.objects.get(id=int(this_question)) right_answer = right.answer if int(user_answer) + 1 == right_answer: print("答对本题") request.session['right_count'] = request.session.get('right_count', default=0) + 1 else: print("本题错误") l = request.session['error'] l.append(right.id) request.session['error'] = l user_pass = UserPass.objects.get(user=request.user, lesson=right.lesson) # 判断是否第一次提交答案 if user_pass.choice_status == 0: user_course = UserCourse.objects.get(user=request.user, course=right.lesson.course) # 判断是否开通课程vip或者关卡vip if user_course.course_status == 2 or user_pass.status == 2: error_question = UserErrorChoice() error_question.user = request.user error_question.choice = right error_question.user_answer = int(user_answer) + 1 error_question.save() value = {"status": "success"} print("session", request.session['right_count']) return HttpResponse(json.dumps(value), content_type='application/json') else: return HttpResponse('{"status":"fail", "msg":"没有进行选择"}', content_type='application/json') class ChoiceResultView(View): """ 选择题结果 """ def get(self, request, course_id, lesson_id): right_nums = request.session.get('right_count', default=0) user_errors = request.session.get('error', default=[]) errors = [] for error in user_errors: errors.append(ChoiceQuestion.objects.get(id=int(error))) print("right_nums:", right_nums) all_question_num = ChoiceQuestion.objects.filter(lesson_id=int(lesson_id)).count() print("all_num:", all_question_num) right_rate = int(int(right_nums) / float(all_question_num) * 100) print(right_rate) lesson = Lesson.objects.get(id=lesson_id) course = Course.objects.get(id=course_id) # 保存提交状态 只有开通了vip的用户才修改该状态 user_pass = UserPass.objects.get(user=request.user, lesson=lesson) user_course = UserCourse.objects.get(user=request.user, course=course) if user_pass.choice_status == 0 and (user_pass.status == 2 or user_course.course_status == 2): user_pass.choice_status = 1 user_pass.save() return render(request, 'choice_result.html', locals()) class ProgramView(View): """ 编程题 """ def get(self, request, course_id, lesson_id, program_id): # program_file = ProgramQuestion.objects.get(course=int(course_id), lesson=int(lesson_id), id=int(program_id)) program = ProgramQuestion.objects.get(id=program_id) all_question_num = ProgramQuestion.objects.filter(program_bank=program.program_bank).count() if int(program.question_num) == 1: request.session['right_count_program'] = 0 request.session['error_program'] = [] is_last = False #判断是否最后一题 if program.question_num == all_question_num: is_last = True next_program = program else: next_program = ProgramQuestion.objects.get(question_num=program.question_num+1, program_bank=program.program_bank ) try: program_result = ProgramUpload.objects.get(programquestion_id=int(program_id), user=request.user) except ProgramUpload.DoesNotExist: program_result = ProgramUpload.objects.all() print(program_result) return render(request, 'program.html', locals()) class ProgramingView(View): """ 编程题的编程页面 """ def get(self, request, course_id, lesson_id, program_id): # program_file = ProgramQuestion.objects.get(course=int(course_id), lesson=int(lesson_id), id=int(program_id)) program = ProgramQuestion.objects.get(id=program_id) try: program_result = ProgramUpload.objects.get(programquestion_id=int(program_id), user=request.user) except ProgramUpload.DoesNotExist: program_result = ProgramUpload.objects.all() print(program_result) return render(request, 'program_start.html', locals()) class ProgramingCommitView(View): """ 代码提交的处理 """ def post(self, request): user_answer = request.POST.get("code", "") program_id = request.POST.get("program_id", "") print(user_answer) program_question = ProgramQuestion.objects.get(id=int(program_id)) if program_question.result == user_answer: value = {"status": "success", "result": "ok"} else: value = {"status": "success", "result": "error"} return HttpResponse(json.dumps(value), content_type='application/json') class NextProgramView(View): """ 下一题 """ def post(self, request): this_question_num = request.POST.get("practice_num", 1) this_question_id = request.POST.get("practice_id", 1) result = request.POST.get("result", "") this_program = ProgramQuestion.objects.get(id=this_question_id) if int(result) == 1: print("答对本题") request.session['right_count_program'] = request.session.get('right_count_program', default=0) + 1 else: print("本题错误") l = request.session['error_program'] l.append(this_program.id) request.session['error_program'] = l value = {"status": "success"} print("session", request.session['right_count_program']) return HttpResponse(json.dumps(value), content_type='application/json') class ProgramCommitView(View): """ 编程题 """ def get(self, request, course_id, lesson_id, program_id): # program_file = ProgramQuestion.objects.get(course=int(course_id), lesson=int(lesson_id), id=int(program_id)) try: program_result = ProgramUpload.objects.get(programquestion_id=int(program_id), user=request.user) except ProgramUpload.DoesNotExist: program_result = ProgramUpload.objects.all() print(program_result) return render(request, 'program-commit.html', { # "program_file": program_file, "program_result": program_result, "program_id": program_id, }) class ProgramUploadView(View): """ 编程项目上传 """ def post(self, request): file_obj = request.FILES.get('file') image_obj = request.FILES.get('image') learned_obj = request.POST.get('learn') programId_obj = request.POST.get('programId') program = ProgramQuestion.objects.get(id=int(programId_obj)) # user = request.user if file_obj and image_obj: program_result = ProgramUpload() program_result.programquestion = program program_result.user = request.user program_result.upload = file_obj program_result.image = image_obj program_result.learned = learned_obj program_result.is_complete = True program_result.save() return HttpResponse('{"status":"success"}', content_type='application/json') else: return HttpResponse('{"status":"fail"}', content_type='application/json') class ProgramResultView(View): """ 编程题结果 """ def get(self, request, course_id, lesson_id): right_nums = request.session.get('right_count_program', default=0) user_errors = request.session.get('error_program', default=[]) errors = [] for error in user_errors: errors.append(ProgramQuestion.objects.get(id=int(error))) errors = list(set(errors)) print("right_nums:", right_nums) all_question_num = ProgramQuestion.objects.filter(lesson_id=int(lesson_id)).count() print("all_num:", all_question_num) right_rate = int(int(right_nums) / float(all_question_num) * 100) print(right_rate) lesson = Lesson.objects.get(id=lesson_id) course = Course.objects.get(id=course_id) return render(request, 'program_result.html', locals()) class PostView(View): def post(self, request): import time import os from programing import settings file_obj = request.FILES.get('file') image_obj = request.FILES.get('image') if file_obj: # 处理附件上传到方法 request_set = {} print('file--obj', file_obj) # user_home_dir = "upload/%s" % (request.user.userprofile.id) accessory_dir = settings.BASE_DIR if not os.path.isdir(accessory_dir): os.mkdir(accessory_dir) upload_file = "%s/%s" % (accessory_dir, file_obj.name) recv_size = 0 with open(upload_file, 'wb') as new_file: for chunk in file_obj.chunks(): new_file.write(chunk) order_id = time.strftime("%Y%m%d%H%M%S", time.localtime()) # cache.set(order_id, upload_file) return HttpResponse(order_id) class CompleteView(View): """ 关卡完成 """ def post(self, request): course_id = request.POST.get("course_id", 1) lesson_id = request.POST.get("lesson_id", 1) print(type(int(course_id)), int(course_id)) this_lesson = Lesson.objects.get(course_id=int(course_id), id=int(lesson_id)) print(this_lesson) this_lesson.pass_level = True last_level = Lesson.objects.filter(course=int(course_id)).last() print(last_level) choice_bank = ChoiceBank.objects.get(lesson=int(lesson_id)) print(choice_bank) program_question = ProgramQuestion.objects.get(lesson=int(lesson_id)) if choice_bank.is_complete == True and program_question.is_complete == True: if int(lesson_id) != last_level.id: next_level = Lesson.objects.filter(course=int(course_id)).order_by("-add_time")[int(lesson_id) + 1] print("next:", next_level) next_level.open_level = True this_lesson.pass_level = True this_lesson.save() next_level.save() else: this_lesson.pass_level = True this_lesson.save() value = {"status": "success", "msg": "已完成"} return HttpResponse(json.dumps(value), content_type='application/json') else: value = {"status": "fail", "msg": "你还没有完成全部任务"} return HttpResponse(json.dumps(value), content_type='application/json') # class ProjectShowView(View): # """ # 项目展示 # """ # # def get(self, request): # all_category = CourseCategory.objects.all() # # click_category = request.GET.get("category", "all") # click_course = request.GET.get("course", "all") # click_level = request.GET.get("level", "all") # all_level = Lesson.objects.filter(course__name=click_course) # # if click_category == "all": # print("category:", click_category) # all_project = ProgramUpload.objects.filter(is_show=True).order_by("-add_time") # all_course = Course.objects.filter() # else: # all_course = Course.objects.filter(coursecategory__category=click_category) # if click_course == "all": # # all_project = ProgramUpload.objects.filter(lesson__course__coursecategory__category=click_category, # is_show=True) # else: # if click_level == "all": # # all_project = ProgramUpload.objects.filter(lesson__course__coursecategory__category=click_category, # lesson__course__name=click_course, # is_show=True) # else: # # all_project = ProgramUpload.objects.filter(lesson__course__coursecategory__category=click_category, # lesson__course__name=click_course, # lesson__name=click_level, # is_show=True) # # 对课程进行分页 # try: # page = request.GET.get('page', 1) # except PageNotAnInteger: # page = 1 # # p = Paginator(all_project, 6, request=request) # projects = p.page(page) # # return render(request, "project_show.html", { # "all_category": all_category, # "click_category": click_category, # "all_course": all_course, # "click_course": click_course, # "all_level": all_level, # "click_level": click_level, # "projects": projects, # # }) # class ProjectResultView(View): # """ # 项目展示结果 # """ # # def get(self, request, lesson): # try: # program_result = ProgramUpload.objects.get(lesson__name=lesson, user=request.user) # except ProgramUpload.DoesNotExist: # program_result = ProgramUpload.objects.all() # print(program_result) # return render(request, "project_result.html", { # "program_result": program_result # }) class DownloadUrlView(View): """链接下载""" def post(self, request): course_id = request.POST.get("course_id", 1) lesson_id = request.POST.get("lesson_id", 1) type = request.POST.get("type", "") user_intergral = UserIntergral.objects.get(user=request.user) demand_intergral = IntergralDemand.objects.get(lesson_id=int(lesson_id), demand=type) if user_intergral.grade >= demand_intergral.intergral: user_intergral.grade = user_intergral.grade - demand_intergral.intergral user_intergral.save() demand_intergral.download_count += 1 demand_intergral.save() value = {"status": "success", "re_url": demand_intergral.url} return HttpResponse(json.dumps(value), content_type='application/json') else: value = {"status": "fail", "msg": "您的积分不足,请充值!"} return HttpResponse(json.dumps(value), content_type='application/json')
[ "44704708@qq.com" ]
44704708@qq.com
51930079a3309f6d30abe786051977a566ea742b
c9af07e4b045b897734f29ff1f8a211aa40d0822
/TextNook Assignment/reddit/blog/urls.py
2675016b19ebf5206ecfe6d1bc71d078d28d8538
[]
no_license
vinyasmusic/Projects
20294e89c2905d5b5c54d21edb06f3076948051a
2dd1c05267b86d069a1185cd843e8a4d2bdf6123
refs/heads/master
2020-04-06T04:04:53.532872
2017-01-14T05:06:59
2017-01-14T05:06:59
58,999,243
0
1
null
null
null
null
UTF-8
Python
false
false
257
py
from django.conf.urls import url from . import views from blog.views import PostListView urlpatterns = [ #url(r'^$', views.post_list, name='post_list'), url(r'^$',PostListView.as_view()) #url(r'^post/new/$', views.post_new, name='post_new'), ]
[ "vinyasmusic@gmail.com" ]
vinyasmusic@gmail.com
096bc1c7152955fc7efee92dc96b6923843848ec
ee41311a11a1c6baedafd9a914d5a1f8330fe8a9
/SANEF_LIVE/venv/Lib/site-packages/anaconda_navigator/widgets/tabs/tests/test_environments_tab.py
2e4d36bd2647c721b4161cbc2957d1664db066a3
[]
no_license
sethnanati/CodeRepoPython
2dffb7263620bd905bf694f348485d894a9513db
b55e66611d19b35e9926d1b1387320cf48e177c8
refs/heads/master
2023-07-07T11:16:12.958401
2021-02-13T10:09:48
2021-02-13T10:09:48
376,531,283
0
0
null
null
null
null
UTF-8
Python
false
false
3,911
py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2016-2017 Anaconda, Inc. # # May be copied and distributed freely only as part of an Anaconda or # Miniconda installation. # ----------------------------------------------------------------------------- """Tests for environments tab.""" # yapf: disable # Standard library imports import sys # Third party imports from qtpy.QtCore import Qt import pytest # Local imports from anaconda_navigator.api.conda_api import CondaAPI from anaconda_navigator.utils.fixtures import tmpfile, tmpfolder from anaconda_navigator.widgets.dialogs import MessageBoxError from anaconda_navigator.widgets.tabs.environments import EnvironmentsTab # yapf: enable tmpfile tmpfolder PY3 = sys.version_info >= (3, 4) xfail = pytest.mark.xfail @pytest.fixture() def env_tab(qtbot, tmpfile): widget = EnvironmentsTab() qtbot.addWidget(widget) widget.show() widget.setup_tab(metadata={}) widget.load_environment() with qtbot.waitSignal(widget.sig_status_updated) as blocker: blocker return widget, qtbot, tmpfile MessageBoxError.exec_ = lambda *args: True class TestEnvironmentsTab: def package_version(self, pkg, name='root'): api = CondaAPI() return api.package_version(name=name, pkg=pkg, build=True) def remove_env(self, widget): worker = widget.packages_widget.remove_environment( name='navigatortest' ) worker.communicate() # run create @xfail def test_bad_create(self, env_tab): # analysis:ignore widget, qtbot, tmpfile = env_tab with open(tmpfile, 'w') as f: raw = "name: navigatortest\ndependencies:\n- not-real=0.0.0=py36_0" f.write(raw) worker = widget.packages_widget.import_yaml( name="navigatortest", yaml=tmpfile ) with qtbot.waitSignal(widget.sig_error_popped_up, timeout=5000): with qtbot.waitSignal(worker.sig_finished, timeout=5000): worker.name = "navigatortest" worker.sig_finished.connect(widget._environment_created) @xfail def test_ipython_option(self, env_tab, tmpfolder): widget, qtbot, tmpfile = env_tab pyver = 'python={0}'.format(self.package_version('python')) self.remove_env(widget) worker = widget.packages_widget.create_environment( name='navigatortest', packages=[pyver] ) worker.name = 'navigatortest' worker.communicate() # run create widget._environment_created(worker, "", "") widget.menu_list.exec_ = lambda *args: True qtbot.mouseClick( widget.list_environments.currentItem().button_options, Qt.LeftButton ) is_action_enabled = widget.menu_list.actions()[2].isEnabled() assert not is_action_enabled worker = widget.packages_widget.api.conda_install( name='navigatortest', pkgs=['jupyter-core'] ) worker.communicate() qtbot.mouseClick( widget.list_environments.currentItem().button_options, Qt.LeftButton ) assert not widget.menu_list.actions()[2].isEnabled() worker = widget.packages_widget.api.conda_install( name='navigatortest', pkgs=['ipython'] ) worker.communicate() qtbot.mouseClick( widget.list_environments.currentItem().button_options, Qt.LeftButton ) assert widget.menu_list.actions()[2].isEnabled() worker = widget.packages_widget.remove_environment( name='navigatortest' ) worker.communicate() # run create self.remove_env(widget)
[ "adeyemiadenuga@gmail.com" ]
adeyemiadenuga@gmail.com
5d0d6f69f6660e6ef026a817f19eea6376397f45
e9f9c70bf80bf95db4d323cfc7a019c30c55e04c
/Sapient Challenge/SapientChallenge/EventGenerator.py
040d0ed83078d0bb143b393b819c1df66128dcef
[]
no_license
sidtandon2014/AnalyticsVidhya
1c19453e432147f0c75c636b995e0ce8e2d1c8d7
9e75578cb7edb0f552bd87da32021d17e9509a87
refs/heads/master
2021-06-24T03:52:28.880916
2020-12-16T14:55:36
2020-12-16T14:55:36
147,308,283
0
0
null
null
null
null
UTF-8
Python
false
false
2,307
py
from kafka import KafkaProducer, KafkaClient import csv import json import numpy as np import time from datetime import date import pdb class EventGenerator: def __init__(self,bootstrapServers,topicName): self.bootstrapServers = bootstrapServers self.topicName = topicName def readFile(self,filePath,indexRow = 0,secondsToAdd = 0): producer = KafkaProducer(bootstrap_servers=self.bootstrapServers) index = 0 with open(filePath, 'r',) as csvfile: #reader =csv.reader(csvfile,delimiter = ",") fieldNames = ["house_id","household_id","eventtimestamp","value","timestamp"] reader = csv.DictReader(csvfile, fieldNames,delimiter = ",") next(reader) for row in reader: if index >= indexRow: ts = (np.int(row["eventtimestamp"]) + secondsToAdd) #np.int(row["timestamp"]) row["timestamp"] = ts ts = ts * 1000 key = row["house_id"].encode('utf-8') value =json.dumps(row).encode('utf-8') pdb.set_trace() producer.send(self.topicName,value = value,key = key,timestamp_ms = ts) if index %1000 == 0: print("Index %i" % index) #time.sleep(.001) index = index + 1 def createTopic(self,brokers,topicName): client = KafkaClient(brokers) client.ensure_topic_exists(topic=topicName) brokerList = ["10.0.0.9","10.0.0.4","10.0.0.7"] file = "F:\Sid\Learnings\Data Scientist\Analytics Vidhya\Sapient Challenge\household.csv" topicName = "rawevents" eventGen = EventGenerator(brokerList,topicName) #eventGen.createTopic(brokerList,topicName) """ difference between Timestamp for 2018-07-10 09:19:09.607 and max timestamp (1380578340) in data is 150636009 """ secondsToAdd = 150635894 eventGen.readFile(file,indexRow=0,secondsToAdd=secondsToAdd) """ import csv file = "F:\Sid\Learnings\Data Scientist\Analytics Vidhya\Sapient Challenge\dummy.csv" with open(file) as csvfile: reader = csv.reader(csvfile,delimiter = "\t") for row in reader: print(",".join(row[1:])) """
[ "siddharth.tandon1@gmail.com" ]
siddharth.tandon1@gmail.com
39d1f1d061ba1a605ac99d665358afaa10fee6bb
ef61ee0178686a1e371836188f97ad982e4123b8
/local/data/data_prep_TOCFL.py
fe59ef09a6176dd50c8e124f41dc8429b5647335
[]
no_license
xiaoyeye1117/Chinese-ASR
17c138631da723a7163e00aca7ca2e34103f800f
be93ee6ab42f39e0f9c69b52b6acb4ec261ad4c9
refs/heads/master
2020-06-23T07:36:17.846508
2019-01-21T07:35:30
2019-01-21T07:35:30
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,015
py
import os,sys def main(tocfl_path,file_type): wavdir_path = os.path.join(tocfl_path,'wav') wavdir_path = os.path.abspath(wavdir_path) txt_path = os.path.join(tocfl_path,'txt') for filename in os.listdir(wavdir_path): wav_label = filename.split('.')[0] wav_path = os.path.join(wavdir_path,filename) txt_file = os.path.join(txt_path,wav_label+'.txt') txt = open(txt_file,'r',encoding='UTF-8').read() trans = txt.rstrip() #trans = ' '.join(list(trans)) if file_type == 'text': sys.path.append('local/data/tool/jieba-zh_TW') import jieba trans = ' '.join(jieba.cut(trans)) trans = trans.upper() print(wav_label,trans) elif file_type == 'wav.scp': print(wav_label,wav_path) elif file_type == 'utt2spk': print(wav_label, wav_label) if __name__ == '__main__': tocfl_path = sys.argv[1] file_type = sys.argv[2] main(tocfl_path,file_type)
[ "jacky84228@hotmail.com" ]
jacky84228@hotmail.com