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
1a6a6d190573f01bbf7d17a030aaa51dbe22656f
51dcd31096526bfa6aeae4baea9f0f45657c6623
/ocean/tests/util.py
dba4670d5424620103eed74a400c139a2532af16
[]
no_license
sopac/ocean-portal-docker
eba5de774e5a2b3e9b019440c39e7f0041715dd9
159aeba7143e66fdd9ed253de935407f898b4873
refs/heads/master
2021-01-20T08:07:58.698449
2017-09-10T09:24:04
2017-09-10T09:24:04
90,103,531
1
5
null
2017-12-13T03:30:45
2017-05-03T03:19:57
Python
UTF-8
Python
false
false
826
py
# # (c) 2012 Commonwealth of Australia # Australian Bureau of Meteorology, COSPPac COMP # All Rights Reserved # # Authors: Danielle Madeley <d.madeley@bom.gov.au> import os import os.path from glob import glob import pytest from ocean.config import get_server_config config = get_server_config() def clear_cache(product, filetype='*'): cachedir = config['outputDir'] s = os.path.join(cachedir, '%s*.%s' % (product, filetype)) for d in glob(s): try: os.unlink(d) except IOError: raise def unique(iterable): __tracebackhide__ = True vals = set() for i in iterable: if i in vals: return False vals.add(i) return True def get_file_from_url(url): bn = os.path.basename(url) return os.path.join(config['outputDir'], bn)
[ "sachindras@spc.int" ]
sachindras@spc.int
329c0354906ea7def69064595589467c698a674a
d2720ce687c6000b06255d51824770e0f91e04ca
/stepper.py
267c5e17ffb11e2af50b1bca497cfccc928eda5c
[]
no_license
patildayananda/Raspberry-Pi
92eae96579b599b23640f2c9431a31fded3c7ed4
835ace7b9d6843ef8697e6b8b6efe7cf44f29282
refs/heads/master
2021-06-02T00:48:11.897537
2016-08-17T06:39:05
2016-08-17T06:39:05
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,646
py
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) coil_A_1_pin = 24 # pink coil_A_2_pin = 23 # orange coil_B_1_pin = 4 # blue coil_B_2_pin = 17 # yellow # adjust if different StepCount = 8 Seq = range(0, StepCount) # seq size is of 8 Seq[0] = [0,1,0,0] Seq[1] = [0,1,0,1] Seq[2] = [0,0,0,1] # store value for steps Seq[3] = [1,0,0,1] Seq[4] = [1,0,0,0] Seq[5] = [1,0,1,0] Seq[6] = [0,0,1,0] Seq[7] = [0,1,1,0] GPIO.setup(enable_pin, GPIO.OUT) GPIO.setup(coil_A_1_pin, GPIO.OUT) GPIO.setup(coil_A_2_pin, GPIO.OUT) GPIO.setup(coil_B_1_pin, GPIO.OUT) GPIO.setup(coil_B_2_pin, GPIO.OUT) GPIO.output(enable_pin, 1) def setStep(w1, w2, w3, w4): GPIO.output(coil_A_1_pin, w1) GPIO.output(coil_A_2_pin, w2) GPIO.output(coil_B_1_pin, w3) GPIO.output(coil_B_2_pin, w4) def forward(delay, steps): for i in range(steps): for j in range(StepCount): # access the seq. list one by one(0-7) setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3]) time.sleep(delay) def backwards(delay, steps): for i in range(steps): for j in reversed(range(StepCount)): # access the seq. list one by one(7-0) setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3]) time.sleep(delay) if __name__ == '__main__': while True: delay = raw_input("Time Delay (ms)?") steps = raw_input("How many steps forward? ") forward(int(delay) / 1000.0, int(steps)) #function call for f/w steps = raw_input("How many steps backwards? ") backwards(int(delay) / 1000.0, int(steps)) #function call for b/w
[ "noreply@github.com" ]
patildayananda.noreply@github.com
01673d7cfb58ab7724853b1300c74cb91d74ff39
392768f9038b6ed5752e3ce0a2fd1400da90d2e0
/14_List.py
9a3354e2e7c70b3c30d981a471af7a28a8c1a616
[]
no_license
msbhosale/python_workshop
0816566ed3a37a5f6a26351f70291155b4122595
7403aacda74cf5c7199875067d6d0ce587017424
refs/heads/master
2020-05-03T21:30:38.944051
2019-04-03T07:13:52
2019-04-03T07:13:52
178,824,983
0
0
null
null
null
null
UTF-8
Python
false
false
515
py
my_list = [15,"Jay",False,2.15,"KK"] my_list[0] = 56 print(my_list) # for item in my_list: # print(item) # my_list.append("Lunch") # print(my_list) # length_of_my_list = len(my_list) # print(length_of_my_list) # print(my_list[2:]) # for i in range(0,length_of_my_list): # print(my_list[i]) # x = numbers[0] # y = numbers[1] x,y = numbers = [15,20] print(f"X : {x}, Y : {y}") # Swapping of numbers using unpacking a = 15 b = 364 b, a = a , b print(a,b)
[ "noreply@github.com" ]
msbhosale.noreply@github.com
ec1e5dbc338ecf43d1bd53ded885b1450fb0c5be
da570c2047d335b3553e63c27ac7f60b57b28b7e
/images/urls.py
6c3df5aaf6b9ca607cd5fbcabe80ae605ee575b6
[ "MIT" ]
permissive
mfannick/viewImages
8c799fc52566de03f4909d36f5ccc50e7fff9564
27e447faff455fba306ef3e677d5f2f63160065e
refs/heads/master
2021-09-09T11:53:42.786004
2019-10-14T09:21:16
2019-10-14T09:21:16
214,357,014
0
0
null
2021-09-08T01:21:15
2019-10-11T06:11:06
Python
UTF-8
Python
false
false
425
py
from django.conf.urls import url from . import views from django.conf import settings from django.conf.urls.static import static urlpatterns=[ url('^$' ,views.homePage,name='homePage'), url(r'^search/', views.searchImageByCategory, name='searchImageByCategory'), url(r'^description/(\d+)',views.imageDescription,name='imageDescription') ] urlpatterns+=static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
[ "mfannick1@gmail.com" ]
mfannick1@gmail.com
3c1e2609185afba2ced84ebd4fc0350d03478685
a0fe82f6134fa6f0423d95116ffb5c4a15f6a299
/Eduspace/student/views/student.py
fb79a9c91e56322d53d0a27a17ea7dff2f19beb9
[]
no_license
akshaykrsinghal/demorepository
bdc8bc81b4944ba2effcafc8f108a335a27fce4b
b845150740a4e7127718e2265c5e55d60b1c11c6
refs/heads/master
2022-12-19T17:07:38.027458
2020-10-10T10:37:46
2020-10-10T10:37:46
302,876,650
0
0
null
null
null
null
UTF-8
Python
false
false
349
py
from django.http import HttpResponseRedirect from django.shortcuts import render, redirect from ..models import * def student(request): a=request.session['rollno'] # image=user.objects.filter(rollno=a) image=user.objects.filter(rollno=a) data={'images':image} print(image) return render(request,'dashboard.html',data)
[ "59149089+Akshaykumarsinghal@users.noreply.github.com" ]
59149089+Akshaykumarsinghal@users.noreply.github.com
d3059af279cb484debf3bea11242351e608798c6
cba86fc39209a9bb273ed9a8f1620068909578c1
/刘美宁/Python+Appium/test/app.py
3aa531b550b0e630a1cf82fc4e5102f78a71ca31
[]
no_license
fengrao1/practice
c2303b7ca71e38f0029a251d2b9842384a856eb8
701f5d910ec39d6f575f219bf7c8f53f94b98c82
refs/heads/master
2022-11-06T05:34:13.782766
2020-06-07T02:25:51
2020-06-07T02:25:51
258,391,682
1
0
null
null
null
null
UTF-8
Python
false
false
716
py
from appium import webdriver from appium.webdriver.webdriver import WebDriver from page.login_page import LoginPage #初始化driver,关闭driver class App(): driver:WebDriver=None @classmethod def start(cls): cap = {"platformName": "Android", "deviceName": "8KE5T19B11004244", "appPackage": "com.example.lenovo.enjoyball", "appActivity": "com.example.lenovo.Activity.LoginActivity", "noReset": True } cls.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", cap) cls.driver.implicitly_wait(10) return LoginPage(cls.driver) @classmethod def quit(cls): cls.driver.quit()
[ "2996331661@qq.com" ]
2996331661@qq.com
0c537c7a76a12d5ad4b319e5ecd8695d74b3b0f6
5c5458622ab8413fef8ab11ef5e09dcdcd42ff69
/1.py
ad47b2fba1e02ef70d242917fbf7c8954a6efe8d
[]
no_license
zhenyakeg/Console
127fbbfe33cf86a0e4d5eb968c783407168364f5
31eea7a22a95701049872d4da2c01307f05e920d
refs/heads/master
2021-01-13T10:06:17.797796
2016-10-27T17:59:03
2016-10-27T17:59:03
72,119,199
0
0
null
null
null
null
UTF-8
Python
false
false
218
py
__author__ = 'student' # импортируем модуль import sys # выводим на экран список всех аргументов s=0 for arg in sys.argv: if len(arg) == 3: s+=1 print (s)
[ "egor.rozinskiy@mail.ru" ]
egor.rozinskiy@mail.ru
54bb0c609bfe5631ed4693791271a60989565bef
e918334824eb32c1c8b365a2821c6676eb66b25c
/manhattan_graph.py
e02881545614b0f22edbcffbef9fcd987efcfded
[]
no_license
brianramaswami/SearchingAlgorithms
b4fb32f9f84d0866c6ab89a96d1785921821b3ab
5bb95ce31ac8d5602a6abc2df472858c2a6610ed
refs/heads/master
2022-01-30T06:34:07.861678
2019-07-20T22:48:18
2019-07-20T22:48:18
197,987,239
1
0
null
null
null
null
UTF-8
Python
false
false
7,668
py
class graph_vertex: def __init__(self, name, x, y): self.name = name self.position = (x, y) def __lt__(self, other): return self.name < other.name thirty_third_and_madison = graph_vertex("33rd Street and Madison Avenue", 33, 4) thirty_third_and_fifth = graph_vertex("33rd Street and 5th Avenue", 33, 5) manhattan_mall = graph_vertex("Manhattan Mall", 33, 6) penn_station = graph_vertex('Penn Station', 33, 7) thirty_fourth_and_madison = graph_vertex("34th Street and Madison Avenue", 34, 4) empire_state_building = graph_vertex('Empire State Building', 34, 5) herald_square = graph_vertex('Herald Square', 34, 6) thirty_fourth_and_seventh = graph_vertex("34th Street and 7th Avenue", 34, 7) thirty_fifth_and_madison = graph_vertex("35th Street and Madison Avenue", 35, 4) cuny_grad_center = graph_vertex("CUNY Graduate Center", 35, 5) thirty_fifth_and_sixth = graph_vertex("35th Street and 6th Avenue", 35, 6) macys = graph_vertex("Macy's", 35, 7) thirty_sixth_and_madison = graph_vertex("36th Street and Madison Avenue", 36, 4) thirty_sixth_and_fifth = graph_vertex("36th Street and 5th Avenue", 36, 5) thirty_sixth_and_sixth = graph_vertex("36th Street and 6th Avenue", 36, 6) thirty_sixth_and_seventh = graph_vertex("36th Street and 7th Avenue", 36, 7) morgan_library = graph_vertex("Morgan Library and Museum", 37, 4) thirty_seventh_and_fifth = graph_vertex("37th Street and 5th Avenue", 37, 5) thirty_seventh_and_sixth = graph_vertex("37th Street and 6th Avenue", 37, 6) thirty_seventh_and_seventh = graph_vertex("37th Street and 7th Avenue", 37, 7) thirty_eighth_and_madison = graph_vertex("38th Street and Madison Avenue", 38, 4) thirty_eighth_and_fifth = graph_vertex("38th Street and Fifth Avenue", 38, 5) thirty_eighth_and_sixth = graph_vertex("38th Street and Sixth Avenue", 38, 6) thirty_eighth_and_seventh = graph_vertex("38th Street and Seventh Avenue", 38, 7) mexican_consulate = graph_vertex("Mexican Consulate General", 39, 4) thirty_ninth_and_fifth = graph_vertex("39th Street and Fifth Avenue", 39, 5) thirty_ninth_and_sixth = graph_vertex("39th Street and Sixth Avenue", 39, 6) thirty_ninth_and_seventh = graph_vertex("39th Street and Seventh Avenue", 39, 7) fortieth_and_madison = graph_vertex("40th Street and Madison Avenue", 40, 4) fortieth_and_fifth = graph_vertex("40th Street and Fifth Avenue", 40, 5) bryant_park_south = graph_vertex("Bryant Park South", 40, 6) times_square_south = graph_vertex("Times Square - South", 40, 7) forty_first_and_madison = graph_vertex("41st Street and Madison Avenue", 41, 4) mid_manhattan_library = graph_vertex("Mid-Manhattan Library", 41, 5) kinokuniya = graph_vertex("Kinokuniya", 41, 6) times_square = graph_vertex("Times Square", 41, 7) grand_central_station = graph_vertex("Grand Central Station", 42, 4) library = graph_vertex("New York Public Library", 42, 5) bryant_park_north = graph_vertex("Bryant Park North", 42, 6) times_square_north = graph_vertex("Times Square - North", 42, 7) manhattan_graph = { thirty_third_and_madison: set([(thirty_fourth_and_madison, 1), (thirty_third_and_fifth, 3)]), thirty_third_and_fifth: set([(thirty_third_and_madison, 3), (manhattan_mall, 3), (empire_state_building, 1)]), manhattan_mall: set([(thirty_third_and_fifth, 3), (penn_station, 3), (herald_square, 1)]), penn_station: set([(manhattan_mall, 3), (thirty_fourth_and_seventh, 1)]), thirty_fourth_and_madison: set([(thirty_third_and_madison, 1), (empire_state_building, 3), (thirty_fifth_and_madison, 1)]), empire_state_building: set([(thirty_fourth_and_madison, 3), (herald_square, 3), (thirty_third_and_fifth, 1), (cuny_grad_center, 1)]), herald_square: set([(empire_state_building, 3), (thirty_fourth_and_seventh, 3), (manhattan_mall, 1), (thirty_fifth_and_sixth, 1)]), thirty_fourth_and_seventh: set([(herald_square, 3), (macys, 1), (penn_station, 1)]), thirty_fifth_and_madison: set([(thirty_fourth_and_madison, 1), (thirty_sixth_and_madison, 1), (cuny_grad_center, 3)]), cuny_grad_center: set([(thirty_fifth_and_madison, 3), (thirty_fifth_and_sixth, 3), (empire_state_building, 1), (thirty_sixth_and_fifth, 1)]), thirty_fifth_and_sixth: set([(cuny_grad_center, 3), (macys, 3), (herald_square, 1), (thirty_sixth_and_sixth, 1)]), macys: set([(thirty_fifth_and_sixth, 3), (thirty_fourth_and_seventh, 1), (thirty_sixth_and_seventh, 1)]), thirty_sixth_and_madison: set([(thirty_sixth_and_fifth, 3), (thirty_fifth_and_madison, 1), (morgan_library, 1)]), thirty_sixth_and_fifth: set([(thirty_sixth_and_madison, 3), (thirty_sixth_and_sixth, 3), (cuny_grad_center, 1), (thirty_seventh_and_fifth, 1)]), thirty_sixth_and_sixth: set([(thirty_sixth_and_fifth, 3), (thirty_sixth_and_seventh, 3), (thirty_fifth_and_sixth, 1), (thirty_seventh_and_sixth, 1)]), thirty_sixth_and_seventh: set([(thirty_sixth_and_sixth, 3), (macys, 1), (thirty_seventh_and_seventh, 1)]), morgan_library: set([(thirty_seventh_and_fifth, 3), (thirty_sixth_and_madison, 1), (thirty_eighth_and_madison, 1)]), thirty_seventh_and_fifth: set([(morgan_library, 3), (thirty_seventh_and_sixth, 3), (thirty_sixth_and_fifth, 1), (thirty_eighth_and_fifth, 1)]), thirty_seventh_and_sixth: set([(thirty_seventh_and_fifth, 3), (thirty_seventh_and_seventh, 3), (thirty_sixth_and_sixth, 1)]), thirty_seventh_and_seventh: set([(thirty_seventh_and_sixth, 3), (thirty_sixth_and_seventh, 1), (thirty_eighth_and_seventh, 1)]), thirty_eighth_and_madison: set([(thirty_eighth_and_fifth, 3), (morgan_library, 1), (mexican_consulate, 1)]), thirty_eighth_and_fifth: set([(thirty_eighth_and_madison, 3), (thirty_eighth_and_sixth, 3), (thirty_seventh_and_fifth, 1), (thirty_ninth_and_fifth, 1)]), thirty_eighth_and_sixth: set([(thirty_eighth_and_fifth, 3), (thirty_eighth_and_seventh, 3), (thirty_seventh_and_sixth, 1), (thirty_ninth_and_sixth, 1)]), thirty_eighth_and_seventh: set([(thirty_eighth_and_sixth, 3), (thirty_seventh_and_seventh, 1), (thirty_ninth_and_seventh, 1)]), mexican_consulate: set([(thirty_ninth_and_fifth, 3), (thirty_eighth_and_madison, 1), (fortieth_and_madison, 1)]), thirty_ninth_and_fifth: set([(mexican_consulate, 3), (thirty_ninth_and_sixth, 3), (thirty_eighth_and_fifth, 1), (fortieth_and_fifth, 1)]), thirty_ninth_and_sixth: set([(thirty_ninth_and_fifth, 3), (thirty_ninth_and_seventh, 3), (thirty_eighth_and_sixth, 1), (bryant_park_south, 1)]), thirty_ninth_and_seventh: set([(thirty_ninth_and_sixth, 3), (thirty_eighth_and_seventh, 1), (times_square_south, 1)]), fortieth_and_madison: set([(fortieth_and_fifth, 3), (mexican_consulate, 1), (forty_first_and_madison, 1)]), fortieth_and_fifth: set([(fortieth_and_madison, 3), (bryant_park_south, 3), (thirty_ninth_and_fifth, 1)]), bryant_park_south: set([(fortieth_and_fifth, 3), (times_square_south, 3), (thirty_ninth_and_sixth, 1), (kinokuniya, 1)]), times_square_south: set([(bryant_park_south, 3), (times_square, 1), (thirty_ninth_and_seventh, 1)]), forty_first_and_madison: set([(fortieth_and_madison, 1), (grand_central_station, 1), (mid_manhattan_library, 3)]), mid_manhattan_library: set([(forty_first_and_madison, 3), (library, 1), (fortieth_and_fifth, 1)]), kinokuniya: set([(times_square, 3), (bryant_park_north, 1), (bryant_park_south, 1)]), times_square: set([(kinokuniya, 3), (times_square_north, 1), (times_square_south, 1)]), grand_central_station: set([(library, 3), (forty_first_and_madison, 1)]), library: set([(mid_manhattan_library, 1), (grand_central_station, 3), (bryant_park_north, 3)]), bryant_park_north: set([(library, 3), (times_square_north, 3), (bryant_park_south, 1)]), times_square_north: set([(times_square, 1), (bryant_park_north, 3)]) }
[ "brianramaswami@yahoo.com" ]
brianramaswami@yahoo.com
0365a71e6ddcbf5d739bd768676f3f793715d525
1799fe1d9dfcf5f9619a87a11f3fa6170e1864fc
/00998/test_maximum_binary_tree_ii.py
44cc467d9b38a539320c803e7bc639b674e44c3e
[]
no_license
SinCatGit/leetcode
5e52b49324d16a96de1ba4804e3d17569377e804
399e40e15cd64781a3cea295bf29467d2284d2ae
refs/heads/master
2021-07-05T18:51:46.018138
2020-04-25T04:06:48
2020-04-25T04:06:48
234,226,791
1
1
null
2021-04-20T19:17:43
2020-01-16T03:27:08
Python
UTF-8
Python
false
false
1,519
py
import unittest from maximum_binary_tree_ii import Solution, TreeNode class TestSolution(unittest.TestCase): def test_Calculate_Solution(self): solution = Solution() # 6 # / \ # 1 4 # / \ # 3 2 t25 = TreeNode(6) t21 = TreeNode(1) t24 = TreeNode(4) t23 = TreeNode(3) t26 = TreeNode(2) t25.left = t21 t25.right = t24 t24.left = t23 t24.right = t26 def dfs(r): if r.left: yield from dfs(r.left) yield r.val if r.right: yield from dfs(r.right) root = solution.insertIntoMaxTree(t25, 7) self.assertEqual([1, 6, 3, 4, 2, 7], [v for v in dfs(root)]) root = solution.insertIntoMaxTree(t25, 5) self.assertEqual([1, 6, 3, 4, 2, 5], [v for v in dfs(root)]) # 6 # / \ # 1 4 # / \ # 3 2 t25 = TreeNode(6) t21 = TreeNode(1) t24 = TreeNode(4) t23 = TreeNode(3) t26 = TreeNode(2) t25.left = t21 t25.right = t24 t24.left = t23 t24.right = t26 root = solution.insertIntoMaxTreeV01(t25, 7) self.assertEqual([1, 6, 3, 4, 2, 7], [v for v in dfs(root)]) root = solution.insertIntoMaxTreeV01(t25, 5) self.assertEqual([1, 6, 3, 4, 2, 5], [v for v in dfs(root)]) if __name__ == '__main__': unittest.main()
[ "sincat@126.com" ]
sincat@126.com
78556512deea6fa868b272820fdf67d59eb5298e
c459c724af99b09b30253909898827fe9c2d79cd
/Advent2017/Day/Day_24.py
c746812a9748f60002d82994b147c63d792d3627
[]
no_license
Rafq77/Advent2015
72f3e6cd598a057ed79c3a9d125898edff13182b
0acecb4982d46bdf63e4e35350e76da0a7196ce0
refs/heads/master
2021-01-10T16:07:57.911724
2019-09-10T18:36:05
2019-09-10T18:36:05
47,354,878
0
0
null
null
null
null
UTF-8
Python
false
false
1,258
py
fd = open("""../Resources/Day_24.txt""", 'r') src = fd.read() fd.close() lines = src.split('\n') print("Length: " + str(len(lines))) components = list() for each in lines: p1, p2 = each.split('/') components.append((int(p1), int(p2))) import itertools import collections components.sort() #for c in components: # print(c) def rec(tupList): #print(tupList) last = tupList[-1] candidates = list(filter(lambda x: x[0] == last[1] or x[1] == last[1], components)) for c in candidates: if c not in tupList and c[::-1] not in tupList: #if c not in tupList: tmp = tupList.copy() if c[1] == tmp[-1][1]: #rotate tmp.append(c[::-1]) else: tmp.append(c) yield tmp yield from rec(tmp) return tupList koth = 0 kothLen = 0 kothLenS = 0 for e in components: if e[0] == 0: l = list() l.append(e) for each in rec(l): #print(each) s = sum([sum(t) for t in each]) if s > koth: koth = s l = len(each) if l > kothLen: kothLen = l kothLenS = s
[ "sokol-77@wp.pl" ]
sokol-77@wp.pl
8c55b1b583c89eaaf63961ca00dde5c69b6b67c5
5e5799e0ccce7a72d514fbc76dcb0a2108013f18
/Textfile2DefDomGeom.py
710ab37655fe1cd3158b6347c04304f6a2e29644
[]
no_license
sourcery-ai-bot/dash
6d68937d225473d06a18ef64079a4b3717b5c12c
e1d1c3a601cd397d2508bfd4bb12bdb4e878cd9a
refs/heads/master
2023-03-07T17:15:39.174964
2011-03-01T17:11:21
2011-03-01T17:11:21
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,140
py
#!/usr/bin/env python # # Use doms.txt or nicknames.txt file to create a default-dom-geometry file and # print the result to sys.stdout # # URL: http://icecube.wisc.edu/~testdaq/database_files/nicknames.txt import sys from DefaultDomGeometry import DefaultDomGeometryReader, DomsTxtReader, \ NicknameReader if __name__ == "__main__": if len(sys.argv) < 2: raise SystemExit("Please specify a file to load!") if len(sys.argv) > 2: raise SystemExit("Too many command-line arguments!") if sys.argv[1].endswith("nicknames.txt"): newGeom = NicknameReader.parse(sys.argv[1]) elif sys.argv[1].endswith("doms.txt"): newGeom = DomsTxtReader.parse(sys.argv[1]) else: raise SystemExit("File must be 'nicknames.txt' or 'doms.txt'," + " not '%s'" % sys.argv[1]) oldDomGeom = DefaultDomGeometryReader.parse() # rewrite the 64-DOM strings to 60 DOM strings plus 32 DOM icetop hubs newGeom.rewrite(False) oldDomGeom.rewrite() oldDomGeom.mergeMissing(newGeom) # dump the new default-dom-geometry data to sys.stdout oldDomGeom.dump()
[ "dglo@icecube.wisc.edu" ]
dglo@icecube.wisc.edu
546d674261f3df935f47d76c22d816e02e5c5599
4e0ee2b68398a90b0986975f645350033a624558
/tests/onnx_resnet18/test_onnx_resnet18_int8.py
5c23ade3f33cd92e177415de06a1d717c36ea894
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
kindsenior/nngen
697b80b32cf2b33e7f2c64e4d1a27eb2d739b30c
301b19b35e50174d8abb1a757b061ae80cdfe612
refs/heads/master
2022-09-21T05:53:34.565461
2020-05-03T14:58:19
2020-05-03T14:58:19
269,007,213
0
0
Apache-2.0
2020-06-03T06:26:43
2020-06-03T06:26:42
null
UTF-8
Python
false
false
2,129
py
from __future__ import absolute_import from __future__ import print_function import os import sys # the next line can be removed after installation sys.path.insert(0, os.path.dirname(os.path.dirname( os.path.dirname(os.path.abspath(__file__))))) import nngen as ng import veriloggen import onnx_resnet18 act_dtype = ng.int8 weight_dtype = ng.int8 bias_dtype = ng.int16 scale_dtype = ng.int16 with_batchnorm = True disable_fusion = False conv2d_par_ich = 1 conv2d_par_och = 1 conv2d_par_col = 1 conv2d_par_row = 1 conv2d_concur_och = None conv2d_stationary = 'filter' pool_par = 1 elem_par = 1 chunk_size = 64 axi_datawidth = 32 def test(request, silent=True): veriloggen.reset() simtype = request.config.getoption('--sim') rslt = onnx_resnet18.run(act_dtype, weight_dtype, bias_dtype, scale_dtype, with_batchnorm, disable_fusion, conv2d_par_ich, conv2d_par_och, conv2d_par_col, conv2d_par_row, conv2d_concur_och, conv2d_stationary, pool_par, elem_par, chunk_size, axi_datawidth, silent, filename=None, simtype=simtype, outputfile=os.path.splitext(os.path.basename(__file__))[0] + '.out') verify_rslt = rslt.splitlines()[-1] assert(verify_rslt == '# verify: PASSED') if __name__ == '__main__': rslt = onnx_resnet18.run(act_dtype, weight_dtype, bias_dtype, scale_dtype, with_batchnorm, disable_fusion, conv2d_par_ich, conv2d_par_och, conv2d_par_col, conv2d_par_row, conv2d_concur_och, conv2d_stationary, pool_par, elem_par, chunk_size, axi_datawidth, silent=False, filename='tmp.v', outputfile=os.path.splitext(os.path.basename(__file__))[0] + '.out') print(rslt)
[ "shta.ky1018@gmail.com" ]
shta.ky1018@gmail.com
82bb97b65913316755124594969ad638d47401ba
657a0e7550540657f97ac3f7563054eb4da93651
/Boilermake2018/Lib/site-packages/chatterbot/logic/low_confidence.py
bb8ebfd230f6cde219dcb021a1575d6b17714cb8
[ "LicenseRef-scancode-unknown-license-reference", "CC0-1.0" ]
permissive
TejPatel98/voice_your_professional_email
faf4d2c104e12be61184638913ebe298893c5b37
9cc48f7bcd6576a6962711755e5d5d485832128c
refs/heads/master
2022-10-15T03:48:27.767445
2019-04-03T16:56:55
2019-04-03T16:56:55
179,291,180
0
1
CC0-1.0
2022-10-09T13:00:52
2019-04-03T13:01:50
Python
UTF-8
Python
false
false
1,930
py
from __future__ import unicode_literals from chatterbot.conversation import Statement from .best_match import BestMatch class LowConfidenceAdapter(BestMatch): """ Returns a default response with a high confidence when a high confidence response is not known. :kwargs: * *threshold* (``float``) -- The low confidence value that triggers this adapter. Defaults to 0.65. * *default_response* (``str``) or (``iterable``)-- The response returned by this logic adaper. * *response_selection_method* (``str``) or (``callable``) The a response selection method. Defaults to ``get_first_response``. """ def __init__(self, **kwargs): super(LowConfidenceAdapter, self).__init__(**kwargs) self.confidence_threshold = kwargs.get('threshold', 0.65) default_responses = kwargs.get( 'default_response', "I'm sorry, I do not understand." ) # Convert a single string into a list if isinstance(default_responses, str): default_responses = [ default_responses ] self.default_responses = [ Statement(text=default) for default in default_responses ] def process(self, input_statement): """ Return a default response with a high confidence if a high confidence response is not known. """ # Select the closest match to the input statement closest_match = self.get(input_statement) # Choose a response from the list of options response = self.select_response(input_statement, self.default_responses) # Confidence should be high only if it is less than the threshold if closest_match.confidence < self.confidence_threshold: response.confidence = 1 else: response.confidence = 0 return response
[ "tpa244@uky.edu" ]
tpa244@uky.edu
2395d2b12aae09a4d84ec5301df48e4ee082a499
c33e0ec5662dad35fae8e7f1c3638c728c6a626c
/diseno_naiandy.py
3bc3941b24c138dd26603fc26443b45b2b4ebff4
[]
no_license
Ivanjarv/NaiandyC
516445c5a860bfe8634ab6d6115a8eae3592e8d2
3fcfee7b7a51c5eac94d3f26bae6293ecd2ca340
refs/heads/main
2023-01-09T07:08:08.244458
2020-11-08T21:18:46
2020-11-08T21:18:46
311,152,796
0
0
null
null
null
null
UTF-8
Python
false
false
26,797
py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # # generated by wxGlade 1.0.0a8 on Sat Sep 26 14:14:55 2020 # import wx class Entry(wx.Panel): def __init__(self, *args, **kwds): kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) self.SetBackgroundColour(wx.Colour(255, 255, 255)) self.SetPos(True) sizer_1 = wx.BoxSizer(wx.HORIZONTAL) self.btm_img = wx.BitmapButton(self, wx.ID_ANY, wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/DATAnext.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_img.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_img.SetSize(self.btm_img.GetBestSize()) sizer_1.Add(self.btm_img, 0, 0, 0) self.text = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.BORDER_NONE) self.text.SetMinSize((101, 18)) sizer_1.Add(self.text, 1, wx.EXPAND, 0) self.SetSizer(sizer_1) sizer_1.Fit(self) self.Layout() self.Bind(wx.EVT_KILL_FOCUS, self.onkillfocus, self.text) self.Bind(wx.EVT_SET_FOCUS, self.onsetfocus, self.text) def onkillfocus(self, event): print("Event handler 'onkillfocus' not implemented!") event.Skip() def onsetfocus(self, event): print("Event handler 'onsetfocus' not implemented!") event.Skip() class BaseNainady(wx.Frame): def __init__(self, *args, **kwds): kwds["style"] = kwds.get("style", 0) | wx.BORDER_SIMPLE | wx.FRAME_FLOAT_ON_PARENT | wx.RESIZE_BORDER wx.Frame.__init__(self, *args, **kwds) self.SetSize((700, 396)) self.szprincipal = wx.BoxSizer(wx.VERTICAL) self.panelsup = wx.Panel(self, wx.ID_ANY) self.panelsup.SetBackgroundColour(wx.Colour(255, 255, 255)) self.szprincipal.Add(self.panelsup, 0, wx.EXPAND, 0) sizer_1 = wx.BoxSizer(wx.HORIZONTAL) self.szpu = wx.BoxSizer(wx.HORIZONTAL) sizer_1.Add(self.szpu, 1, wx.BOTTOM | wx.EXPAND | wx.TOP, 3) self.btm_firth = wx.BitmapButton(self.panelsup, wx.ID_ANY, wx.Bitmap("C:\\Users\\Dell\\Documents\\python\\Nainady App\\imagenes\\DATAfirst.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_firth.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_firth.SetSize(self.btm_firth.GetBestSize()) self.szpu.Add(self.btm_firth, 0, wx.ALL, 3) self.btm_previous = wx.BitmapButton(self.panelsup, wx.ID_ANY, wx.Bitmap("C:\\Users\\Dell\\Documents\\python\\Nainady App\\imagenes\\DATAprevious.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_previous.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_previous.SetSize(self.btm_previous.GetBestSize()) self.szpu.Add(self.btm_previous, 0, wx.ALL, 3) self.btm_next = wx.BitmapButton(self.panelsup, wx.ID_ANY, wx.Bitmap("C:\\Users\\Dell\\Documents\\python\\Nainady App\\imagenes\\DATAnext.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_next.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_next.SetSize(self.btm_next.GetBestSize()) self.szpu.Add(self.btm_next, 0, wx.ALL, 3) self.btm_last = wx.BitmapButton(self.panelsup, wx.ID_ANY, wx.Bitmap("C:\\Users\\Dell\\Documents\\python\\Nainady App\\imagenes\\DATAlast.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_last.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_last.SetSize(self.btm_last.GetBestSize()) self.szpu.Add(self.btm_last, 0, wx.ALL, 3) self.btm_print = wx.BitmapButton(self.panelsup, wx.ID_ANY, wx.Bitmap("C:\\Users\\Dell\\Documents\\python\\Nainady App\\imagenes\\impresora.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_print.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_print.SetSize(self.btm_print.GetBestSize()) self.szpu.Add(self.btm_print, 0, wx.ALL, 3) self.btm_save = wx.BitmapButton(self.panelsup, wx.ID_ANY, wx.Bitmap("C:\\Users\\Dell\\Documents\\python\\Nainady App\\imagenes\\pendrive.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_save.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_save.SetSize(self.btm_save.GetBestSize()) self.szpu.Add(self.btm_save, 0, wx.ALL, 3) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) sizer_1.Add(sizer_3, 0, wx.BOTTOM | wx.EXPAND | wx.TOP, 3) self.btm_minimizar = wx.BitmapButton(self.panelsup, wx.ID_ANY, wx.Bitmap("C:\\Users\\Dell\\Documents\\python\\Nainady App\\imagenes\\minimizar.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_minimizar.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_minimizar.SetSize(self.btm_minimizar.GetBestSize()) sizer_3.Add(self.btm_minimizar, 0, wx.ALL, 3) self.btm_maximizar = wx.BitmapButton(self.panelsup, wx.ID_ANY, wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/cubo.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_maximizar.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_maximizar.SetSize(self.btm_maximizar.GetBestSize()) sizer_3.Add(self.btm_maximizar, 0, wx.ALL, 3) self.btm_close = wx.BitmapButton(self.panelsup, wx.ID_ANY, wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/cerrar.png", wx.BITMAP_TYPE_ANY), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT) self.btm_close.SetBackgroundColour(wx.Colour(255, 255, 255)) self.btm_close.SetSize(self.btm_close.GetBestSize()) sizer_3.Add(self.btm_close, 0, wx.ALL, 3) self.szprincipal.Add((0, 0), 0, 0, 0) self.panelsup.SetSizer(sizer_1) self.SetSizer(self.szprincipal) self.Layout() self.Centre() self.Bind(wx.EVT_LEFT_DOWN, self.onleftdown, self.panelsup) self.Bind(wx.EVT_LEFT_UP, self.onleftup, self.panelsup) self.Bind(wx.EVT_MOTION, self.onmousemove, self.panelsup) self.Bind(wx.EVT_ENTER_WINDOW, self.btnonenter, self.btm_firth) self.Bind(wx.EVT_LEAVE_WINDOW, self.btnleavve, self.btm_firth) self.Bind(wx.EVT_ENTER_WINDOW, self.btnonenter, self.btm_previous) self.Bind(wx.EVT_LEAVE_WINDOW, self.btnleavve, self.btm_previous) self.Bind(wx.EVT_ENTER_WINDOW, self.btnonenter, self.btm_next) self.Bind(wx.EVT_LEAVE_WINDOW, self.btnleavve, self.btm_next) self.Bind(wx.EVT_ENTER_WINDOW, self.btnonenter, self.btm_last) self.Bind(wx.EVT_LEAVE_WINDOW, self.btnleavve, self.btm_last) self.Bind(wx.EVT_ENTER_WINDOW, self.btnonenter, self.btm_print) self.Bind(wx.EVT_LEAVE_WINDOW, self.btnleavve, self.btm_print) self.Bind(wx.EVT_ENTER_WINDOW, self.btnonenter, self.btm_save) self.Bind(wx.EVT_LEAVE_WINDOW, self.btnleavve, self.btm_save) self.Bind(wx.EVT_BUTTON, self.minimizar, self.btm_minimizar) self.Bind(wx.EVT_ENTER_WINDOW, self.btnonenterright, self.btm_minimizar) self.Bind(wx.EVT_LEAVE_WINDOW, self.btnleavveright, self.btm_minimizar) self.Bind(wx.EVT_BUTTON, self.maximizar, self.btm_maximizar) self.Bind(wx.EVT_ENTER_WINDOW, self.btnonenterright, self.btm_maximizar) self.Bind(wx.EVT_LEAVE_WINDOW, self.btnleavveright, self.btm_maximizar) self.Bind(wx.EVT_BUTTON, self.close, self.btm_close) self.Bind(wx.EVT_ENTER_WINDOW, self.btnonenterright, self.btm_close) self.Bind(wx.EVT_LEAVE_WINDOW, self.btnleavveright, self.btm_close) def onleftdown(self, event): print("Event handler 'onleftdown' not implemented!") event.Skip() def onleftup(self, event): print("Event handler 'onleftup' not implemented!") event.Skip() def onmousemove(self, event): print("Event handler 'onmousemove' not implemented!") event.Skip() def btnonenter(self, event): print("Event handler 'btnonenter' not implemented!") event.Skip() def btnleavve(self, event): print("Event handler 'btnleavve' not implemented!") event.Skip() def minimizar(self, event): print("Event handler 'minimizar' not implemented!") event.Skip() def btnonenterright(self, event): print("Event handler 'btnonenterright' not implemented!") event.Skip() def btnleavveright(self, event): print("Event handler 'btnleavveright' not implemented!") event.Skip() def maximizar(self, event): print("Event handler 'maximizar' not implemented!") event.Skip() def close(self, event): print("Event handler 'close' not implemented!") event.Skip() class MainWindows(wx.Frame): def __init__(self, *args, **kwds): kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.SetSize((800, 600)) self.SetTitle("Naiandy") # Menu Bar self.menubar = wx.MenuBar() wxglade_tmp_menu = wx.Menu() self.menubar.mregisto = wxglade_tmp_menu.Append(wx.ID_ANY, "&Registro\tCTRL-R", "Entreda de Diario") self.Bind(wx.EVT_MENU, self.onregistro, self.menubar.mregisto) self.menubar.mcxc = wxglade_tmp_menu.Append(wx.ID_ANY, "Cuenta por &Cobrar\tF1", "Factura a Cliente") self.Bind(wx.EVT_MENU, self.cuentaporcobrar, self.menubar.mcxc) self.menubar.mcxp = wxglade_tmp_menu.Append(wx.ID_ANY, "Cuenta por &Pagar\tF3", "Factura a Proveedor") self.Bind(wx.EVT_MENU, self.cuentaporpagar, self.menubar.mcxp) self.menubar.mrecibodemercancia = wxglade_tmp_menu.Append(wx.ID_ANY, "Recibo de &Mercancia\tCTRL-M", "Registro de Mercancia Recibida") self.Bind(wx.EVT_MENU, self.recibodemercancia, self.menubar.mrecibodemercancia) self.menubar.mcatalogodeuenta = wxglade_tmp_menu.Append(wx.ID_ANY, "C&atalogo de Cuenta\tCTRL-L", "Catalogo de Cuenta") self.Bind(wx.EVT_MENU, self.catalogodecuenta, self.menubar.mcatalogodeuenta) self.menubar.mcuenta = wxglade_tmp_menu.Append(wx.ID_ANY, "C&uenta\tCTRL-U", "Create Cueta") self.Bind(wx.EVT_MENU, self.cuenta, self.menubar.mcuenta) wxglade_tmp_menu.AppendSeparator() self.menubar.mbloquearapp = wxglade_tmp_menu.Append(wx.ID_ANY, "&Bloquear App\tCTRL-B", u"Bloque la Aplicación") self.Bind(wx.EVT_MENU, self.bloquearapp, self.menubar.mbloquearapp) self.menubar.mquit = wxglade_tmp_menu.Append(wx.ID_ANY, "&Quit\tCTRL-Q", u"Cierra la Applicación") self.Bind(wx.EVT_MENU, self.onquit, self.menubar.mquit) self.menubar.Append(wxglade_tmp_menu, "&Regitro") wxglade_tmp_menu = wx.Menu() wxglade_tmp_menu_sub = wx.Menu() self.menubar.mingreso = wxglade_tmp_menu_sub.Append(wx.ID_ANY, "&Ingeso Por...\tF2", "Recibo de Ingreso") self.Bind(wx.EVT_MENU, self.ingesopor, self.menubar.mingreso) self.menubar.mpagode = wxglade_tmp_menu_sub.Append(wx.ID_ANY, "&Pago de...\tF4", "Pagos") self.Bind(wx.EVT_MENU, self.pagode, self.menubar.mpagode) wxglade_tmp_menu_sub.AppendSeparator() self.menubar.mconciliaciones = wxglade_tmp_menu_sub.Append(wx.ID_ANY, "&Conciliaciones\tF5", "") self.Bind(wx.EVT_MENU, self.conciliaciones, self.menubar.mconciliaciones) wxglade_tmp_menu.Append(wx.ID_ANY, "&Banco", wxglade_tmp_menu_sub, "") item = wxglade_tmp_menu.Append(wx.ID_ANY, "Balanza de &Comprobacion", u"Balanza de Comprobaciòn") self.Bind(wx.EVT_MENU, self.balanza_de_comprobacion, item) wxglade_tmp_menu.AppendSeparator() wxglade_tmp_menu_sub = wx.Menu() self.menubar.balance_general = wxglade_tmp_menu_sub.Append(wx.ID_ANY, "&Balance General", "Genera el Balance General") self.Bind(wx.EVT_MENU, self.balance_general, self.menubar.balance_general) self.menubar.estado_de_resultado = wxglade_tmp_menu_sub.Append(wx.ID_ANY, "&Estado de Resultado", "Genera el Estado de Resultado") self.Bind(wx.EVT_MENU, self.estado_de_resultado, self.menubar.estado_de_resultado) self.menubar.flujo_de_efectivo = wxglade_tmp_menu_sub.Append(wx.ID_ANY, "&Flujo de Esfectivo", "Geenera el Estado de Flujo de Esfectivo") self.Bind(wx.EVT_MENU, self.flujo_de_efectivo, self.menubar.flujo_de_efectivo) wxglade_tmp_menu_sub_sub = wx.Menu() self.menubar.estado_de_capital = wxglade_tmp_menu_sub_sub.Append(wx.ID_ANY, "Estado de &Capita", "Genera el Estado de Capital") self.Bind(wx.EVT_MENU, self.Estado_de_capital, self.menubar.estado_de_capital) wxglade_tmp_menu_sub.Append(wx.ID_ANY, "&Otros Estado", wxglade_tmp_menu_sub_sub, "") wxglade_tmp_menu.Append(wx.ID_ANY, "&Estado Finacieros", wxglade_tmp_menu_sub, "") self.menubar.Append(wxglade_tmp_menu, "&Finanza") wxglade_tmp_menu = wx.Menu() self.menubar.mhabilitar = wxglade_tmp_menu.Append(wx.ID_ANY, "&Desabilitar Barrra de Herramienta\tCTRL-H", "Habilita o Desabilitar la Barra de Herramienta", wx.ITEM_CHECK) self.Bind(wx.EVT_MENU, self.habilitar, self.menubar.mhabilitar) self.menubar.Append(wxglade_tmp_menu, "&Habilitar") wxglade_tmp_menu = wx.Menu() self.menubar.itbis_en_compra = wxglade_tmp_menu.Append(wx.ID_ANY, "ITBIS en &Compra 606", "General el formulario 606") self.Bind(wx.EVT_MENU, self.itbis_en_compra, self.menubar.itbis_en_compra) self.menubar.itbis_en_venta = wxglade_tmp_menu.Append(wx.ID_ANY, "ITBIS en &Venta 607", "General el formulario 607") self.Bind(wx.EVT_MENU, self.itbis_en_venta, self.menubar.itbis_en_venta) self.menubar.Formulario_de_NCF_Nulo = wxglade_tmp_menu.Append(wx.ID_ANY, "&Formulario de NCF Nulo 608", "Genera el formulario 608") self.Bind(wx.EVT_MENU, self.Formulario_de_NCF_Nulo, self.menubar.Formulario_de_NCF_Nulo) self.menubar.itbis_en_aduana = wxglade_tmp_menu.Append(wx.ID_ANY, "ITBIS en &Aduana 609", "Genera elFormulario 609") self.Bind(wx.EVT_MENU, self.itbis_en_aduana, self.menubar.itbis_en_aduana) wxglade_tmp_menu.AppendSeparator() self.menubar.ir_dicisiete = wxglade_tmp_menu.Append(wx.ID_ANY, "IR-17", "Genera el formulario de IR-17") self.Bind(wx.EVT_MENU, self.ir_dicisiete, self.menubar.ir_dicisiete) self.menubar.ir_tres = wxglade_tmp_menu.Append(wx.ID_ANY, "IR-3", "Genera el Formulario IR-3") self.Bind(wx.EVT_MENU, self.ir_tres, self.menubar.ir_tres) self.menubar.Append(wxglade_tmp_menu, "&Impueto") wxglade_tmp_menu = wx.Menu() self.menubar.mcrearusuario = wxglade_tmp_menu.Append(wx.ID_ANY, "Cear &Usuario\tF10", "Crea un Nuevo Usuario") self.Bind(wx.EVT_MENU, self.crearusuario, self.menubar.mcrearusuario) self.menubar.mcxcempleado = wxglade_tmp_menu.Append(wx.ID_ANY, "&CXC EMPLEADO\tCTRL-C", "Crear Cuenta por Cobrar a Empleado") self.Bind(wx.EVT_MENU, self.oncxcempleado, self.menubar.mcxcempleado) self.menubar.mdescuento = wxglade_tmp_menu.Append(wx.ID_ANY, "&Decuento a Empleado\tCTRL-D", "Descueto a Empleado") self.Bind(wx.EVT_MENU, self.ondescuentoaempleado, self.menubar.mdescuento) wxglade_tmp_menu.AppendSeparator() wxglade_tmp_menu_sub = wx.Menu() self.menubar.magnadirempleado = wxglade_tmp_menu_sub.Append(wx.ID_ANY, u"&Añadir Empleado\tF6", "Regitrar en empleado ") self.Bind(wx.EVT_MENU, self.agnadirempleado, self.menubar.magnadirempleado) self.menubar.magnadirnomina = wxglade_tmp_menu_sub.Append(wx.ID_ANY, u"Añadir &Nomina\tF7", u"Añade Nomina") self.Bind(wx.EVT_MENU, self.agnomina, self.menubar.magnadirnomina) self.menubar.mimpuestonomina = wxglade_tmp_menu_sub.Append(wx.ID_ANY, "&Impuesto Nominales\tF8", "Configura los Impuestos Nominales") self.Bind(wx.EVT_MENU, self.impuestonomina, self.menubar.mimpuestonomina) wxglade_tmp_menu.Append(wx.ID_ANY, "&Nomina", wxglade_tmp_menu_sub, "") self.menubar.Append(wxglade_tmp_menu, "&Gestion") wxglade_tmp_menu = wx.Menu() self.menubar.mconfiguraciones = wxglade_tmp_menu.Append(wx.ID_ANY, "&Configuraciones Generales\tF12", "Configuraciones de la Aplicacion") self.Bind(wx.EVT_MENU, self.configuraciones, self.menubar.mconfiguraciones) self.menubar.Append(wxglade_tmp_menu, "&Configuraciones") self.macerca = wx.Menu() self.menubar.Append(self.macerca, "&Acerca...") self.SetMenuBar(self.menubar) # Menu Bar end self.statusbar = self.CreateStatusBar(1) self.statusbar.SetStatusWidths([-1]) # Tool Bar self.toolbar = wx.ToolBar(self, -1) tool = self.toolbar.AddTool(wx.ID_ANY, "Registro", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/notebook.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Entrada de Diario", "Abre el formulario para hacer una entada en el Libro Diario") self.Bind(wx.EVT_TOOL, self.onregistro, id=tool.GetId()) tool = self.toolbar.AddTool(wx.ID_ANY, "cxc", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/facturacion.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Cuenta por Cobrar", "Abrir formulario de Cuenta por Cobrar") self.Bind(wx.EVT_TOOL, self.cuentaporcobrar, id=tool.GetId()) tool = self.toolbar.AddTool(wx.ID_ANY, "ingreso", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/business-color_money-bag_icon-icons.com_53447.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Recibo de Ingreso", "Abril formulario de Recibo de Ingreso") self.Bind(wx.EVT_TOOL, self.resivodeingreso, id=tool.GetId()) tool = self.toolbar.AddTool(wx.ID_ANY, "cxp", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/receipt_106581.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Cuenta por Pagar", "Abrir formulario de Cuenta por Pagar") self.Bind(wx.EVT_TOOL, self.cuentaporpagar, id=tool.GetId()) tool = self.toolbar.AddTool(wx.ID_ANY, "pago", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/pay_cash_payment_money_dollar_bill_icon_143267.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Hacer Pagos", "Abril formulario de Pago a Proveedores") self.Bind(wx.EVT_TOOL, self.pagos, id=tool.GetId()) tool = self.toolbar.AddTool(wx.ID_ANY, "mercancia", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/task_calendar_timeline_plan_start_date_due_date_icon_142241.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Mercancia Recibida", "Abril formulario de Mercacia Recibida") self.Bind(wx.EVT_TOOL, self.mercanciaresibida, id=tool.GetId()) self.toolbar.AddSeparator() tool = self.toolbar.AddTool(wx.ID_ANY, "cuenta", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/expediente.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Crea una Cuenta", "Crea una Nueva Cuenta") self.Bind(wx.EVT_TOOL, self.cuenta, id=tool.GetId()) self.toolbar.AddSeparator() tool = self.toolbar.AddTool(wx.ID_ANY, "Bloquear", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/escudo.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, u"Bloque la Aplicación", u"Bloque la aplicación hasta que se introduzca la contraseña nuevamente") self.Bind(wx.EVT_TOOL, self.bloquear, id=tool.GetId()) tool = self.toolbar.AddTool(wx.ID_ANY, "salir", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/Exit.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, u"Cerrar Aplicación", u"Cierre de la Aplicación") self.Bind(wx.EVT_TOOL, self.close, id=tool.GetId()) self.SetToolBar(self.toolbar) self.toolbar.Realize() # Tool Bar end self.Layout() self.Centre() def onregistro(self, event): print("Event handler 'onregistro' not implemented!") event.Skip() def cuentaporcobrar(self, event): print("Event handler 'cuentaporcobrar' not implemented!") event.Skip() def cuentaporpagar(self, event): print("Event handler 'cuentaporpagar' not implemented!") event.Skip() def recibodemercancia(self, event): print("Event handler 'recibodemercancia' not implemented!") event.Skip() def catalogodecuenta(self, event): print("Event handler 'catalogodecuenta' not implemented!") event.Skip() def cuenta(self, event): print("Event handler 'cuenta' not implemented!") event.Skip() def bloquearapp(self, event): print("Event handler 'bloquearapp' not implemented!") event.Skip() def onquit(self, event): print("Event handler 'onquit' not implemented!") event.Skip() def ingesopor(self, event): print("Event handler 'ingesopor' not implemented!") event.Skip() def pagode(self, event): print("Event handler 'pagode' not implemented!") event.Skip() def conciliaciones(self, event): print("Event handler 'conciliaciones' not implemented!") event.Skip() def balanza_de_comprobacion(self, event): print("Event handler 'balanza_de_comprobacion' not implemented!") event.Skip() def balance_general(self, event): print("Event handler 'balance_general' not implemented!") event.Skip() def estado_de_resultado(self, event): print("Event handler 'estado_de_resultado' not implemented!") event.Skip() def flujo_de_efectivo(self, event): print("Event handler 'flujo_de_efectivo' not implemented!") event.Skip() def Estado_de_capital(self, event): print("Event handler 'Estado_de_capital' not implemented!") event.Skip() def habilitar(self, event): print("Event handler 'habilitar' not implemented!") event.Skip() def itbis_en_compra(self, event): print("Event handler 'itbis_en_compra' not implemented!") event.Skip() def itbis_en_venta(self, event): print("Event handler 'itbis_en_venta' not implemented!") event.Skip() def Formulario_de_NCF_Nulo(self, event): print("Event handler 'Formulario_de_NCF_Nulo' not implemented!") event.Skip() def itbis_en_aduana(self, event): print("Event handler 'itbis_en_aduana' not implemented!") event.Skip() def ir_dicisiete(self, event): print("Event handler 'ir_dicisiete' not implemented!") event.Skip() def ir_tres(self, event): print("Event handler 'ir_tres' not implemented!") event.Skip() def crearusuario(self, event): print("Event handler 'crearusuario' not implemented!") event.Skip() def oncxcempleado(self, event): print("Event handler 'oncxcempleado' not implemented!") event.Skip() def ondescuentoaempleado(self, event): print("Event handler 'ondescuentoaempleado' not implemented!") event.Skip() def agnadirempleado(self, event): print("Event handler 'agnadirempleado' not implemented!") event.Skip() def agnomina(self, event): print("Event handler 'agnomina' not implemented!") event.Skip() def impuestonomina(self, event): print("Event handler 'impuestonomina' not implemented!") event.Skip() def configuraciones(self, event): print("Event handler 'configuraciones' not implemented!") event.Skip() def acerca(self, event): print("Event handler 'acerca' not implemented!") event.Skip() def resivodeingreso(self, event): print("Event handler 'resivodeingreso' not implemented!") event.Skip() def pagos(self, event): print("Event handler 'pagos' not implemented!") event.Skip() def mercanciaresibida(self, event): print("Event handler 'mercanciaresibida' not implemented!") event.Skip() def bloquear(self, event): print("Event handler 'bloquear' not implemented!") event.Skip() def close(self, event): print("Event handler 'close' not implemented!") event.Skip() class MyFrame(wx.MDIParentFrame): def __init__(self, *args, **kwds): kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE wx.MDIChildFrame.__init__(self, *args, **kwds) self.SetSize((400, 294)) self.SetTitle("frame") # Menu Bar self.frame_menubar = wx.MenuBar() wxglade_tmp_menu = wx.Menu() item = wxglade_tmp_menu.Append(wx.ID_ANY, "&Open", "Abril Ventana") self.Bind(wx.EVT_MENU, self.open, item) self.frame_menubar.Append(wxglade_tmp_menu, "&File") self.SetMenuBar(self.frame_menubar) # Menu Bar end # Tool Bar self.frame_toolbar = wx.ToolBar(self, -1, style=wx.TB_DEFAULT_STYLE) tool = self.frame_toolbar.AddTool(wx.ID_ANY, "&open CTRL-O", wx.Bitmap("C:/Users/Dell/Documents/python/Nainady App/imagenes/business-color_money-bag_icon-icons.com_53447.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "Abril Ventana", "Abril Ventana") self.Bind(wx.EVT_TOOL, self.open, id=tool.GetId()) self.SetToolBar(self.frame_toolbar) self.frame_toolbar.Realize() # Tool Bar end self.Layout() self.Centre() def open(self, event): print("Event handler 'open' not implemented!") f = MyFrame1(self, -1, "juan") f.Show() event.Skip() class MyFrame1(wx.MDIChildFrame): def __init__(self, *args, **kwds): kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE wx.MDIChildFrame.__init__(self, *args, **kwds) self.SetSize((400, 300)) self.SetTitle("frame_1") self.panel_1 = wx.Panel(self, wx.ID_ANY) sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_1.Add((0, 0), 0, 0, 0) self.panel_1.SetSizer(sizer_1) self.Layout() class MyApp(wx.App): def OnInit(self): self.mainwindows = MainWindows(None, wx.ID_ANY, "") self.SetTopWindow(self.mainwindows) self.mainwindows.Show() return True if __name__ == "__main__": app = MyApp(0) app.MainLoop()
[ "jrvadez@gmail.com" ]
jrvadez@gmail.com
ed817dc1416c6f9ee3bd63420344cf905981be76
f8b77d8b7d90dabfa3b222116d9fe462d890e89b
/plans/fixed_ensemble_resnet_linear_4.py
53480a497b356b8478b73ceacb2478cfd372a96e
[ "BSD-2-Clause" ]
permissive
dbis-uibk/MediaEval2021
94e4041d6e82a28ceb95c68994808d0acc725915
14d754d9cea36415090aaa115db81f5ace465964
refs/heads/master
2023-08-27T19:12:17.758042
2021-11-03T12:12:57
2021-11-03T12:12:57
424,210,495
1
0
null
null
null
null
UTF-8
Python
false
false
1,196
py
"""Ensemble plan manually split by type moode/theme.""" import json from dbispipeline.evaluators import FixedSplitEvaluator from dbispipeline.evaluators import ModelCallbackWrapper import numpy as np from sklearn.pipeline import Pipeline from mediaeval2021 import common from mediaeval2021.dataloaders.melspectrograms import MelSpectPickleLoader from mediaeval2021.models.ensemble import Ensemble from mediaeval2021.models.wrapper import TorchWrapper dataloader = MelSpectPickleLoader('data/mediaeval2020/melspect_1366.pickle') label_splits = [ np.arange(0, 14, 1), np.arange(14, 28, 1), np.arange(28, 42, 1), np.arange(42, 56, 1), ] pipeline = Pipeline([ ('model', Ensemble( base_estimator=TorchWrapper( model_name='ResNet-18', dataloader=dataloader, batch_size=64, early_stopping=True, ), label_splits=label_splits, epochs=100, )), ]) evaluator = ModelCallbackWrapper( FixedSplitEvaluator(**common.fixed_split_params()), lambda model: common.store_prediction(model, dataloader), ) result_handlers = [ lambda results: print(json.dumps(results, indent=4)), ]
[ "mikevo-uibk@famv.net" ]
mikevo-uibk@famv.net
09d98803d9190b4e2b6db8953c989dbe125f17b9
77f794a8e2c915073f32b9278e7123b49af9b71f
/hm_12_列表的数据统计.py
84e6106b2aac6bcdc6269f43cfc6c01a3a7fe07a
[]
no_license
Chuxiaxia/python
5c1c1a3c511bce9bf527db151173f1a72742a024
b6408f2805bd890e09e1040a0b881bd3cddd4c0c
refs/heads/master
2020-04-24T09:33:05.746018
2019-02-21T13:40:20
2019-02-21T13:40:20
171,865,855
1
0
null
null
null
null
UTF-8
Python
false
false
438
py
name_list = ["Xey", "ajl", "安家樑", "Xey"] # len(length长度)函数可以统计列表中元素的总数 list_len = len(name_list) print("列表中包含%d个元素" % list_len) # count方法可以统计列表中某一个数据出现的次数 count = name_list.count("Xey") print("Xey出现了%d次" % count) # 从列表中删除第一次出现的数据,如果数据不存在程序会报错 name_list.remove("Xey") print(name_list)
[ "353091935@qq.com" ]
353091935@qq.com
1230bd8aea0ed2cf0e02c98811fd1bca3bac9353
e6d4a87dcf98e93bab92faa03f1b16253b728ac9
/algorithms/python/smallestGoodBase/smallestGoodBase.py
0fc48f86b09d916c4865349241f9dfd2a7f0a365
[]
no_license
MichelleZ/leetcode
b5a58e1822e3f6ef8021b29d9bc9aca3fd3d416f
a390adeeb71e997b3c1a56c479825d4adda07ef9
refs/heads/main
2023-03-06T08:16:54.891699
2023-02-26T07:17:47
2023-02-26T07:17:47
326,904,500
3
0
null
null
null
null
UTF-8
Python
false
false
843
py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Source: https://leetcode.com/problems/smallest-good-base/ # Author: Miao Zhang # Date: 2021-02-15 class Solution: def smallestGoodBase(self, n: str) -> str: num = int(n) # n = 1 + k + k^2+....k^(m - 1) # i:m for i in range(int(math.log(num + 1, 2)), 1, -1): # base k left = 2 right = pow(num, 1 / (i - 1)) + 1 while left < right: mid = int(left + (right - left) // 2) sums = 0 for j in range(i): sums = sums * mid + 1 if sums == num: return str(mid) elif sums < num: left = mid + 1 else: right = mid return str(num - 1)
[ "zhangdaxiaomiao@163.com" ]
zhangdaxiaomiao@163.com
2e75f2970a695204c2cad568f28caace7e93c6bf
4834c27030b42cd710e9fd19c25f882a690cc734
/tools/vis.py
09d5d20f7597cb6909cf963d32a6d2442baf8394
[ "MIT" ]
permissive
Muphys/ship_detection
c80d348bc8d541100b2b871f4f6fe945698c6563
9e6ce6a11c51843ebb877e471546f15438b09718
refs/heads/main
2023-01-21T09:25:53.275309
2020-12-04T08:44:12
2020-12-04T08:44:12
318,425,830
0
0
null
null
null
null
UTF-8
Python
false
false
2,072
py
import numpy as np import matplotlib.pyplot as plt # %matplotlib inline def get_data(str, tag): tmp = str.split(f"{tag}: ")[1].split(" ")[0] return float(tmp) if __name__ == '__main__': it = [] total_loss = [] loss_cls = [] loss_box_reg = [] loss_mask = [] loss_rpn_cls = [] loss_rpn_loc =[] lr=[] log_file = '../train/output_r50_200000_ROI512_augment/r50_200000_ROI512_augment.log' with open(log_file) as f: for line in f: if "eta" not in line: continue it.append(get_data(line, 'iter')) total_loss.append(get_data(line, 'total_loss')) loss_cls.append(get_data(line, 'loss_cls')) loss_box_reg.append(get_data(line, 'loss_box_reg')) loss_mask.append(get_data(line, 'loss_mask')) loss_rpn_cls.append(get_data(line, 'loss_rpn_cls')) loss_rpn_loc.append(get_data(line, 'loss_rpn_loc')) lr.append(get_data(line, 'lr')) fig = plt.figure(figsize=(8,6)) ax2 = fig.add_subplot(111) ax1 = ax2.twinx() ax1.plot(it, total_loss, color='red', label='total_loss') ax1.plot(it, loss_cls, color='purple', label='loss_cls') ax1.plot(it, loss_box_reg, color='blue', label='loss_box_reg') ax1.plot(it, loss_mask, color='orange', label='loss_mask') ax1.plot(it, loss_rpn_cls, color='olive', label='loss_rpn_cls') ax1.plot(it, loss_rpn_loc, color='green', label='loss_rpn_loc') #设置坐标轴范围 ax1.set_xlim((0,it[-1])) ax1.set_ylim((0,1)) # 设置坐标轴、图片名称 ax1.set_xlabel('iters') log_name = log_file.split('.log')[0].split('/')[-1] cfg = log_name.split('_') ax1.set_title(f'{cfg[-2]}_{cfg[-1]}') ax2.plot(it, lr, color='black', label='lr') ax2.set_ylim([0, max(lr)*1.1]) ax1.legend(loc='upper right') ax2.legend(loc='center right') ax1.set_ylabel('loss') ax2.set_ylabel('learning rate') plt.savefig('../train/output_r50_200000_ROI512_augment/'+ log_name + '.png') plt.show()
[ "971199215@qq.com" ]
971199215@qq.com
5d8e997cb1f97285a004ae94b1041e7d033ef71e
54e9710eb0e8da36d420acf1d74426aaad4a85d0
/main.py
c86a5c77f47f45b54cdad4eeb7a2a15b37425004
[]
no_license
syedhassanabbas347/ADM-HW3
2fc632c26f8afff8d612de15b86b046a5637a8eb
f455a4ed5f2e5c7571d80a73dd3e60abec39efcf
refs/heads/master
2020-09-03T20:09:50.679499
2019-11-17T22:58:06
2019-11-17T22:58:06
219,557,215
0
0
null
null
null
null
UTF-8
Python
false
false
6,360
py
#!/usr/bin/env python # coding: utf-8 # In[32]: import urllib.request from bs4 import BeautifulSoup import requests import csv import pandas as pd import json import collections import math # we write routines functions that will clean our data # In[44]: # we load the dictionnary we just created with open('dic1.json') as json_file: data = json.load(json_file) with open('dicvoc.json') as json_file: listemot = json.load(json_file) with open('dic2.json') as json_file: dicInverted = json.load(json_file) with open('listedoc2.json') as json_file: listedoc2 = json.load(json_file) with open('dicvoc.json') as json_file: listemot2 = json.load(json_file) with open('number_words_doc.json') as json_file: dic_words_doc = json.load(json_file) import import_ipynb from index_utils import preprocess from collector_utils1 import file_to_parse df = file_to_parse(3) # In[45]: def search_engine1(query): query = preprocess((query)) #we preprocess it listedocuments = [] tfidf_query = collections.Counter(query) #turn our query into a dictionnary (key = word, value = occurence) for key in tfidf_query.keys(): if key not in listemot2: print("Word(s) in your query does not exist") return for element in query: # we preprocess the query, and we iterring into the words if element in listemot: #we check if the word is in the list of words i = listemot.index(element) # we get the index of the word listedocuments.append(data[str(i)]) # we go into the dictionnary to get the documents that contain the word #we do the intersection of all the list to get the document that contain all the word of the query result = list(set(listedocuments[0]).intersection(*listedocuments[:len(listedocuments)])) if len(result) == 0: print('No document contains all your words') return listetitle = [] listeintro = [] listeurl = [] for element in result: #element is a number of tsv document with open(r'C:\Users\danyl\OneDrive\Documents\tsv\document_'+element+'.tsv', encoding = 'utf8') as tsvfile: reader = csv.reader(tsvfile, delimiter='\t') for row in reader: if len(row)>0: a = row[0] #we get the title b = row[1] #get the intro listetitle.append(a) listeintro.append(b) listeurl.append(df.iloc[int(element)][0]) #we get the url using the dataframe of the beginning dfresult = pd.DataFrame(list(zip(listetitle, listeintro,listeurl)), columns =['Title', 'Intro', 'URL']) #we group the result in a dataframe return(dfresult) def search_engine_2(query): query = preprocess((query)) #we preprocess it listedocuments = [] tfidf_query = collections.Counter(query) #turn our query into a dictionnary (key = word, value = occurence) for key in tfidf_query.keys(): if key not in listemot2: print("Word(s) in your query does not exist") return for key,values in tfidf_query.items(): tf = values/len(query) #for each word in the query we calculate the tf-idf tfidf_query[key] = tf*(1+math.log(float(29981/len(dicInverted[str(listemot2.index(key))])))) # as we have done in the first part, we get the documents that contains all we words of the query listedocuments = [] for element in query: if element in listemot2: i = listemot2.index(element) listedocuments.append(dicInverted[str(i)].keys()) results = list(set(listedocuments[0]).intersection(*listedocuments[:len(listedocuments)])) if len(results) == 0: print('No document contains all your words') return #we create a dictionnary (key = document, value = dictionnary (key = words in query, value = tf-idf)) dic_final = {} for result in results : dic_result = {} for element in query: i = listemot2.index(element) dic_result[element] = dicInverted[str(i)][str(result)] dic_final[result] = dic_result # we compute the cosine similary which is just a formula, using the tf-idf of each word with respect to the documents, and the tf-idf of the query dic_cosine = {} for keys, values in dic_final.items(): dot_prod = 0 norm_query = 0 norm_doc = 0 for key in tfidf_query.keys(): dot_prod = dot_prod + values[key] * tfidf_query[key] norm_query = norm_query + tfidf_query[key]**2 norm_doc = norm_doc + values[key]**2 norm_query = math.sqrt(norm_query) norm_doc = math.sqrt(norm_doc) cosine_similarity = dot_prod/(norm_query*norm_doc) dic_cosine[keys] = cosine_similarity #we store the cosine_similarity of each document with the query in a dictionnary (key = document, value = cosine_similarity pd.options.display.max_colwidth = 50 #we compute the same code we used in the first part listetitle = [] listeintro = [] listeurl = [] listecosine = [] for element in results: with open(r'C:\Users\danyl\OneDrive\Documents\tsv\document_'+element+'.tsv', encoding = 'utf8') as tsvfile: reader = csv.reader(tsvfile, delimiter='\t') for row in reader: if len(row)>0: a = row[0] b = row[1] listetitle.append(a) listeintro.append(b) listeurl.append(df.iloc[int(element)][0]) listecosine.append(round(dic_cosine[element],2)) #we just add the calcul of the cosine similarity of each document dfresult = pd.DataFrame(list(zip(listetitle, listeintro,listeurl,listecosine)), columns =['Title', 'Intro', 'URL','Similarity']) dfresult = dfresult.sort_values(by=['Similarity'], ascending = False) return(dfresult) # In[46]: nbr = int(input("Choose the search engine (1 or 2)")) query = str(input("Enter your query")) if nbr == 1: result = search_engine1(query) else: result = search_engine_2(query) result # In[ ]:
[ "noreply@github.com" ]
syedhassanabbas347.noreply@github.com
a99d095a7e339d7dba315704bd84f046d2fd11f5
2a10ec3bc377beb0bfb0998b02ce2a0fab98ede0
/venv/Scripts/pip3-script.py
20403cd6bd20f168b34ece56f0949e0072b33b9d
[ "ISC", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "Zlib", "LicenseRef-scancode-openssl", "LicenseRef-scancode-ssleay-windows", "BSD-3-Clause", "OpenSSL", "MIT" ]
permissive
bopopescu/StockMarketGame
6a3dd8d22c23a9dafef6415000df1acd4d751923
48e777e1bda31c663c40fe18ff3229eeb2257b46
refs/heads/master
2022-11-22T10:08:18.542410
2019-11-10T01:54:43
2019-11-10T01:54:43
281,805,787
0
0
null
2020-07-22T23:42:10
2020-07-22T23:42:10
null
UTF-8
Python
false
false
424
py
#!C:\Users\estigum\Documents\GitHub\StockMarketGame\venv\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3' __requires__ = 'pip==10.0.1' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')() )
[ "estigum@gmail.com" ]
estigum@gmail.com
ad03fec15fe1915e7eea4a6164a1ec3c19cc4515
12373d8a1dacbd7eb87d3af22d7f80b0cab7712e
/store_locator/asgi.py
c5389502121bb5c911bc96f3c8561a58fc320ac5
[]
no_license
mayurbiw/store_locator
e1672149a8bfd2751801919cde6e93ebcf9611ba
afec4b3dfc7db40731c8e39a288d9c60f9e5db39
refs/heads/main
2023-01-30T23:50:30.487494
2020-12-18T16:38:43
2020-12-18T16:38:43
319,128,325
0
0
null
null
null
null
UTF-8
Python
false
false
403
py
""" ASGI config for store_locator project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'store_locator.settings') application = get_asgi_application()
[ "mayurbiw@gmail.com" ]
mayurbiw@gmail.com
b454e42a2bc91d38dbdb4c2052da1a603fdaf6db
4f026ddcf8f058d884f15259f0e42c2178eb2157
/clare/clare/application/factories.py
0dadccd763c699f4a366d61970db657bafff708f
[ "MIT" ]
permissive
dnguyen0304/roomlistwatcher
afd95e5f601f77fc8d7c4cd4307e60f36b53162c
7ac4d5172de22dd8906662da521995c8e06c2617
refs/heads/master
2021-01-20T22:55:04.289589
2017-11-16T04:09:49
2017-11-16T04:09:49
101,829,306
0
0
null
2017-11-16T04:09:49
2017-08-30T02:38:56
Python
UTF-8
Python
false
false
2,677
py
# -*- coding: utf-8 -*- import Queue import os import threading import uuid from . import applications from . import download_bot from . import room_list_watcher class Application(object): def __init__(self, infrastructure, properties): """ Parameters ---------- infrastructure : clare.infrastructure.infrastructures.ApplicationInfrastructure properties : collections.Mapping """ self._infrastructure = infrastructure self._properties = properties def create(self): """ Returns ------- clare.application.applications.Application """ queue = Queue.Queue() # Construct the room list watcher. room_list_watcher_factory = room_list_watcher.factories.Producer( infrastructure=self._infrastructure.room_list_watcher, properties=self._properties['room_list_watcher']) room_list_watcher_ = room_list_watcher_factory.create() # Include threading. kwargs = { 'interval': self._properties['room_list_watcher']['interval'] } room_list_watcher_ = threading.Thread(name='room_list_watcher', target=room_list_watcher_.produce, kwargs=kwargs) room_list_watcher_.daemon = True # Construct the download bot. download_bot_factory = download_bot.factories.Factory( queue=queue, properties=self._properties['download_bot']) directory_path = os.path.join( self._properties['download_bot']['factory']['root_directory_path'], str(uuid.uuid4())) download_bot_ = download_bot_factory.create( download_directory_path=directory_path) # Include threading. kwargs = { 'interval': self._properties['download_bot']['interval'], 'timeout': self._properties['download_bot']['timeout'] } download_bot_ = threading.Thread(name='download_bot', target=download_bot_.consume, kwargs=kwargs) download_bot_.daemon = True # Construct the application. application = applications.Application( room_list_watcher=room_list_watcher_, download_bot=download_bot_) return application def __repr__(self): repr_ = '{}(infrastructure={}, properties={})' return repr_.format(self.__class__.__name__, self._infrastructure, self._properties)
[ "dnguyen0304@gmail.com" ]
dnguyen0304@gmail.com
455f0eb252681dc48ed0c75166d18be7a3427598
d518877677fc47ec794bd52c874975ad05e35aba
/6.24/队列列表实现.py
72f7e5a091981d78b4988c7b0c0c2f2f49d8e222
[]
no_license
lulu-yaya/ds
ea0bfa5c9a612ecf2aefe74ddefb30b4fc2e3d16
b4353d11b21651d0f71922e41f0474fac4219b5d
refs/heads/master
2022-11-10T19:31:40.567789
2020-06-26T10:01:42
2020-06-26T10:01:42
275,071,405
0
0
null
null
null
null
UTF-8
Python
false
false
681
py
class Queue: def __init__(self): self.enteries=[] self.length=0 self.front=0 def __str__(self): printed="<"+str(self.enteries)[1:-1]+">" return printed # 入队 def put(self,item): self.enteries.append(item) self.length +=1 # 出队,先进先出 def get(self): self.length=self.length-1 dequeued=self.enteries[self.front] self.enteries=self.enteries[1:] return dequeued def front(self): return self.enteries[0] def size(self): return self.length q=Queue() q.put(1) q.put(2) q.put(5) print(q) q.get() print(q) print(q.front) print(q.size())
[ "1319040466@qq.com" ]
1319040466@qq.com
3c23686db6886c323c64f68a9b984e0c008fc6a3
1383830de3ffb5cd88d82a124da502d0a4145a4e
/ANN-Lab2/CompLearning2D.py
906832a5177072a02e6f89efff4d6365e6875315
[]
no_license
ayoubbargach/ANN-Examples
5f835659d08235635809aef525b7e35181dcab57
bdbdd0188b6c641a9ef942b09e5e7854426d1f15
refs/heads/master
2020-04-02T03:59:52.841409
2018-10-21T10:07:52
2018-10-21T10:07:52
153,994,500
0
0
null
null
null
null
UTF-8
Python
false
false
9,207
py
import math import random import numpy as np import matplotlib.pyplot as plt import argparse from sklearn.neural_network import MLPRegressor np.set_printoptions(threshold=np.nan) #Always print the whole matrix def CL(RBF_Nodes, input_pattern, leaky = False): iters = 1000 cl_learning_rate = 0.25 for _ in range (0, iters): # pick random training vector i = random.randint(0, len(input_pattern) - 1) training_vector = np.asarray((input_pattern[i][0], input_pattern[i][1])) # find closest rbf_node closest_node = None second_closest_node = None closest_distance = float('inf') for node in RBF_Nodes: npNode = np.asarray((node.x, node.y)) distance = np.linalg.norm(training_vector - npNode) if distance < closest_distance: second_closest_node = closest_node closest_distance = distance closest_node = node if closest_node == None: continue # move closest rbf_node closer to traning vector, dw = eta(x - w) delta_node = cl_learning_rate * (training_vector - np.asarray((closest_node.x, closest_node.y))) closest_node.x += delta_node[0] closest_node.y += delta_node[1] # consider strategy for dead units (e.g., leaky cl) if leaky: leaky_learning_rate = 0.1 ''' if second_closest_node == None: continue #second_winner = RBF_Nodes[random.randint(0, len(RBF_Nodes) - 1)] second_winner = second_closest_node second_delta_node = leaky_learning_rate * (training_vector - np.asarray((second_winner.x, second_winner.y))) second_winner.x += second_delta_node[0] second_winner.y += second_delta_node[1] ''' for node in RBF_Nodes: if node != closest_node: # use gauss function to limit how leaky it is, nodes further away are less affected gauss_factor = transfer_function(training_vector, node, 0.05) delta_node = gauss_factor * leaky_learning_rate * (training_vector - np.asarray((node.x, node.y))) node.x += delta_node[0] node.y += delta_node[1] def adjust_widths(RBF_Nodes): for i in range(0, len(RBF_Nodes)): min_dist = float('inf') current_node = RBF_Nodes[i] np_current_node = np.asarray((current_node.x, current_node.y)) for j in range(0, len(RBF_Nodes)): if i == j: continue np_other_node = np.asarray((RBF_Nodes[j].x, RBF_Nodes[j].y)) dist = np.linalg.norm(np_current_node - np_other_node) if dist < min_dist: min_dist = dist current_node.variance = max(min_dist * 1.35, 0.2) def adjust_widths_smart(RBF_Nodes, input_pattern): for i in range(0, len(RBF_Nodes)): min_dist = float('inf') current_node = RBF_Nodes[i] np_current_node = np.asarray((current_node.x, current_node.y)) for j in range(0, len(input_pattern)): if i == j: continue np_other_node = np.asarray((input_pattern[j][0], input_pattern[j][1])) dist = np.linalg.norm(np_current_node - np_other_node) if dist < min_dist: min_dist = dist current_node.variance = max(min_dist * 1.35, 0.2) training_input = [] training_target = [] with open('data_lab2/ballist.dat') as f: for line in f: line_numbers = [float(x) for x in line.split()] training_input.append(np.asarray([line_numbers[0], line_numbers[1]])) training_target.append(np.asarray([line_numbers[2], line_numbers[3]])) test_input = [] test_target = [] with open('data_lab2/balltest.dat') as f: for line in f: line_numbers = [float(x) for x in line.split()] test_input.append(np.asarray([line_numbers[0], line_numbers[1]])) test_target.append(np.asarray([line_numbers[2], line_numbers[3]])) test_target = np.asarray(test_target) learning_rate = 0.01 random.seed(a=None) # Class that represents a 2d input and what type it should be classified as class Node: def __init__(self, x, y, v): self.x = x self.y = y self.variance = v def __repr__(self): return "<x:%s y:%s v:%s>" % (self.x, self.y, self.variance) def __str__(self): return "member of Test" def asarray(self): return np.asarray([self.x, self.y]) # Mean squared error def mean_squared_error(expected, predicted): return np.sum((expected - predicted) ** 2)/len(expected) # Squared error def squared_error(expected, predicted): return np.sum((expected - predicted) ** 2) # Absolute residual error def absolute_residual_error(expected, predicted): return np.sum(abs(expected - predicted))/len(expected) # We use Gaussian RBF's with the following transfer function def transfer_function(x, position, variance): return (math.exp((-(np.linalg.norm(x - position.asarray()))**2) / (2*(variance**2)))) def euclidean_distance(x1, y1, x2, y2): return (math.sqrt(((x1 - x2)**2) + ((y1 - y2)**2))) # Sets values in input_pattern that are >= 0 to 1 and values < 0 to -1 def binary(input_pattern): for v in range (0, len(input_pattern)): if (input_pattern[v] >= 0): input_pattern[v] = 1 else: input_pattern[v] = -1 return input_pattern # Adds noise to input_pattern and then returns it as output_pattern def noise(input_pattern): output_pattern = [] for i in range(0, len(input_pattern)): output_pattern.append(input_pattern[i] + np.random.normal(0, 0.1, 1)[0]) return output_pattern # Generate function data errors = [] comp_errors = [] # Initiate RBF nodes and WEIGHTS NUM_NODES_ROWS = 5 NUM_NODES_COLS = 5 nodes = NUM_NODES_ROWS * NUM_NODES_COLS min_x = 0 max_x = 1 min_y = 0 max_y = 0 variance = 0.2 mu, sigma = 0, 0.1 # used for weight initialization RBF_Nodes = [] comp_RBF_Nodes = [] weight = [] comp_weight = [] for r in range(0, NUM_NODES_ROWS): for c in range(0, NUM_NODES_COLS): x = c / (NUM_NODES_COLS - 1) y = r / (NUM_NODES_ROWS - 1) #x = -(NUM_NODES_COLS - 1) * variance + c * 2 * variance + (NUM_NODES_COLS * variance) #y = -(NUM_NODES_ROWS - 1) * variance + r * 2 * variance + NUM_NODES_ROWS * variance init_weights = np.random.normal(mu, sigma, 2) weight.append(np.asarray([init_weights[0], init_weights[1]])) comp_weight.append(np.asarray([init_weights[0], init_weights[1]])) RBF_Nodes.append(Node(x, y, variance)) comp_RBF_Nodes.append(Node(x, y, variance)) weight = np.array(weight) comp_weight = np.array(comp_weight) CL(comp_RBF_Nodes, training_input, True) adjust_widths(comp_RBF_Nodes) #adjust_widths_smart(comp_RBF_Nodes, training_input) # Calculate SIN phi training_phi = np.zeros((len(training_input), nodes)) comp_training_phi = np.zeros((len(training_input), nodes)) test_phi = np.zeros((len(training_input), nodes)) comp_test_phi = np.zeros((len(training_input), nodes)) for p in range (0, len(training_input)): for n in range (0, len(RBF_Nodes)): training_phi[p][n] = transfer_function(training_input[p], RBF_Nodes[n], RBF_Nodes[n].variance) comp_training_phi[p][n] = transfer_function(training_input[p], comp_RBF_Nodes[n], comp_RBF_Nodes[n].variance) test_phi[p][n] = transfer_function(test_input[p], RBF_Nodes[n], RBF_Nodes[n].variance) comp_test_phi[p][n] = transfer_function(test_input[p], comp_RBF_Nodes[n], comp_RBF_Nodes[n].variance) epochs = 1000 # Sequential Delta rule-------------------------------------------------------------------------------------------------------------------------------------------- for i in range(0, epochs): for o in range(0, len(training_target)): weight = weight + np.dot(np.transpose(learning_rate*(training_target[o] - np.dot(training_phi[o].reshape(1, -1), weight))),training_phi[o].reshape(1, -1)).transpose() comp_weight = comp_weight + np.dot(np.transpose(learning_rate*(training_target[o] - np.dot(comp_training_phi[o].reshape(1, -1), comp_weight))),comp_training_phi[o].reshape(1, -1)).transpose() test_output = np.dot(test_phi, weight) comp_test_output = np.dot(comp_test_phi, comp_weight) errors.append(absolute_residual_error(test_target, test_output)) comp_errors.append(absolute_residual_error(test_target, comp_test_output)) print("Epoch:", i, "SIN Sequential Delta rule error:", comp_errors[-1]) # Plot ax = plt.gca() plot_error = True if plot_error: ax.plot(errors) ax.plot(comp_errors) ax.legend(['Manually placed', 'Competitive learning']) plt.ylabel('Absolute residual error') plt.xlabel('Epochs') plt.xlim([0, 200]) else: comp = False if comp: X = [] Y = [] Circles = [] for node in comp_RBF_Nodes: X.append(node.x) Y.append(node.y) Circles.append(plt.Circle((node.x, node.y), node.variance, color='k', fill=False, alpha= 0.1)) ax.plot(X, Y, "ro", alpha= 0.1) for circle in Circles: ax.add_artist(circle) ax.scatter(np.asarray(test_input)[:,0], np.asarray(test_input)[:,1]) else: X = [] Y = [] Circles = [] for node in RBF_Nodes: X.append(node.x) Y.append(node.y) Circles.append(plt.Circle((node.x, node.y), node.variance, color='k', fill=False, alpha= 0.1)) ax.plot(X, Y, "ro", alpha= 0.1) for circle in Circles: ax.add_artist(circle) ax.scatter(np.asarray(test_input)[:,0], np.asarray(test_input)[:,1]) plt.show()
[ "bargachayoub@gmail.com" ]
bargachayoub@gmail.com
215c8f57546333741fc0493c871ce51784463d85
0838c6d72c707380865767759bb47f084af361ab
/Multiples_of_3_and_5.py
4827b837aefa70113549e10897f61e5c972194c7
[]
no_license
gsmcclellan/project_euler
ecb4fc23bfc6e92eac23d7b37ba7d33890cadc02
4140bf5004fd5395c8625f7f0a0027fc049b7018
refs/heads/master
2021-01-19T11:34:19.079026
2013-09-22T03:55:47
2013-09-22T03:55:47
null
0
0
null
null
null
null
UTF-8
Python
false
false
262
py
def sum_of_multiples(lower_limit, upper_limit): numbers = [x for x in range(lower_limit, upper_limit) if x % 3 == 0 or x % 5 == 0] sum = 0 for num in numbers: sum += num return sum sum = sum_of_multiples(1, 1000) print(sum)
[ "gsmcclellan@gmail.com" ]
gsmcclellan@gmail.com
4d04156b9c968e0dc15e18554f9ec5ba6c3673cc
07bfbab59aaf8b5d9853139a3c5a4c0ac0bdb6c4
/server/expedition_manager.py
e51490cfd9c52f61f09a93a4d1c63d553e94ec26
[]
no_license
AngXingLong/ict2x01-2019t1-team16
a45e9262f40a01e3f183a9d1293b2b61ad0503c5
1a4c042c46b39b2e44f32c4853dd935e71d4df9b
refs/heads/master
2022-12-09T07:03:45.895243
2019-11-28T12:54:23
2019-11-28T12:54:23
220,923,826
0
0
null
2019-11-18T09:06:46
2019-11-11T07:20:41
Python
UTF-8
Python
false
false
7,116
py
import mysql_helper from expedition import expeditionClass import user_manager import datetime import random import unittest """ Send in a User Object """ """ Author: Felix Wang Purpose: Returns a list of Expedition Objects Returns: List of Expedition Objects Parameters: hero_power_level : int """ def getExpeditionByID(expedition_id): sql_statement = "SELECT * FROM myexpedition WHERE expeditionID = '" + expedition_id + "';" try: ex = mysql_helper.select_statement(sql_statement)[0] except IndexError: print("ERROR: Expedition ID does not exist.") return [1] expedition = expeditionClass(ex[0], ex[1], ex[2], ex[3], ex[4], ex[5], ex[6], 'Y') return [0, expedition] """ Author: Felix Wang Purpose: Returns a list of Expedition Objects Returns: List of Expedition Objects Parameters: User_OBJ """ def getExpeditions(User): expeditionObjList = [] sql_statement = "SELECT * FROM myexpedition" expeditionList = mysql_helper.select_statement(sql_statement) for ex in expeditionList: expedition = expeditionClass(ex[0], ex[1], ex[2], ex[3], ex[4], ex[5], ex[6], checkEligibleExpedition(ex[1], User.PowerLevel)) expeditionObjList.append(expedition) return expeditionObjList """ Author: Felix Wang Purpose: Checks if user is eligible for expedition Returns: True (Eligible) / False (Illegible) Parameter: required_power_level : int, hero_power_level: int """ def checkEligibleExpedition(required_power_level, hero_power_level): if required_power_level <= hero_power_level: return True else: return False """ Author: Felix Wang Purpose: Start Expedition - Set the start and end time of the expedition """ "** TESTING **" def startExpedition(userID, expeditionID): # Get the Expedition ID. response = getExpeditionByID(expeditionID) if not response[0] == 0: print("ERROR: Expedition ID does not exist.") return False expedition_obj = response[1] # Get the start and end timings (start_timing, end_timing) timings = getTiming(expedition_obj.TimeTaken) # Get a randomized HToken value. +50 or -50) randomizedHToken = randomizeHToken(expedition_obj.HToken) # Insert record into myUserExpedition table. values = [userID, 'Y', expeditionID, timings[0], timings[1], randomizedHToken] sql_statement = "INSERT INTO myuserexpedition (userId, isOngoing, expeditionId, startTime, endTime, hTokens) " \ "VALUES (%s, %s, %s, %s, %s, %s)" response = mysql_helper.sql_operation(sql_statement, values) if not response: return 1 print("Insertion into myUserExpedition successful") # Need to disable user expedition status by updating the table to 'N' sql_statement = "UPDATE myuser SET isAvailable = %s WHERE id = %s" values = ['N', userID] response = mysql_helper.sql_operation(sql_statement, values) if not response: return 1 print("User availability updated to 'N'") return 0 """ Author: Felix Wang Purpose: Checks if user is eligible for expedition Returns: True (Eligible) / False (Illegible) Parameter: required_power_level : int, hero_power_level: int """ def randomizeHToken(HToken): return HToken + random.randint(-50, 50) """ Author: Felix Wang Purpose: Checks if user is eligible for expedition Returns: True (Eligible) / False (Illegible) Parameter: required_power_level : int, hero_power_level: int """ def getTiming(timeTaken): start_timestamp = datetime.datetime.now() end_timestamp = datetime.datetime.now() + datetime.timedelta(minutes = timeTaken) return start_timestamp, end_timestamp """ Gets ongoing expeditions and returns it. """ def get_ongoing_expeditions(userID): sql_statement = "SELECT * FROM myuserexpedition as ue INNER JOIN myexpedition as e on ue.expeditionId = e.expeditionId WHERE ue.userId = '" + str(userID) + "' AND ue.isOngoing = 'Y';" response = mysql_helper.select_statement(sql_statement) if not response: return [1] return [0, {"USER_ID": response[0][0], "IS_ONGOING": response[0][1], "EXPEDITION_ID": response[0][2], "START_TIME": response[0][3], "END_TIME": response[0][4], "H_TOKENS": response[0][5], "POWER_LEVEL": response[0][8], "IMAGE": response[0][9], "DESCRIPTION": response[0][10], "TITLE": response[0][11], "TIME_TAKEN": response[0][12], "EST_H_TOKEN" : response[0][13]}] """ Gets completed expeditions and returns it. """ def get_completed_expeditions(userID): sql_statement = "SELECT * FROM myuserexpedition as ue INNER JOIN myexpedition as e on ue.expeditionId = e.expeditionId WHERE ue.userId = '" + str( userID) + "' AND ue.isOngoing = 'P';" response = mysql_helper.select_statement(sql_statement) if not response: return [1] return [0, {"USER_ID": response[0][0], "IS_ONGOING": response[0][1], "EXPEDITION_ID": response[0][2], "START_TIME": response[0][3], "END_TIME": response[0][4], "H_TOKENS": response[0][5], "POWER_LEVEL": response[0][8], "IMAGE": response[0][9], "DESCRIPTION": response[0][10], "TITLE": response[0][11], "TIME_TAKEN": response[0][12], "EST_H_TOKEN" : response[0][13]}] """ End User Expedition. Update isAvailable to 'P' (Pending) and set expedition isongoing to 'N' """ def end_expedition(userID): sql_statement = "UPDATE myuser set isAvailable = %s WHERE id = %s" response = mysql_helper.sql_operation(sql_statement, ['P', str(userID)]) if not response: print("First Statement has errors") return 1 sql_statement = "UPDATE myuserexpedition set isOngoing = %s WHERE userId = %s and isOngoing = %s" print(sql_statement) response = mysql_helper.sql_operation(sql_statement, ['P', str(userID), 'Y']) if not response: print("Second statement has error") return 1 return 0 """ End User Expedition. Update isAvailable to 'P' (Pending) and set expedition isongoing to 'N' """ def complete_expedition(userID): sql_statement = "UPDATE myuser set isAvailable = %s WHERE id = %s" response = mysql_helper.sql_operation(sql_statement, ['Y', str(userID)]) if not response: print("First Statement has errors") return 1 sql_statement = "UPDATE myuserexpedition set isOngoing = %s WHERE userId = %s and isOngoing = %s" print(sql_statement) response = mysql_helper.sql_operation(sql_statement, ['N', str(userID), 'P']) if not response: print("Second statement has error") return 1 return 0
[ "leeyuma.ly@gmail.com" ]
leeyuma.ly@gmail.com
ff019f07eb5c8e7f8b76ea211847e34d492d6b19
ad06ae5cfcb8a30233d741a349fbcae47bdd67f6
/gwn/__init__.py
d49c771cd60ba3c8ea6f3fb723f58ee135f89829
[]
no_license
temiolugbade/GlobalWorkspaceNetwork
36d351e801ecd39e87e29a20a23ee57f3465a542
ef6f74740fe3b1062a41fcee95264ac381090e8e
refs/heads/master
2023-03-25T04:35:57.046662
2019-09-01T12:18:47
2019-09-01T12:18:47
null
0
0
null
null
null
null
UTF-8
Python
false
false
33
py
# __init__.py # author: Cong Bao
[ "bao_cong@outlook.com" ]
bao_cong@outlook.com
776d1393cd969acc0453d91a41711836eed317e4
9483dd999c98dcfcd564e15eaa3182ea561a6ab3
/migrations/versions/97fd285963c7_.py
6524521410bb060f8fca5069fd2e55f00e244a76
[]
no_license
Rhpozzo/FlaskAPI
3ff441300b867fe728d5e25b3c3e2b45070e94b8
6748fa1376e3ca6659e082ff14e4cbde4a09018a
refs/heads/master
2021-07-02T21:43:19.909968
2020-01-24T01:37:41
2020-01-24T01:37:41
234,431,197
0
0
null
2021-05-06T19:58:20
2020-01-16T23:24:49
Python
UTF-8
Python
false
false
786
py
"""empty message Revision ID: 97fd285963c7 Revises: 540192f3b71d Create Date: 2020-01-18 20:07:20.091637 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '97fd285963c7' down_revision = '540192f3b71d' branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('person', sa.Column('full_name', sa.String(length=120), nullable=False)) op.create_unique_constraint(None, 'person', ['full_name']) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_constraint(None, 'person', type_='unique') op.drop_column('person', 'full_name') # ### end Alembic commands ###
[ "guest_@Gabys-MacBook-Pro.local" ]
guest_@Gabys-MacBook-Pro.local
3ab2c27c1233ee479a6aa9263023772ffa279da1
ac53f97ed730da035a0decb391aef03528e0e628
/test.py
bc5babfe9c27e996599600c9590f076c717b805d
[]
no_license
jerryqypan/rl_rubiks
575a96e2c4d8c4fefecc2bdd6254b8cf685dd8aa
9710bfe8bebd7964174964b94ef3fc248b29f2d8
refs/heads/master
2021-08-29T14:12:15.028096
2017-12-14T02:45:12
2017-12-14T02:45:12
114,042,029
0
0
null
null
null
null
UTF-8
Python
false
false
236
py
import random import numpy as np import pycuber as pc move = ["R","R'","R2","U","U'","U2","F","F'","F2","D","D'","D2","B","B'","B2","L","L'","L2"] shuffle = ' '.join(np.random.choice(move,20)) cube = pc.Cube() cube(shuffle) print(cube)
[ "qp7@duke.edu" ]
qp7@duke.edu
dabb78bebf00d0ba0d51170326598ab7bc9dadee
34a134afbbcd3aa242b1f6bd05dace8a390caf64
/src/ui/window.py
ccbf45f9c147111b406c849b0cd0929ba7bc3957
[ "MIT" ]
permissive
tulustul/MusicPlayer
ca6279fe114d7e2b4ac955015fbc72bf194f8953
e44ea89a00c3cf46936544e579191fbbf64b0417
refs/heads/master
2020-07-16T16:15:20.628072
2019-06-02T21:37:05
2019-06-02T21:37:05
73,945,357
4
0
MIT
2019-05-16T21:07:08
2016-11-16T17:44:50
Python
UTF-8
Python
false
false
3,132
py
import asyncio import curses import logging from typing import Dict, Optional, List import os from core import keyboard from core.config import config from . import colors from .renderer import Renderer from .components.abstract_component import AbstractComponent from .components.layout import Layout from .components.input import InputComponent from .rect import Rect logger = logging.getLogger("ui.window") os.environ.setdefault("ESCDELAY", "25") class Window: def __init__(self): self.components: Dict[object, AbstractComponent] = {} self.active_component_stack: List[AbstractComponent] = [] self.screen = None self.create() colors.init() self.renderer = Renderer() self.root_component = Layout() self.root_component.renderer = self.renderer self.root_component.set_rect(Rect(0, 0, curses.COLS, curses.LINES)) self.input_component = InputComponent() self.input_container: Optional[Layout] = None self.input_mode = False self.running = True def create(self): self.screen = curses.initscr() curses.noecho() curses.cbreak() curses.curs_set(0) self.screen.keypad(1) self.screen.nodelay(1) try: curses.start_color() except Exception: pass self.screen.refresh() def destroy(self): curses.echo() curses.nocbreak() curses.curs_set(1) self.screen.keypad(0) self.screen.nodelay(0) curses.endwin() async def process_input(self): interval = config.get("input_interval", 0.02) while self.running: self.renderer.update() await asyncio.sleep(interval) ch = 0 while ch != -1: try: ch = self.screen.getch() if ch != -1: keyboard.raw_keys.on_next(ch) except curses.error as e: logger.error(e) except KeyboardInterrupt: self.hide_view(self.active_component) def get_component(self, component_class: type): return self.root_component.get_component(component_class) def focus(self, component: AbstractComponent): self.active_component_stack.append(component) def blur_active_component(self): self.active_component_stack.pop() @property def active_component(self): if self.active_component_stack: return self.active_component_stack[-1] return None def quit(self): self.running = False async def input(self, prompt: str, default_value=""): if not self.input_container: raise ValueError("No input_container") self.input_container.add(self.input_component) self.root_component.update_layout() self.input_mode = True result = await self.input_component.request_value( prompt, default_value, ) self.input_component.detach() self.input_mode = False return result
[ "tulfm@poczta.fm" ]
tulfm@poczta.fm
74e2f3fa38eda7d3f367db73cc95cbfd4cf52c1c
a07103a8180702f1a835c17f06f2561755473dc6
/amazon_spider/middlewares.py
c9b05e691a663f4b7c3411f3f8e608fa09919ba9
[]
no_license
dejesusjmb/amazon_spider
245fc3f1362490aabc7aaa2daceffde8218f0b8a
38c51d43df3960501578e65ec73c5aaba9b18097
refs/heads/main
2023-06-16T18:36:33.974325
2021-07-02T10:12:56
2021-07-02T10:12:56
380,139,391
1
1
null
null
null
null
UTF-8
Python
false
false
3,660
py
# Define here the models for your spider middleware # # See documentation in: # https://docs.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals # useful for handling different item types with a single interface from itemadapter import is_item, ItemAdapter class AmazonSpiderSpiderMiddleware: # Not all methods need to be defined. If a method is not defined, # scrapy acts as if the spider middleware does not modify the # passed objects. @classmethod def from_crawler(cls, crawler): # This method is used by Scrapy to create your spiders. s = cls() crawler.signals.connect(s.spider_opened, signal=signals.spider_opened) return s def process_spider_input(self, response, spider): # Called for each response that goes through the spider # middleware and into the spider. # Should return None or raise an exception. return None def process_spider_output(self, response, result, spider): # Called with the results returned from the Spider, after # it has processed the response. # Must return an iterable of Request, or item objects. for i in result: yield i def process_spider_exception(self, response, exception, spider): # Called when a spider or process_spider_input() method # (from other spider middleware) raises an exception. # Should return either None or an iterable of Request or item objects. pass def process_start_requests(self, start_requests, spider): # Called with the start requests of the spider, and works # similarly to the process_spider_output() method, except # that it doesn’t have a response associated. # Must return only requests (not items). for r in start_requests: yield r def spider_opened(self, spider): spider.logger.info('Spider opened: %s' % spider.name) class AmazonSpiderDownloaderMiddleware: # Not all methods need to be defined. If a method is not defined, # scrapy acts as if the downloader middleware does not modify the # passed objects. @classmethod def from_crawler(cls, crawler): # This method is used by Scrapy to create your spiders. s = cls() crawler.signals.connect(s.spider_opened, signal=signals.spider_opened) return s def process_request(self, request, spider): # Called for each request that goes through the downloader # middleware. # Must either: # - return None: continue processing this request # - or return a Response object # - or return a Request object # - or raise IgnoreRequest: process_exception() methods of # installed downloader middleware will be called return None def process_response(self, request, response, spider): # Called with the response returned from the downloader. # Must either; # - return a Response object # - return a Request object # - or raise IgnoreRequest return response def process_exception(self, request, exception, spider): # Called when a download handler or a process_request() # (from other downloader middleware) raises an exception. # Must either: # - return None: continue processing this exception # - return a Response object: stops process_exception() chain # - return a Request object: stops process_exception() chain pass def spider_opened(self, spider): spider.logger.info('Spider opened: %s' % spider.name)
[ "jdejesus@buildzoom.com" ]
jdejesus@buildzoom.com
35b1952b06b8274553605dae56d4b25d5da81a3d
77900cdd9a815caf1cd04705321ca93f5072179f
/Project/.history/product_20211116215222.py
58d5bb8d7d70ef65639f0d85425607bc5e56f6aa
[]
no_license
Bom19990111/helloword_python
717799d994223d65de5adaeabecf396ff2bc1fb7
2ee2e67a60043f03c1ce4b070470c7d2dcdc72a7
refs/heads/master
2023-09-06T04:17:02.057628
2021-11-21T20:00:46
2021-11-21T20:00:46
407,063,273
0
1
null
2021-11-21T20:00:47
2021-09-16T07:18:35
Python
UTF-8
Python
false
false
11,136
py
import data as list_product import random import pandas as pd # def __init__(self, Id, Product_code, Product_name, Brand, Year, Size): # self.Id = Id # self.Product_code = Product_code # self.Product_name = Product_name # self.Brand = Brand # self.Year = Year # self.Size = Size # Thêm sản phẩm def AddProduct(): print("THÊM SẢN PHẨM") product = { "Id": "", "Product_code": "", "Product_name": "", "Brand": "", "Price": "", "Year": "", "Quantity": "", "Size": "", "Status": "" } print("Nhập ID sản phẩm:") try: Id = int(input()) except: print("ID phải là kiểu số, vui lòng nhập lại".upper()) print("------------------------------------") try: AddProduct() except RuntimeError: print("Dừng chương trình!") while True: student = FindProductDuplicate(Id) if student != False: print("ID đã tồn tại, vui lòng nhập lại ID") Id = int(input()) else: break product['Id'] = Id # Mã sản phẩm random code_product = random.randint(1, 99) str_id = "HKSP" if code_product <= 9: str_id += "0" + str(code_product) else: str_id += str(code_product) product["Product_code"] = str_id print("Nhập tên sản phẩm: ") product['Product_name'] = input() print("Nhập thương hiệu sản phẩm: ") product['Brand'] = input() print("Nhập giá sản phẩm: ") try: product['Price'] = float(input()) except ValueError: print("Giá phải là kiểu số, vui lòng nhập lại".upper()) print("------------------------------------") try: print("Nhập giá sản phẩm: ") product['Price'] = float(input()) except: print("Dừng chương trình!") print("Nhập năm sản xuất: ") try: product['Year'] = int(input()) except ValueError: print("Năm phải là kiểu số, vui lòng nhập lại".upper()) print("------------------------------------") try: print("Nhập năm sản xuất: ") product['Year'] = int(input()) except: print('Dừng chương trình!') print("Nhập số lượng: ") try: product['Quantity'] = int(input()) except ValueError: print("Số lượng phải là kiểu số, vui lòng nhập lại".upper()) print("------------------------------------") try: print("Nhập số lượng: ") product['Quantity'] = int(input()) except: print('Dừng chương trình!') print("Nhập size giày: ") product['Size'] = input() print("Nhập tình trạng sản phẩm: ") product['Status'] = input() list_product.list_product.append(product) answer = input("Bạn có muốn nhập tiếp không? Y/N ") if answer == "y" or answer == "Y": AddProduct() # Tìm kiếm ID trùng lặp def FindProductDuplicate(Id): for i in range(0, len(list_product.list_product)): if list_product.list_product[i]['Id'] == Id: return [i, list_product.list_product[i]] return False # Hiển thị tất cả sản phẩm def ShowAllProduct(): print("*** HIỂN THỊ TẤT CẢ SẢN PHẨM ***") if len(list_product.list_product) == 0 or len(list_product.list_product) < 0: print("Chưa có sản phẩm nào để hiển thị! ".upper()) for i in range(0, len(list_product.list_product)): print("ID : \t", list_product.list_product[i]['Id']), print("Mã sản phẩm : \t", list_product.list_product[i]['Product_code']), print("Tên sản phẩm : \t", list_product.list_product[i]['Product_name']), print("Thương hiệu : \t", list_product.list_product[i]['Brand']), print("Giá : \t", list_product.list_product[i]['Price']), print("Năm xuất bản : \t", list_product.list_product[i]['Year']), print("Số lượng : \t", list_product.list_product[i]['Quantity']), print("Size giày : \t", list_product.list_product[i]['Size']) print("Tình trạng : \t", list_product.list_product[i]['Status']) print("________________________________") # Sửa thông tin sản phẩm def UpdateProduct(): print("*** CẬP NHẬT THÔNG TIN SẢN PHẨM ***") print("Nhập ID sản phẩm cần sửa") try: Id = int(input()) product = FindProductDuplicate(Id) except: print("Vui lòng nhập đúng định dạng ID".upper()) UpdateProduct() if product == False: print("Không tìm thấy sản phẩm ID = ".upper(), Id) print("********************************") UpdateProduct() else: print("""Bạn muốn cập nhật mục nào ? : 0. Thoát. 1. Tên sản phẩm. 2. Thương hiệu sản phẩm. 3. Giá sản phẩm 4. Size giày. 5. Số lượng. 6. Năm xuất bản. 7. Tình trạng """) action = 0 while action >= 0: if action == 1: UpdateProductName() elif action == 2: UpdateProductBrand() elif action == 3: UpdateProductPrice() elif action == 4: UpdateProductSize() elif action == 5: UpdateProductQuatity() elif action == 6: UpdateProductYear() elif action == 7: UpdateStatus() def UpdateProductName(): print("Nhập tên cập nhật của sản phẩm: ") name_product = input() product[1]['Product_name'] = name_product def UpdateProductBrand(): print("Nhập thương hiệu muốn cập nhật: ") name_product = input() product[1]['Brand'] = name_product def UpdateProductPrice(): print("Nhập giá muốn cập nhật: ") name_product = float(input()) product[1]['Price'] = name_product def UpdateProductSize(): print("Nhập size muốn cập nhật: ") name_product = input() product[1]['Size'] = name_product def UpdateProductYear(): print("Nhập năm sản xuất muốn cập nhật: ") name_product = int(input()) product[1]['Year'] = name_product list_product.list_product[product[0]] = product[1] def UpdateProductQuatity(): print("Nhập số lượng muốn cập nhật: ") name_product = int(input()) product[1]['Quantity'] = name_product list_product.list_product[product[0]] = product[1] def UpdateStatus(): print("Nhập tình trạng muốn cập nhật: ") name_product = input() product[1]['Status'] = name_product list_product.list_product[product[0]] = product[1] action = int(input("Bạn chọn mục cập nhật nào? ")) if action == 0: print("Không cập nhật mục nào".upper()) print("********************************") break # Xóa sản phẩm def DeleteProduct(): print("*** XÓA SẢN PHẨM ***") print("Nhập ID sản phẩm cần xóa:") Id = int(input()) product = FindProductDuplicate(Id) if product == False: print("Không tìm thấy sản phẩm ID = ".upper(), Id) print("********************************") else: answer = input("Bạn có muốn xóa sản phẩm này không? Y/N ".upper()) if answer == "y" or answer == "Y": if product != False: list_product.list_product.remove(product[1]) print("Xóa sản phẩm thành công!".upper()) print("********************************") else: print("Đã từ chối xóa sản phẩm này!".upper()) print("********************************") # Tìm kiếm sản phẩm def FindProductByName(): print("*** TÌM KIẾM SẢN PHẨM ***") if (len(list_product.list_product) == 0 or len(list_product.list_product) < 0): print("Chưa có sản phẩm nào trong giỏ!".upper()) print("********************************") else: NameProduct = str( input("Nhập tên sản phẩm hoặc tên thương hiệu bạn muốn tìm kiếm: ")).upper() is_found = False for i in range(0, len(list_product.list_product)): if str(list_product.list_product[i]['Product_name']).upper() in NameProduct or str(list_product.list_product[i]['Brand']).upper() in NameProduct: is_found = True print("ID : \t", list_product.list_product[i]['Id']), print("Mã sản phẩm : \t", list_product.list_product[i]['Product_code']), print("Tên sản phẩm : \t", list_product.list_product[i]['Product_name']), print("Thương hiệu : \t", list_product.list_product[i]['Brand']), print("Giá : \t", list_product.list_product[i]['Price']), print("Năm xuất bản : \t", list_product.list_product[i]['Year']), print("Số lượng : \t", list_product.list_product[i]['Quantity']), print("Size giày : \t", list_product.list_product[i]['Size']) print("Tình trạng : \t", list_product.list_product[i]['Status']) print("________________________________") if not is_found: print("Không tìm thấy sản phẩm này @@".upper()) print("********************************") def SortProductNameA_Z(): list_product.list_product.sort(key=lambda item: item.get("Product_name")) def SortProductNameZ_A(): list_product.list_product.sort( key=lambda item: item.get("Product_name"), reverse=True) def SortPriceAsc(): list_product.list_product.sort(key=lambda item: item.get("Price")) def SortPriceDesc(): list_product.list_product.sort( key=lambda item: item.get("Price"), reverse=True) def ExportExecel(): pd.DataFrame(list_product.list_product).to_excel('danhsachsanpham.xlsx', header=False, index=False) df = pd.read_excel(xl, header=None) print(df.head()) def ImportExecel(): xl = pd.ExcelFile('danhsachsanpham.xlsx') df = pd.read_excel(xl, header=None) print(df.head())
[ "phanthituyngoc1995@gmail.com" ]
phanthituyngoc1995@gmail.com
e3b8d5850095b18d45030906c434323935662296
b76ead7d69245710beb9eba31c70804e3d32a3bc
/avro_extract.py
6063905d72469a16f2a4c519a663be3bd95c4303
[]
no_license
holbech/scrap_scripts
d4a01d9ddc6bdaa74aab50706d138b5f6a17d8b4
f41b9f3af939b9f4418d816a8209644893bf98e4
refs/heads/master
2022-04-27T16:44:44.518027
2022-03-08T18:29:35
2022-03-08T18:29:35
16,314,209
0
0
null
null
null
null
UTF-8
Python
false
false
4,881
py
#!/usr/bin/env python import argparse from collections import defaultdict from itertools import chain import sys from multiprocessing import Pool import fastavro as avro parser = argparse.ArgumentParser(description='Extracts fields from avro-files to tsv lines') parser.add_argument('filenames', nargs='+', help='if extension of file is .lst or .txt it will be assumed to be a file of filenames') parser.add_argument('-m', '--multiprocessing', type=int, default=1, help='Parallel processes to run') parser.add_argument('-f', '--field', nargs='*', help='Field to extract') parser.add_argument('-l', '--list-fields', action='store_true', help='List fields in files') parser.add_argument('-a', '--add-header', action='store_true', help='Add field names as header to output') parser.add_argument('-s', '--sample-values', type=int, default=0, help='If larger than zero, list each field in files along with this number of sample values') args = parser.parse_args() def get_fields(some_record): for k,v in some_record.iteritems(): if isinstance(v, dict): for sf in get_fields(v): yield (k,) + sf else: yield (k,) def expand(input_filename): if input_filename.endswith(('.txt', '.lst')): with open(input_filename, 'r') as files: for l in files: yield l.strip() else: yield input_filename class SampleCollector(object): def __init__(self): self._values = set() self.is_full = False def add(self, value): if not self.is_full: self._values.add(value) self.is_full = len(self._values) == args.sample_values def __iter__(self): return iter(self._values) samples = (args.sample_values or None) and defaultdict(SampleCollector) def _format(value): if value is None: return "" if isinstance(value, basestring): return value try: return ujson.dumps(value) except: if isinstance(value, (tuple, list)): return '[' + ','.join( _format(v) for v in value ) + ']' if isinstance(value, dict): return '{' + ','.join( _format(v) for v in value ) + '}' if not isinstance(value, basestring): return str(value) NOT_FOUND = object() def _extract(some_record, field_names): result = some_record for f in field_names: result = result.get(f, NOT_FOUND) if result is not NOT_FOUND: result = _format(result) result = result.replace('\t','\\t').replace('\n','\\n') if isinstance(result, unicode): result = result.encode('utf-8') if samples is not None and result: samples[field_names].add(result) return result else: return "FieldNotFound" def extract(some_record, fields): return [ _extract(some_record, f) for f in fields ] global_fields = tuple( f.split('/') for f in args.field or () ) def extract_file(filename): print >> sys.stderr, "Processing " + filename result = [] with open(filename, 'rb') as avro_file: reader = avro.reader(avro_file) schema = reader.schema fields = global_fields add_header = args.add_header for index, record in enumerate(reader): if not fields: fields = tuple(get_fields(record)) if args.list_fields: print 'Fields in %s:' % (filename,) for f in fields: print ' Field: ' + '/'.join(f) break if add_header: print '\t'.join( '/'.join( p.encode('utf-8') for p in f ) for f in fields ) add_header = False if index and not (index % 1000): if samples and all( s.is_full for s in samples.itervalues() ): break sys.stderr.write("Read %d lines of input\r" % (index,)) extracted_values = extract(record, fields) if samples is None: result.append('\t'.join(extracted_values)) if samples: print 'Samples values from %s:' % (filename,) for f in fields: print ' ' + '/'.join(f) + ':' for v in sorted(samples[f]): print ' ' + v print >> sys.stderr, "Read %d lines of input\r" % (index,) return result filenames = chain.from_iterable( expand(f) for f in args.filenames ) if args.multiprocessing > 1 and not args.sample_values: if args.add_header: sys.stdout.writelines( l + '\n' for l in extract_file(next(filenames)) ) pool = Pool(args.multiprocessing) sys.stdout.writelines( l + '\n' for l in chain.from_iterable(pool.imap_unordered(extract_file, filenames, chunksize=1)) ) else: for fn in filenames: sys.stdout.writelines( l + '\n' for l in extract_file(fn) )
[ "sh@realtime-targeting.com" ]
sh@realtime-targeting.com
bb9ac282b2774e54759acf1c0d583b248bd85841
0a08281fde5c5f37f9251c6e60e8a662a880b625
/timing_decode.py
35edefb77b07b0ce7359e484add7390c515a2c1b
[]
no_license
robzwolf/huffman
3f7c9b82354266363e10ffd57b5d5b4dabdfd651
0d51100e9a368a02d12899752a1f6c4f9c7cb4ce
refs/heads/master
2021-09-07T02:11:37.353223
2018-02-15T15:59:57
2018-02-15T15:59:57
120,305,463
0
0
null
null
null
null
UTF-8
Python
false
false
141
py
import huffman for i in range(1, 9): print("\nCalling encode(timing_{}.txt)...".format(i)) huffman.decode("timing_{}.hc".format(i))
[ "5098748+robzwolf@users.noreply.github.com" ]
5098748+robzwolf@users.noreply.github.com
b00220203fdd6ed05a580a478f9bdbb63a9ba0c2
1031f441f7077599ce0e74e53ee3b8828c2e50c4
/src/other/test_uni.py
f3da28a0afed2f0503577fd4d056a0d198199570
[]
no_license
Sejuapig/prod_log
22067a584781c21829f84550fa29c9a1fb9282d6
69f1a2aecf1488a5a5ca9c259b8234813bcd625c
refs/heads/master
2021-06-16T09:29:09.239012
2017-04-04T07:33:58
2017-04-04T07:33:58
81,428,272
0
0
null
null
null
null
UTF-8
Python
false
false
522
py
import unittest,sys import connexion as connexion class premierTest(unittest.TestCase): """ Tests pour 1.py """ def test0(self): bd, cursor = connexion.run() cursor.execute("SELECT id_activity FROM activity where nom_activity ='Triathlon'") id = cursor.fetchone() """ test 0 """ self.assertEquals(8301, id) if __name__ == '__main__': unittest.main()
[ "sejuapig@gmail.com" ]
sejuapig@gmail.com
33228e114bc20b0765bb650ad30f6d98a5f253bd
bfdc7a8c744375f734ab286098f87bc0b802bbe9
/patient/apps.py
69be906cb849a94acc39c04165642e78e1837278
[]
no_license
hopgausi/egpaf-project
a153444beb2daf8c553d0d76898636a478329a6b
87df3dcca0b6c1a960f1dff9efc4a93fdd0fbdee
refs/heads/main
2023-03-01T18:43:31.542909
2021-02-11T01:57:22
2021-02-11T01:57:22
337,459,906
0
0
null
null
null
null
UTF-8
Python
false
false
89
py
from django.apps import AppConfig class patientConfig(AppConfig): name = 'patient'
[ "jspyhack@gmail.com" ]
jspyhack@gmail.com
a819988d7ff2b5dd395cdf6647f534d1e2bd76d9
ac227cc22d5f5364e5d029a2cef83816a6954590
/applications/physbam/physbam-lib/External_Libraries/Archives/boost/tools/build/v2/test/test2.py
cb74b851f46253b5bae80ccdd8ca872abd5ef6de
[ "BSL-1.0", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
schinmayee/nimbus
597185bc8bac91a2480466cebc8b337f5d96bd2e
170cd15e24a7a88243a6ea80aabadc0fc0e6e177
refs/heads/master
2020-03-11T11:42:39.262834
2018-04-18T01:28:23
2018-04-18T01:28:23
129,976,755
0
0
BSD-3-Clause
2018-04-17T23:33:23
2018-04-17T23:33:23
null
UTF-8
Python
false
false
471
py
#!/usr/bin/python from BoostBuild import Tester, List from time import sleep t = Tester() t.set_tree("test2") t.run_build_system("-sBOOST_BUILD_PATH=" + t.original_workdir + "/..") file_list = 'bin/foo/$toolset/debug/runtime-link-dynamic/' * List("foo foo.o") t.expect_addition(file_list) t.write("foo.cpp", "int main(int, char**) { return 0; }\n") t.run_build_system("-d2 -sBOOST_BUILD_PATH=" + t.original_workdir + "/..") t.expect_touch(file_list) t.pass_test()
[ "quhang@stanford.edu" ]
quhang@stanford.edu
28d7344bcf92d96c8e335aa3a125aa44f7ff2ff3
1a60dbe9eafd5e7fbae95d10ecd1255dff0f6cd8
/stdlogger/outputs/file.py
35671977237c0825543299cb0751ce801b5973be
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
verm666/stdlogger
2dacc9ba49707d6dd722e838ea41745b6dcdd022
8208730d50dce52671d92d1c43ac8b631ec11a02
refs/heads/master
2021-01-15T22:28:56.427660
2011-09-26T20:28:38
2011-09-26T20:28:38
2,327,133
0
0
null
null
null
null
UTF-8
Python
false
false
2,638
py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from threading import Thread import os import time class Output(object): """ Class for redirect logs to file. """ def __init__(self, **kwargs): # set filename if 'filename' not in kwargs: raise ValueError("param 'filename' is required") self.filename = kwargs['filename'] try: self.file = open(self.filename, 'a') except IOError: print("Could not open file: %s" % self.filename) # set max_size if 'max_size' not in kwargs: self.max_size = 2048 else: self.max_size = int(kwargs['max_size']) # set count (integer index. For example: access.log.1) if 'count' not in kwargs: self.count = 10 else: self.count = int(kwargs['count']) # set max_days (date index. For example: access.log.20110905) if 'max_days' not in kwargs: self.max_days = 10 else: self.max_days = int(kwargs['max_days']) # set current date (used in 'date-based' and 'date-size-based' rotation. # see self.__rotate__() self.r_date = int(time.strftime("%Y%m%d")) # "run date" def __rotate__(self, kind='date'): """ Size-based, date-based or both rotation """ if kind == "size": # Size-based rotation size = os.path.getsize(self.filename) if (size >= self.max_size): for i in range(self.count - 1, 0, -1): try: os.rename(self.filename + "." + str(i), self.filename + "." + str(i + 1)) except OSError: pass os.rename(self.filename, self.filename + ".1") self.file.close() self.file = open(self.filename, 'a') elif kind == "date": # Date-based rotation c_date = int(time.strftime("%Y%m%d")) # "current date" if (self.r_date != c_date): os.rename(self.filename, self.filename + "." + str(c_date)) self.file.close() self.file = open(self.filename, 'a') self.r_date = c_date t = Thread(tarage=self.__care_old_files__, args=()) t.start() elif kind == "date_size": pass def processing(self, line): """ Processing line (write line to file/rotate files) """ self.file.write(line) self.__rotate__()
[ "verm666@gmail.com" ]
verm666@gmail.com
04a0ae35c0b49d0518e6a68d481f6e317f214115
3a8c2bd3b8df9054ed0c26f48616209859faa719
/Challenges/surroundedRegions.py
570dcbb6b411e6fd035814e01998a9a4779b635f
[]
no_license
AusCommsteam/Algorithm-and-Data-Structures-and-Coding-Challenges
684f1ca2f9ee3c49d0b17ecb1e80707efe305c82
98fb752c574a6ec5961a274e41a44275b56da194
refs/heads/master
2023-09-01T23:58:15.514231
2021-09-10T12:42:03
2021-09-10T12:42:03
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,718
py
""" Surrounded Regions Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. Example: X X X X X O O X X X O X X O X X After running your function, the board should be: X X X X X X X X X X X X X O X X Explanation: Surrounded regions shouldn’t be on the border, which means that any 'O' on the border of the board are not flipped to 'X'. Any 'O' that is not on the border and it is not connected to an 'O' on the border will be flipped to 'X'. Two cells are connected if they are adjacent cells connected horizontally or vertically. """ """ BFS Time: O(MN) Space: O(N) """ class Solution: def solve(self, board: List[List[str]]) -> None: """ Do not return anything, modify board in-place instead. """ queue = collections.deque() for i in range(len(board)): for j in range(len(board[0])): if (i == 0 or i == len(board)-1 or j == 0 or j == len(board[0])-1) and board[i][j] == 'O': queue.append((i, j)) directions = [(1, 0), (-1, 0), (0, -1), (0, 1)] while queue: i, j = queue.popleft() if 0 <= i < len(board) and 0 <= j < len(board[0]) and board[i][j] == 'O': board[i][j] = 'D' for di, dj in directions: queue.append((i + di, j + dj)) for i in range(len(board)): for j in range(len(board[0])): if board[i][j] == 'O': board[i][j] = 'X' elif board[i][j] == 'D': board[i][j] = 'O'
[ "bennyhwanggggg@users.noreply.github.com" ]
bennyhwanggggg@users.noreply.github.com
3d59814cd8d4c6d2a9fc0c9ed16e2cddfe7045f4
e44674fc2960c62812eeaa4232b6829b0273a1d0
/attacks/cw_l2.py
7f1445d77d8c3e3f4018628be21d15a047750f37
[ "MIT" ]
permissive
psturmfels/adversarial_faces
890190582e158f2faa8550961b4420898a623953
e193a8a5b16a1085ddfe52150aa7f7a57bfa7a31
refs/heads/master
2023-01-28T09:32:02.861184
2020-12-04T00:00:32
2020-12-04T00:00:32
242,216,749
0
0
null
null
null
null
UTF-8
Python
false
false
5,664
py
""" Implements the L2 version of the Carlini-Wagner attack. Ported into TensorFlow 2.0 from: https://github.com/carlini/nn_robust_attacks/blob/master/li_attack.py and https://github.com/bethgelab/foolbox/blob/3999d4334969b7d3debdf846f3f0965eb9032013/foolbox/attacks/carlini_wagner.py """ import tensorflow as tf import numpy as np from tqdm import tqdm from .attack import Attacker class CWAttacker(Attacker): def _get_default_kwargs(self, kwargs): """ Defines some default hyper-parameter values. Args: kwargs: A parameter dictionary. """ if 'max_iterations' not in kwargs: kwargs['max_iterations'] = 1000 if 'initial_const' not in kwargs: kwargs['initial_const'] = 1e-5 if 'learning_rate' not in kwargs: kwargs['learning_rate'] = 5e-3 if 'largest_const' not in kwargs: kwargs['largest_const'] = 2e+1 if 'const_factor' not in kwargs: kwargs['const_factor'] = 2.0 if 'success_distance' not in kwargs: kwargs['success_distance'] = 1.242 if 'initial_perturbation_dist' not in kwargs: kwargs['initial_perturbation_dist'] = 0.025 if 'verbose' not in kwargs: kwargs['verbose'] = False if 'attack_criteria' not in kwargs: kwargs['attack_criteria'] = 'all' # One of all, any or mean return kwargs def _to_attack_space(self, x, bounds): """ Converts a tensor to hyperbolic tangent space. Args: x: A tensor bounds: Minimum and maximum values """ min_, max_ = bounds a = (min_ + max_) / 2 b = (max_ - min_) / 2 x = (x - a) / b # map from [min_, max_] to [-1, +1] x = x * 0.999999 # from [-1, +1] to approx. (-1, +1) x = tf.atanh(x) # from (-1, +1) to (-inf, +inf) return x def _to_model_space(self, x, bounds): """ Converts a tensor back into image space. Args: x: A tensor bounds: Minimum and maximum values """ min_, max_ = bounds x = tf.tanh(x) # from (-inf, +inf) to (-1, +1) a = (min_ + max_) / 2 b = (max_ - min_) / 2 x = x * b + a # map from (-1, +1) to (min_, max_) return x def self_distance_attack(self, image_batch, epsilon=0.025, **kwargs): """ Attacks a batch of images using the Carlini Wagner attack and the self-distance strategy. Args: image_batch: A batch of images. epsilon: Amount of initial perturbation. kwargs: Varies depending on attack. """ kwargs = self._get_default_kwargs(kwargs) bounds = tf.reduce_min(image_batch), tf.reduce_max(image_batch) # Initialize the perturbed example noise = self._generate_noise(epsilon, image_batch) initial_w_value = tf.clip_by_value(noise + image_batch, bounds[0], bounds[1]) initial_w_value = self._to_attack_space(initial_w_value, bounds) perturbation_w = tf.Variable(initial_w_value) original_embedding = self.model(image_batch) original_embedding = self._l2_normalize(original_embedding) optimizer = tf.keras.optimizers.Adam(learning_rate=kwargs['learning_rate']) current_c = kwargs['initial_const'] while current_c <= kwargs['largest_const']: perturbation_w.assign(initial_w_value) def loss(): x_plus_delta = self._to_model_space(perturbation_w, bounds) delta = x_plus_delta - image_batch perturbed_embedding = self.model(x_plus_delta) perturbed_embedding = self._l2_normalize(perturbed_embedding) # Negative sign because we want to maximimize the distance model_loss = -self._l2_distance(original_embedding, perturbed_embedding) norm_loss = self._l2_norm(delta, axis=(1, 2, 3)) return current_c * model_loss + norm_loss iterable = range(kwargs['max_iterations']) if kwargs['verbose']: print('Trying attack with c = {:.4f}'.format(current_c)) iterable = tqdm(iterable) for _ in iterable: optimizer.minimize(loss, [perturbation_w]) # Now we check if we have succeeded in our attack x_plus_delta = self._to_model_space(perturbation_w, bounds) perturbed_embedding = self.model(x_plus_delta) perturbed_embedding = self._l2_normalize(perturbed_embedding) model_loss = self._l2_distance(original_embedding, perturbed_embedding) if kwargs['attack_criteria'] == 'all': succeeded = tf.reduce_all(model_loss > kwargs['success_distance']) elif kwargs['attack_criteria'] == 'any': succeeded = tf.reduce_any(model_loss > kwargs['success_distance']) elif kwargs['attack_criteria'] == 'mean': succeeded = tf.reduce_mean(model_loss) > kwargs['success_distance'] if succeeded: if kwargs['verbose']: print('Attack succeeded with c = {:.4f}'.format(current_c)) return x_plus_delta # If we made it here, we have to increase the constant and try again current_c = current_c * 2.0 if kwargs['verbose']: print('Attack failed. Returning None.') # Return None in the case of failure return None
[ "psturm@cs.washington.edu" ]
psturm@cs.washington.edu
7b11a37746ad28f3e18303de213f4beb2bbb4404
315450354c6ddeda9269ffa4c96750783963d629
/CMSSW_7_0_4/src/SimTotem/RPTimingDetectorsDigiProducer/python/BeamMisalignmentFinder.py
3ff7d944d97f722285c3413832867036093dcd54
[]
no_license
elizamelo/CMSTOTEMSim
e5928d49edb32cbfeae0aedfcf7bd3131211627e
b415e0ff0dad101be5e5de1def59c5894d7ca3e8
refs/heads/master
2021-05-01T01:31:38.139992
2017-09-12T17:07:12
2017-09-12T17:07:12
76,041,270
0
2
null
null
null
null
UTF-8
Python
false
false
6,414
py
import ROOT import os import argparse import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit from scipy import exp parser = argparse.ArgumentParser(description='Finds beam misaligned between given template and misaligned ntuple') parser.add_argument('template_file', metavar='template_file', type=str, nargs=1, help='File containing ntuple used as template to find misaligned') parser.add_argument('misaligned_file', metavar='misaligned_file', type=str, nargs=1, help='File containing misaligned ntuple') args = parser.parse_args() ROOT.gROOT.ProcessLine('.include ' + os.environ['CMSSW_BASE'] + '/src') ROOT.gROOT.ProcessLine( '.L ' + os.environ['CMSSW_BASE'] + '/src/TotemAnalysis/TotemNtuplizer/interface/RPTimingDetectorsNtuplizerHit.h+g') tree_name = 'TotemNtuple' hit_source_types = ["reco", "filtered", "tracking_pot_210_far", "tracking_pot_220_far"] ids = { "reco": ["%03d" % id for id in [20, 21, 120, 121]] } ids["filtered"] = ids["reco"] ids["tracking_pot_220_far"] = ids["reco"] ids["tracking_pot_210_far"] = ids["reco"] tracking_pot_maps = { "tracking_pot_220_far": { "020": "24", "021": "25", "120": "124", "121": "125" }, "tracking_pot_210_far": { "020": "4", "021": "5", "120": "104", "121": "105" } } def get_branch_name(detector_id, type): if type == "geant": return 'rp_timing_detector_%s_hits' % detector_id elif type == "reco": return 'rp_timing_detector_%s_reco_hits' % detector_id elif type == "filtered": return 'rp_timing_detector_%s_filtered_hits' % detector_id elif type == "tracking_pot_220_far": return 'rp_timing_detector_%s_tracking_pot_%03.d' % (detector_id, int(tracking_pot_maps[type][detector_id])) elif type == "tracking_pot_210_far": return 'rp_timing_detector_%s_tracking_pot_%03.d' % (detector_id, int(tracking_pot_maps[type][detector_id])) def load_ntuple(file_path): tree_path = '/'.join([file_path, tree_name]) tchain = ROOT.TChain('TotemNtuple', '') tchain.Add(tree_path) return tchain def gauss(x, a, x0, sigma): return a*exp(-(x-x0)**2/(2*sigma**2)) def cut_zero_bins(histogram, bins): first = histogram.index(next(x for x in histogram if x != 0)) last = (len(histogram) - 1) - histogram[::-1].index( next(x for x in histogram[::-1] if x != 0)) hist_x = bins[first:last + 1] hist_y = histogram[first:last + 1] return hist_x, hist_y def fit_gauss(x, y): gauss_params, pcov = curve_fit(gauss, x, y, p0=[1., 0., 1.]) return gauss_params, np.sqrt(np.diag(pcov)) def find_misalignment(template_data, misaligned_data): sum = 0.0 number = 0.0 template_error = 0.0 misaligned_error = 0.0 for bin_width in list(np.arange(0.1, 1.1, 0.1))[::-1]: try: histogram_bins = np.arange(-20, 20, bin_width) template_histogram = list(np.histogram(template_data, bins=histogram_bins)[0]) misaligned_histogram = list(np.histogram(misaligned_data, bins=histogram_bins)[0]) template_x, template_y = cut_zero_bins(template_histogram, histogram_bins) misaligned_x, misaligned_y = cut_zero_bins(misaligned_histogram, histogram_bins) template_gauss_params, template_standard_deviation_error = fit_gauss(template_x, template_y) misaligned_gauss_params, misaligned_standard_deviation_error = fit_gauss(misaligned_x, misaligned_y) template_error += template_standard_deviation_error[1] misaligned_error += misaligned_standard_deviation_error[1] template_x0 = template_gauss_params[1] misaligned_x0 = misaligned_gauss_params[1] # plt.plot(misaligned_x, misaligned_y, 'b+:', label='data') # plt.plot(misaligned_x, gauss(misaligned_x, *misaligned_gauss_params), 'ro:', label='fit') # plt.legend() # plt.savefig("foo.png") sum += (misaligned_x0 - template_x0) number += 1 except RuntimeError: # print "result not found for %.2f bins width" % bin_width pass if number > 0: return sum/number, template_error/number, misaligned_error/number raise Exception('Cannot find misalignment') if __name__ == "__main__": template_file_name = args.template_file[0] misaligned_file_name = args.misaligned_file[0] template_ntuple = load_ntuple(template_file_name) misaligned_ntuple = load_ntuple(misaligned_file_name) # check sizes if template_ntuple.GetEntries() != misaligned_ntuple.GetEntries(): print "Error, all sources must have te same number of events" exit(-1) sources_ntuples_types = ["template", "misaligned"] hits_histograms = {} for ntuple_type in sources_ntuples_types: hits_histograms[ntuple_type] = {} for hit_type in hit_source_types: hits_histograms[ntuple_type][hit_type] = {} for id in ids[hit_type]: hits_histograms[ntuple_type][hit_type][id] = [] for source_name, source_ntuple in zip(sources_ntuples_types, [template_ntuple, misaligned_ntuple]): for event in source_ntuple: for type in hit_source_types: for id in ids[type]: for hits_vector in getattr(event, get_branch_name(id, type)): if type in ["reco", "filtered"]: hits_histograms[source_name][type][id].append(hits_vector.position.x) elif type in ["tracking_pot_210_far", "tracking_pot_220_far"]: hits_histograms[source_name][type][id].append(hits_vector.x) sum = 0.0 number = 0.0 print "Calculated misalignment" for type in hit_source_types: for id in ids[type]: result, template_error, misaligned_error = \ find_misalignment(hits_histograms["template"][type][id], hits_histograms["misaligned"][type][id]) sum += result number += 1 print '%s %.2fmm; standard deviation error: template: %.2f misaligned: %.2f' % (get_branch_name(id, type), result, template_error, misaligned_error) print 'Average %.2fmm' % (sum/number)
[ "eliza@cern.ch" ]
eliza@cern.ch
dece0de38d388908615b7dfa117a5a0a64cc883f
fe40fb53bdeb3d693174a57fe336503e92fe299b
/eheritage/utils.py
f8dbc0756aecfe7426966fb4198086045afbacea
[ "BSD-2-Clause" ]
permissive
uq-eresearch/eheritage
8c8d096d43888e6e41fbbacdf55f2c6808bace27
e4a2f01c56d438d8b3f4de63d50d979a8105d652
refs/heads/master
2022-07-18T19:21:53.224175
2016-08-05T02:40:08
2016-08-05T02:40:08
18,045,275
0
0
BSD-3-Clause
2022-07-06T19:49:44
2014-03-23T22:33:56
HTML
UTF-8
Python
false
false
281
py
from flask.json import JSONEncoder class IterableAwareEncoder(JSONEncoder): def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) return JSONEncoder.default(self, o)
[ "damien@omad.net" ]
damien@omad.net
d79cce936c0204d7a981d5be8ec0003d8e75651e
84dc366925e685fb36ad06ccda4678ee0e0e6f6c
/CModule_Pytorch/utils/utils.py
bd8c4dce524f98ffb38a73116b3e6a138697d6c5
[]
no_license
thanhpt55/Efficientnet-Pytorch
def9ea6dd6726034a6f514b8a7729077767b7977
40648b9d8ed5ea4d9c5ecbb73eead24652fc23c2
refs/heads/master
2022-12-21T20:41:22.919313
2020-09-18T03:32:58
2020-09-18T03:32:58
null
0
0
null
null
null
null
UTF-8
Python
false
false
12,993
py
from torchvision import transforms import sys import os import torch.nn as nn import torch.nn.functional as F import torch import numpy as np import skimage from prettytable import PrettyTable from gpuinfo import GPUInfo import cv2 import json def set_GPU(num_of_GPUs): current_memory_gpu = GPUInfo.gpu_usage()[1] list_available_gpu = np.where(np.array(current_memory_gpu) < 1500)[0].astype('str').tolist() current_available_gpu = ",".join(list_available_gpu) if len(list_available_gpu) < num_of_GPUs: print("==============Warning==============") print("Your process had been terminated") print("Please decrease number of gpus you using") print(f"number of Devices available:\t{len(list_available_gpu)} gpu(s)") print(f"number of Device will use:\t{num_of_GPUs} gpu(s)") sys.exit() elif len(list_available_gpu) > num_of_GPUs: redundant_gpu = len(list_available_gpu) - num_of_GPUs list_available_gpu = list_available_gpu[:redundant_gpu] current_available_gpu = ",".join(list_available_gpu) print("[DEBUG]***********************************************") print(f"[DEBUG]You are using GPU(s): {current_available_gpu}") print("[DEBUG]***********************************************") os.environ["CUDA_VISIBLE_DEVICES"] = current_available_gpu else: print("[DEBUG]***********************************************") print(f"[DEBUG]You are using GPU(s): {current_available_gpu}") print("[DEBUG]***********************************************") os.environ["CUDA_VISIBLE_DEVICES"] = current_available_gpu def preprocess_input(image, advprop=False): if advprop: normalize = transforms.Lambda(lambda img: img * 2.0 - 1.0) else: normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],\ std=[0.229, 0.224, 0.225]) preprocess_image = transforms.Compose([transforms.ToTensor(), normalize])(image) return preprocess_image def to_onehot(labels, num_of_classes): if type(labels) is list: labels = [int(label) for label in labels] arr = np.array(labels, dtype=np.int) onehot = np.zeros((arr.size, num_of_classes)) onehot[np.arange(arr.size), arr] = 1 else: onehot = np.zeros((num_of_classes,), dtype=np.int) onehot[int(labels)] = 1 return onehot def multi_threshold(Y, thresholds): if Y.shape[-1] != len(thresholds): raise ValueError('Mismatching thresholds and output classes') thresholds = np.array(thresholds) thresholds = thresholds.reshape((1, thresholds.shape[0])) keep = Y > thresholds score = keep * Y class_id = np.argmax(score, axis=-1) class_score = np.max(score, axis=-1) if class_score == 0: return None return class_id, class_score def load_and_crop(image_path, input_size=0, custom_size=None): """ Load image and return image with specific crop size This function will crop corresponding to json file and will resize respectively input_size Input: image_path : Ex:Dataset/Train/img01.bmp input_size : any specific size Output: image after crop and class gt """ image = cv2.imread(image_path) print(image_path) json_path = image_path + ".json" image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) size_image = image.shape try : with open(json_path, encoding='utf-8') as json_file: json_data = json.load(json_file) box = json_data['box'] center_x = box['centerX'][0] center_y = box['centerY'][0] widthBox = box['widthBox'][0] heightBox = box['heightBox'][0] class_gt = json_data['classId'][0] except: print(f"Can't find or missing some fields: {json_path}") # Crop center image if no json found center_x = custom_size[0] center_y = custom_size[1] widthBox = 0 heightBox = 0 class_gt = "Empty" new_w = max(widthBox, input_size) new_h = max(heightBox, input_size) left, right = center_x - new_w / 2, center_x + new_w / 2 top, bottom = center_y - new_h / 2, center_y + new_h / 2 left, top = round(max(0, left)), round(max(0, top)) right, bottom = round(min(size_image[1] - 0, right)), round(min(size_image[0] - 0, bottom)) cropped_image = image[int(top):int(bottom), int(left):int(right)] # if input_size > new_w: # changed_image = cv2.resize(cropped_image,(input_size, input_size)) # else: # changed_image = cropped_image return cropped_image, class_gt def metadata_count(input_dir,classes_name_list, label_list, show_table): Table = PrettyTable() print(f"[DEBUG] : {input_dir}") # print(classes_name_list) # print(label_list) Table.field_names = ['Defect', 'Number of images'] unique_label ,count_list = np.unique(label_list, return_counts=True) # print(count_list) for i in range(len(classes_name_list)): for j in range(len(unique_label)): if classes_name_list[i] == unique_label[j] : Table.add_row([classes_name_list[i], count_list[j]]) if show_table : print(f"[DEBUG] :\n{Table}") return classes_name_list, label_list class FocalLoss(nn.Module): # Took from : https://discuss.pytorch.org/t/is-this-a-correct-implementation-for-focal-loss-in-pytorch/43327/8 # Addition resource : https://www.kaggle.com/c/tgs-salt-identification-challenge/discussion/65938 # TODO: clean up FocalLoss class def __init__(self, class_weight=1., gamma=2., logits = False, reduction='mean'): super(FocalLoss, self).__init__() self.class_weight = class_weight self.gamma = gamma self.logits = logits self.reduction = reduction def forward(self, inputs, targets): # if self.logits: # BCE_loss = F.binary_cross_entropy_with_logits(inputs, targets, reduce=False) # else: # BCE_loss = F.binary_cross_entropy(inputs, targets, reduce=False) # pt = torch.exp(-BCE_loss) # F_loss = self.class_weight * (1 - pt)**self.gamma * BCE_loss log_prob = F.log_softmax(inputs, dim=-1) prob = torch.exp(log_prob) return F.nll_loss( ((1 - prob) ** self.gamma) * log_prob, targets, weight = self.class_weight, reduction = self.reduction ) # TODO: inspect resize_image more carefully def resize_image(image, min_dim=None, max_dim=None, min_scale=None, mode="square"): """Resizes an image keeping the aspect ratio unchanged. min_dim: if provided, resizes the image such that it's smaller dimension == min_dim max_dim: if provided, ensures that the image longest side doesn't exceed this value. min_scale: if provided, ensure that the image is scaled up by at least this percent even if min_dim doesn't require it. mode: Resizing mode. none: No resizing. Return the image unchanged. square: Resize and pad with zeros to get a square image of size [max_dim, max_dim]. pad64: Pads width and height with zeros to make them multiples of 64. If min_dim or min_scale are provided, it scales the image up before padding. max_dim is ignored in this mode. The multiple of 64 is needed to ensure smooth scaling of feature maps up and down the 6 levels of the FPN pyramid (2**6=64). crop: Picks random crops from the image. First, scales the image based on min_dim and min_scale, then picks a random crop of size min_dim x min_dim. Can be used in training only. max_dim is not used in this mode. Returns: image: the resized image window: (y1, x1, y2, x2). If max_dim is provided, padding might be inserted in the returned image. If so, this window is the coordinates of the image part of the full image (excluding the padding). The x2, y2 pixels are not included. scale: The scale factor used to resize the image padding: Padding added to the image [(top, bottom), (left, right), (0, 0)] """ # Keep track of image dtype and return results in the same dtype import cv2 image_dtype = image.dtype # Default window (y1, x1, y2, x2) and default scale == 1. h, w = image.shape[:2] window = (0, 0, h, w) scale = 1 padding = [(0, 0), (0, 0), (0, 0)] crop = None if mode == "none": return image, window, scale, padding, crop # Scale? if min_dim: # Scale up but not down scale = max(1, min_dim / min(h, w)) if min_scale and scale < min_scale: scale = min_scale # Does it exceed max dim? if max_dim and mode == "square": image_max = max(h, w) if round(image_max * scale) > max_dim: scale = max_dim / image_max # Resize image using bilinear interpolation if scale != 1: # image = cv2.resize(image, (round(h*scale), round(w*scale)), interpolation=cv2.INTER_LINEAR) image = skimage.transform.resize( image, (round(h * scale), round(w * scale)), order=1, mode="constant", preserve_range=True) # Need padding or cropping? if mode == "square": # Get new height and width h, w = image.shape[:2] top_pad = (max_dim - h) // 2 bottom_pad = max_dim - h - top_pad left_pad = (max_dim - w) // 2 right_pad = max_dim - w - left_pad padding = [(top_pad, bottom_pad), (left_pad, right_pad), (0, 0)] image = np.pad(image, padding, mode='constant', constant_values=0) window = (top_pad, left_pad, h + top_pad, w + left_pad) elif mode == "pad64": h, w = image.shape[:2] # Both sides must be divisible by 64 assert min_dim % 64 == 0, "Minimum dimension must be a multiple of 64" # Height if h % 64 > 0: max_h = h - (h % 64) + 64 top_pad = (max_h - h) // 2 bottom_pad = max_h - h - top_pad else: top_pad = bottom_pad = 0 # Width if w % 64 > 0: max_w = w - (w % 64) + 64 left_pad = (max_w - w) // 2 right_pad = max_w - w - left_pad else: left_pad = right_pad = 0 padding = [(top_pad, bottom_pad), (left_pad, right_pad), (0, 0)] image = np.pad(image, padding, mode='constant', constant_values=0) window = (top_pad, left_pad, h + top_pad, w + left_pad) elif mode == "crop": # Pick a random crop h, w = image.shape[:2] y = random.randint(0, (h - min_dim)) x = random.randint(0, (w - min_dim)) crop = (y, x, min_dim, min_dim) image = image[y:y + min_dim, x:x + min_dim] window = (0, 0, min_dim, min_dim) else: raise Exception("Mode {} not supported".format(mode)) return image.astype(image_dtype), window, scale, padding, crop class CustomDataParallel(nn.DataParallel): """ force splitting data to all gpus instead of sending all data to cuda:0 and then moving around. """ def __init__(self, module, num_gpus): super().__init__(module) self.num_gpus = num_gpus def scatter(self, inputs, kwargs, device_ids): # More like scatter and data prep at the same time. The point is we prep the data in such a way # that no scatter is necessary, and there's no need to shuffle stuff around different GPUs. devices = ['cuda:' + str(x) for x in range(self.num_gpus)] splits = inputs[0].shape[0] // self.num_gpus if splits == 0: raise Exception('Batchsize must be greater than num_gpus.') return [(inputs[0][splits * device_idx: splits * (device_idx + 1)].to(f'cuda:{device_idx}', non_blocking=True))\ for device_idx in range(len(devices))], [kwargs] * len(devices) def patch_replication_callback(data_parallel): """ Monkey-patch an existing `DataParallel` object. Add the replication callback. Useful when you have customized `DataParallel` implementation. Examples: > sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) > sync_bn = DataParallel(sync_bn, device_ids=[0, 1]) > patch_replication_callback(sync_bn) # this is equivalent to > sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) > sync_bn = DataParallelWithCallback(sync_bn, device_ids=[0, 1]) """ assert isinstance(data_parallel, DataParallel) old_replicate = data_parallel.replicate @functools.wraps(old_replicate) def new_replicate(module, device_ids): modules = old_replicate(module, device_ids) execute_replication_callbacks(modules) return modules data_parallel.replicate = new_replicate
[ "turing@emageai.com" ]
turing@emageai.com
22274fc64978d6fbf2abfb1060b193c21cbe7bf9
14bfd073b8ddb556acdc2fee88f88c0b30d3a745
/store/migrations/0002_variation.py
77690a2c7ab7caca20c48db8444cad87afdd5e80
[]
no_license
thilanse/greatkart-django
e29c45244e9e6c7f25c0c3de4642ecfbe86f2d31
44c2d6cd476f700e75104605c142b7ea3f75b571
refs/heads/master
2023-05-31T12:35:13.613769
2021-06-20T06:31:11
2021-06-20T06:31:11
372,538,602
0
0
null
null
null
null
UTF-8
Python
false
false
918
py
# Generated by Django 3.1 on 2021-06-06 07:32 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('store', '0001_initial'), ] operations = [ migrations.CreateModel( name='Variation', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('variation_category', models.CharField(choices=[('color', 'color'), ('size', 'size')], max_length=100)), ('variation_value', models.CharField(max_length=100)), ('is_active', models.BooleanField(default=True)), ('created_date', models.DateTimeField(auto_now=True)), ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='store.product')), ], ), ]
[ "thilansenanayake@gmail.com" ]
thilansenanayake@gmail.com
c75f937366c08e5b63af4b9e6aefd59a0a5c040f
25621da01d7193f6ae847953937b18c095d32258
/plugins/operators/load_fact.py
ebf85cdd6cf797b3b9308c21d73a2e48374e61d4
[]
no_license
fpcarneiro/data-pipelines-with-airflow
95de37b231a1c95414661db726847616051e995d
e477930e2817ad4d41f09148e8dbb975232b4434
refs/heads/master
2020-07-24T10:57:58.283392
2019-09-17T18:07:38
2019-09-17T18:07:38
207,901,219
0
0
null
null
null
null
UTF-8
Python
false
false
1,143
py
from airflow.hooks.postgres_hook import PostgresHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class LoadFactOperator(BaseOperator): ui_color = '#F98866' @apply_defaults def __init__(self, # Define your operators params (with defaults) here # Example: # conn_id = your-connection-name redshift_conn_id, table_to, query, *args, **kwargs): super(LoadFactOperator, self).__init__(*args, **kwargs) self.redshift_conn_id = redshift_conn_id self.table = table_to self.query = query self.autocommit = True def execute(self, context): self.log.info(f'Initializing INSERT into {self.table} table...') self.hook = PostgresHook(postgres_conn_id=self.redshift_conn_id) insert_sql = f""" INSERT INTO {self.table} {self.query}; COMMIT; """ self.hook.run(insert_sql, self.autocommit) self.log.info(f"INSERT into {self.table} command complete!")
[ "fpcar@yahoo.com.br" ]
fpcar@yahoo.com.br
a40004ba548e520cede3f28efbf8c20e012e0185
373cd41477438cc8826cd2a2f8689be84f486339
/msticpy/config/ce_data_providers.py
461dd3a6013e76b92a7875acbbc937f2d5327b61
[ "LicenseRef-scancode-generic-cla", "LGPL-3.0-only", "BSD-3-Clause", "LicenseRef-scancode-free-unknown", "ISC", "LGPL-2.0-or-later", "PSF-2.0", "Apache-2.0", "BSD-2-Clause", "LGPL-2.1-only", "Unlicense", "Python-2.0", "LicenseRef-scancode-python-cwi", "MIT", "LGPL-2.1-or-later", "GPL-2.0-or-later", "HPND", "ODbL-1.0", "GPL-1.0-or-later", "MPL-2.0" ]
permissive
RiskIQ/msticpy
cd42d601144299ec43631554076cc52cbb42dc98
44b1a390510f9be2772ec62cb95d0fc67dfc234b
refs/heads/master
2023-08-27T00:11:30.098917
2021-06-17T22:54:29
2021-06-17T22:54:29
374,787,165
1
0
MIT
2021-09-16T19:05:43
2021-06-07T20:05:09
Python
UTF-8
Python
false
false
1,049
py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Data Providers Component Edit.""" from .._version import VERSION from .ce_provider_base import CEProviders, HELP_URIS __version__ = VERSION __author__ = "Ian Hellen" # pylint: disable=too-many-ancestors, duplicate-code class CEDataProviders(CEProviders): """Data providers edit component.""" _DESCRIPTION = "Settings for Data Providers" _COMP_PATH = "DataProviders" # _HELP_TEXT inherited from base _HELP_URI = { "Data Providers": ( "https://msticpy.readthedocs.io/en/latest/" + "DataAcquisition.html" ), **HELP_URIS, } _COMPONENT_HELP = """ <p><b>LocalData provider <i>data_paths</i></b> Enter one or more data paths, separated by new lines </p> """
[ "noreply@github.com" ]
RiskIQ.noreply@github.com
367cdaa2588a8d236c60d962af442c3a618499d2
aecaa97a62610a8821c6b9991eb2a9e6af056922
/backend/wallet/transaction.py
23985990776c99e5ab1e38bc72dc35a1c15e4248
[]
no_license
shanni12/Blockchain
b720385113a2556ac25545c15b870afcac922c2c
331faaab253c2e8baf040068931a60ac23224eec
refs/heads/master
2022-11-25T07:53:32.200270
2020-07-30T17:34:43
2020-07-30T17:34:43
283,831,388
0
0
null
null
null
null
UTF-8
Python
false
false
2,689
py
import uuid import time from backend.wallet.wallet import Wallet from backend.config import MINING_REWARD,MINING_REWARD_INPUT class Transaction: def __init__(self,sender_wallet=None,recipient=None,amount=None,id=None,output=None,input=None): self.id=id or str(uuid.uuid4())[0:8] self.output=output or self.create_output( sender_wallet, recipient, amount ) self.input=input or self.create_input(sender_wallet,self.output) def create_output(self,sender_wallet,recipient,amount): if amount>sender_wallet.balance: raise Exception('Amount exceeds balance') output={ } output[recipient]=amount output[sender_wallet.address]=sender_wallet.balance-amount return output def create_input(self,sender_wallet,output): return { 'timestamp':time.time_ns(), 'amount':sender_wallet.balance, 'address':sender_wallet.address, 'public_key':sender_wallet.public_key, 'signature':sender_wallet.sign(output) } def update(self,sender_wallet,recipient,amount): if amount>self.output[sender_wallet.address]: raise Exception('Amount exceeds balance') if recipient in self.output: self.output[recipient]=self.output[recipient]+amount else: self.output[recipient]=amount self.output[sender_wallet.address]=self.output[sender_wallet.address]-amount self.input=self.create_input(sender_wallet,self.output) def to_json(self): return self.__dict__ @staticmethod def from_json(transaction_json): return Transaction(**transaction_json ) @staticmethod def is_valid_transaction(transaction): if transaction.input==MINING_REWARD_INPUT: if list(transaction.output.values())!=[MINING_REWARD]: raise Exception('Invalid mining reward') return output_total=sum(transaction.output.values()) if transaction.input['amount']!=output_total: raise Exception('Invalid transaction output values') if not Wallet.verify(transaction.input['public_key'],transaction.output,transaction.input['signature']): raise Exception('Invalid signature') @staticmethod def reward_transaction(miner_wallet): output={} output[miner_wallet.address]=MINING_REWARD return Transaction(input=MINING_REWARD_INPUT,output=output) def main(): transaction=Transaction(Wallet(),'recipient',15) print(f'transaction.__dict__:{transaction.__dict__}') if __name__=='__main__': main()
[ "sdshahanaj180@gmail.com" ]
sdshahanaj180@gmail.com
03de0fc83a788151f867f5df447891d4ac6214e8
bc759393672f8e2bf40136691460713ea7ba2e97
/robocar/distance_sensor2.py
0d4faea2a8d84d1c264f7f0bfff1301bdf924ab3
[]
no_license
gordongekko67/robocar
3c98a2f6f04fd9a8b3d9f12450fbfa446ded88db
7d6fbdc2ea57cbc46597458356aa499e40fdb7bd
refs/heads/master
2022-12-17T18:11:12.889197
2020-09-10T10:47:39
2020-09-10T10:47:39
294,380,202
0
0
null
null
null
null
UTF-8
Python
false
false
1,694
py
#!/usr/bin/env python # license removed for brevity import rospy from std_msgs.msg import String import RPi.GPIO as GPIO import time # GPIO Mode (BOARD / BCM) GPIO.setmode(GPIO.BCM) # set GPIO Pins GPIO_TRIGGER = 20 GPIO_ECHO = 21 # set GPIO direction (IN / OUT) GPIO.setup(GPIO_TRIGGER, GPIO.OUT) GPIO.setup(GPIO_ECHO, GPIO.IN) dist = 0.00 def talker(dist): pub = rospy.Publisher('sensore_distanza2', String, queue_size=10) rospy.init_node('distance_sensor2', anonymous=True) rate = rospy.Rate(10) # 10hz while not rospy.is_shutdown(): dist_str = "Distance 2 = " + str(dist) rospy.loginfo(dist_str) pub.publish(dist_str) rate.sleep() def distance(): # set Trigger to HIGH GPIO.output(GPIO_TRIGGER, True) # set Trigger after 0.01ms to LOW time.sleep(0.00001) GPIO.output(GPIO_TRIGGER, False) StartTime = time.time() StopTime = time.time() # save StartTime while GPIO.input(GPIO_ECHO) == 0: StartTime = time.time() # save time of arrival while GPIO.input(GPIO_ECHO) == 1: StopTime = time.time() # time difference between start and arrival TimeElapsed = StopTime - StartTime # multiply with the sonic speed (34300 cm/s) # and divide by 2, because there and back distance = (TimeElapsed * 34300) / 2 return distance if __name__ == '__main__': try: while True: dist = distance() print("Measured Distance 2 = %.1f cm" % dist) talker(dist) time.sleep(1) # Reset by pressing CTRL + C except KeyboardInterrupt: print("Measurement stopped by User") GPIO.cleanup()
[ "noreply@github.com" ]
gordongekko67.noreply@github.com
4b73eae85e7d5060c6775ebd859a11f41185e949
ee489a6f449d4a26bb64510e8f1bc7f03f3b090a
/description.py
429a125e7397d3d647bc4269c5c8efdd5ff73633
[]
no_license
eduardo-and/Normalize-Data
dd922d37cb39420514b771e18123c97799b60fb4
5e70466cb8521182f81481c1cad9588df0f04f99
refs/heads/master
2022-11-04T19:25:16.134886
2020-06-19T00:45:47
2020-06-19T00:45:47
273,363,098
0
0
null
null
null
null
UTF-8
Python
false
false
2,675
py
import normalization as norm import pandas as pd import numpy as np # # The library performs data normalization using two techniques, "0 to 1" and score-z. The function accepts the following entries: list, DataFrame pandas, # Series pandas, and numPy array. The format of the output is the same as the input. If the data contains a column (or a 1-dimension array) with string # or boolean data, the function will not apply normalization. # # # Functions: # The library has two functions: # # 1# normalizeData(data,opt) # This function performs the recognition of the data type and converts it to list, # once this it passes the data to the auxiliary function "normalize". # data: list,numPy array, DataFrame or Serie # opt: 1(default) to normalize method "1 to 0", or # 2 to normalize method score-z. # # return: the same tipe of input # # # 2# normalize(list,opt) # This is a auxiliar function, she performs the normalization in input exclusively of the list type. # Exclusive use of the first function is recommended, as it is auxiliary to the above function # data: list # opt: 1(default) to normalize method "1 to 0", or # 2 to normalize method score-z. # # return: list dataList = [[121,26,23,64,142],[51451,21,515,132,12],['a1',15,'a2',15,'a3']] dataFrame = pd.DataFrame(data = [[236,632,12,32],['a12',123,654,25],[12,65,122,36],[152,15,12,32]],columns= ["col1","col2","col3","col4"],index = ["a","b","c","d"]) dataSerie = pd.Series([2232,2256,2132,1265,3269,1541,3626,1561,6266,1515,1544,3226,2321,3218,6269,3266,6964,6641,6362,6366,1548,2352],name= "test1") dataArray = np.array([[3211,612,3262,615,166,6216,62165,61265,6515,15585,61651,1566,6365,5641,623],[2326,632,664,1555,3269,2151,621,3155,6529,2161,6326,32623,1513,1515,3620]]) dataSet = pd.read_csv("vgsales.csv") print("List:\n") print(dataList) print("\ndataFrame:\n") print(dataFrame) print("\nSeries:\n") print(dataSerie) print("\nArray\n") print(dataArray) print("\nDataSet:\n") print(dataSet) print("\n") print("List normalized with method 1:\n") print(norm.normalizeData(dataList,1)) print("\n") print("Dataframe normalized with method 2:\n") print(norm.normalizeData(dataFrame,2)) print("\n") print("Serie normalized with method 1:\n") print(norm.normalizeData(dataSerie,1)) print("\n") print("Array normalized with method 2\n") print(norm.normalizeData(dataArray,2)) print("\n") print("Here we have a exemple dataset(Video Game Sales )\n:") print(dataSet.head) print("\n") print("After normalization:") dataSet = norm.normalizeData(dataSet,1) print(dataSet.head)
[ "eduardo.ufg@hotmail.com" ]
eduardo.ufg@hotmail.com
c4ceb5f6147352218943fd33a4665c65102248ef
68103b6b90dad4661d1663c9cbc051210aa6018f
/bookmanage3/book3/apps.py
08a1f4cd71c02b6b60d455e53bb46b9f4b1ad67f
[]
no_license
tiantao-94/python01
c45aeca2a79c2c7dfa33a8a155a21c7333cda695
2404003a80db330543b327c7c1e0b5bb57addd6d
refs/heads/master
2022-12-21T07:52:37.142300
2020-09-27T15:05:10
2020-09-27T15:05:10
297,329,032
0
0
null
null
null
null
UTF-8
Python
false
false
85
py
from django.apps import AppConfig class Book3Config(AppConfig): name = 'book3'
[ "1595328432@qq.com" ]
1595328432@qq.com
2cce3230a7c808e0ea29c2bc2a6e9d058a134ed0
9872c2c3206f1f67c72eb530a6e6446dff952872
/PROCESS_GiftMaster.py
cf868d424d6584d1ad9265f927981a594fbfc16a
[]
no_license
saikatsengupta89/TTS
4a7f15b46367cddbe62753caba14cf2d452d9cd9
8a38c908e1ae2e06b6e7f15be8cc3330d10a0ad1
refs/heads/main
2023-03-06T22:11:50.309639
2021-02-13T21:14:35
2021-02-13T21:14:35
326,279,964
0
0
null
null
null
null
UTF-8
Python
false
false
2,372
py
# Databricks notebook source import pandas as pd import numpy as np from pyspark.sql import types from pyspark.sql.functions import col pathGiftMaster="/mnt/adls/TTS/raw/monthly/gift_master/" pathPRCGiftMaster='/mnt/adls/TTS/processed/references/ref_gift_master' #reading the latest article master from the raw layer in adls yearGM = str(max([int(i.name.replace('/','')) for i in dbutils.fs.ls(pathGiftMaster)])) monthGM= str(max([int(i.name.replace('/','')) for i in dbutils.fs.ls(pathGiftMaster +"/" +str(yearGM))])).zfill(2) #fileName=dbutils.fs.ls(pathGiftMaster+yearGM+"/"+monthGM+"/")[0].name # COMMAND ---------- giftMasterSchema = types.StructType ([ types.StructField("gift_code",types.StringType()), types.StructField("gift_name",types.StringType()), types.StructField("gift_type_name",types.StringType()), types.StructField("gift_type_code",types.StringType()), types.StructField("gift_group",types.StringType()), types.StructField("packing_per_case",types.IntegerType()), types.StructField("UOM",types.StringType()), types.StructField("remaining_sl_policy",types.IntegerType()), types.StructField("color",types.StringType()), types.StructField("size_h",types.DoubleType()), types.StructField("size_w",types.DoubleType()), types.StructField("size_l",types.DoubleType()), types.StructField("grossweight_per_case_kg",types.DoubleType()), types.StructField("netweight_per_pc_gm",types.DoubleType()), types.StructField("dimension_per_case_h",types.DoubleType()), types.StructField("dimension_per_case_w",types.DoubleType()), types.StructField("description",types.StringType()), types.StructField("enabled",types.StringType()), types.StructField("vat",types.StringType()) ]) giftMasterDF= (spark.read .option('header',True) .schema(giftMasterSchema) .csv(pathGiftMaster+yearGM+"/"+monthGM+"/")) #createDataFrame(df, giftMasterSchema) #giftMasterDF.createOrReplaceTempView("gift_master") # for j in range(1,12): # monthGM_dummy= str(max([int(i.name.replace('/','')) for i in dbutils.fs.ls(pathGiftMaster +"/" +str(yearGM))])-j).zfill(2) # (giftMasterDF # .write.mode("overwrite") # .parquet(pathPRCGiftMaster+"/"+yearGM+"/"+monthGM_dummy+"/")) (giftMasterDF .write.mode("overwrite") .parquet(pathPRCGiftMaster+"/"+yearGM+"/"+monthGM+"/")) # COMMAND ----------
[ "noreply@github.com" ]
saikatsengupta89.noreply@github.com
53184abe0b9d0cc7e28ab1ab15066c700988bf39
22bcb68759d516eea70d18116cd434fcd0a9d842
/scrap/booksadda_scrap.py
f8cbcbef3fd0f32b0ab736622fb7afee1cde6327
[]
no_license
lovesh/abhiabhi-web-scrapper
1f5da38c873fea74870d59f61c3c4f52b50f1886
b66fcadc56377276f625530bdf8e739a01cbe16b
refs/heads/master
2021-01-01T17:16:51.577914
2014-10-18T15:56:42
2014-10-18T15:56:42
null
0
0
null
null
null
null
UTF-8
Python
false
false
8,758
py
import downloader import dom import urllib import re import time import datetime import simplejson as json import pymongo from collections import defaultdict import util siteurl='http://www.bookadda.com/' books=[] book_urls=set() logfile=open('bookadda_log.txt','w') dl=downloader.Downloader() dl.addHeaders({'Origin':siteurl,'Referer':siteurl}) debug=True DBName='abhiabhi' temporary=pymongo.Connection().DBName.ba_temporary temporary.create_index('url',unique=True) url_pattern = re.compile('bookadda.com', re.I) def getCategories(): doc=dom.DOM(url=siteurl) category_path='//div[@id="body_container"]//ul[@class="left_menu"][1]/li/a' categories=[[c[0],c[1]] for c in doc.getLinksWithXpath(category_path) if c[1] != 'http://www.bookadda.com/view-books/medical-books'] return categories def getBookUrlsFromPage(html): book_url_path='//ul[@class="results"]//div[@class="details"]//h4/a' page_dom=dom.DOM(string=html) links=set(l[1] for l in page_dom.getLinksWithXpath(book_url_path)) return links def getBookUrlsOfSubcategory(subcategory_url): subcategory_dom=dom.DOM(url=subcategory_url) book_url_path='//ul[@class="results"]//div[@class="details"]//h4/a' book_urls=set(l[1] for l in subcategory_dom.getLinksWithXpath(book_url_path)) result_count_path='//div[@id="search_container"]//div[@class="contentbox"]//div[@class="head"]' count_node=subcategory_dom.getNodesWithXpath(result_count_path) if count_node: count_string=count_node[0].text_content() print count_string count=int(re.search('\d+ of (\d+) result',count_string).group(1)) subcat_col=pymongo.Connection().DBName.ba_subcats subcat_col.update({'subcat_url':subcategory_url},{'$set':{'num_books':count}}) if count>20: page_urls=set(subcategory_url+'?pager.offset='+str(x) for x in xrange(20,count,20)) dl.putUrls(page_urls) subcategory_pages=dl.download() for s in subcategory_pages: status=subcategory_pages[s][0] html=subcategory_pages[s][1] if status > 199 and status < 400: book_urls.update(getBookUrlsFromPage(html)) #print book_urls return book_urls def getAllBookUrls(): global book_urls subcategory_path='//div[@id="left_container"]/ul[@class="left_menu"][1]/li/a' cats=getCategories() subcat_col=pymongo.Connection().DBName.ba_subcats subcat_col.create_index('subcat_url',unique=True) for cat in cats: page=dom.DOM(url=cat[1]) subcats=page.getLinksWithXpath(subcategory_path) for subcat in subcats: try: subcat_col.insert({'subcat':subcat[0].strip('\n\t\r '),'subcat_url':subcat[1],'cat':cat[0],'cat_url':cat[1],'status':0}) except: pass try: subcat_col.insert({'subcat':'Medical','subcat_url':'http://www.bookadda.com/view-books/medical-books','cat':'Medical','status':0}) except: pass subcats=[{'cat':subcat['cat'],'subcat':subcat['subcat'],'subcat_url':subcat['subcat_url']} for subcat in subcat_col.find({'status':0})] start=time.time() for subcat in subcats: print 'Getting book urls of subcategory %s\n\n'%subcat['subcat_url'] logfile.write('Getting book urls of subcategory %s\n\n'%subcat['subcat_url']) logfile.flush() urls=getBookUrlsOfSubcategory(subcat['subcat_url']) for url in urls: try: temporary.insert({'url':url,'subcat_url':subcat['subcat_url'],'categories':[[subcat['cat'],subcat['subcat']],],'status':0}) except pymongo.errors.DuplicateKeyError: temporary.update({'url':url},{'$push':{'categories':[subcat['cat'],subcat['subcat']]}}) print "done with subcategory %s"%subcat['subcat_url'] logfile.write("done with subcategory %s\n\n"%subcat['subcat_url']) subcat_col.update({'subcat_url':subcat['subcat_url']},{'$set':{'status':1}}) finish=time.time() print "All book urls(%d) fetched in %s\n\n"%(len(book_urls),str(finish-start)) logfile.write("All book urls fetched in %s\n\n"%str(finish-start)) logfile.flush() return book_urls def parseBookPage(url=None,string=None): book={} if url: try: doc=dom.DOM(url=url,utf8=True) except: return False else: try: doc=dom.DOM(string=string,utf8=True) except: return False addBox=doc.getNodesWithXpath('//a[@id="addBox"]') url_path='//meta[@property="og:url"]' book['url']=doc.getNodesWithXpath(url_path)[0].get('content').strip() if debug: print book['url'] if url_pattern.search(book['url']) is None: return False if addBox: #availability check book['availability']=1 shipping_path='//span[@class="numofdys"]/strong' shipping=doc.getNodesWithXpath(shipping_path) if shipping: shipping=re.search('(\d+)-(\d+)',shipping[0].text) book['shipping']=[shipping.group(1),shipping.group(2)] else: book['availability']=0 name_path='//div[@class="prdcol2"]/h1' name = doc.getNodesWithXpath(name_path) if len(name) > 0: book['name']=name[0].text_content().strip() image_path='//meta[@property="og:image"]' image=doc.getNodesWithXpath(image_path) if image: book['img_url']=image[0].text_content().strip() desc_path='//div[@class="reviews-box-cont-inner"]' desc=doc.getNodesWithXpath(desc_path) if desc: book['description']=desc[0].text_content().strip() price_path='//span[@class="actlprc"]' price=doc.getNodesWithXpath(price_path) if len(price) > 0: price = price[0].text.strip() book['price']=int(re.search('(\d+)',price).group(1)) book['scraped_datetime']=datetime.datetime.now() book['last_modified_datetime']=datetime.datetime.now() product_history={} if 'price' in book: product_history['price']=book['price'] if 'shipping' in book: product_history['shipping'] = book['shipping'] product_history['availability'] = book['availability'] product_history['datetime'] = book['last_modified_datetime'] book['product_history'] = [product_history,] book['site']='bookadda' tbody_path='//div[@class="grey_background"]/table/tbody' if len(doc.getNodesWithXpath(tbody_path)) == 0: tbody_path='//div[@class="grey_background"]/table' data=doc.parseTBody(tbody_path) if 'author' in data: data['author']=data['author'].encode('utf8').split('\xc2\xa0') util.replaceKey(data,'number of pages','num_pages') util.replaceKey(data,'publishing date','pubdate') util.replaceKey(data,'isbn-13','isbn13') if 'isbn13' in data: data['isbn13']=data['isbn13'].split(',')[0].replace('-','').strip() util.replaceKey(data,'book','name') book.update(data) return book def go(): global books getAllBookUrls() temporary=pymongo.Connection().DBName.ba_temporary con=pymongo.Connection() coll=con[DBName]['scraped_books'] count=1 #so that the following loop starts total=0 #keeps a track of total downloaded books start=time.time() while count>0: docs=temporary.find({'status':0}).limit(500) count=docs.count() urls=[] processed={} urls=[doc['url'] for doc in docs] dl.putUrls(urls,30) result=dl.download() books=[] for r in result: status=str(result[r][0]) html=result[r][1] if int(status) > 199 and int(status) < 400: book=parseBookPage(string=html) if book: books.append(book) if status in processed: processed[status].append(r) else: processed[status]=[r,] coll.insert(books) total+=total+len(books) for status in processed: temporary.update({'url':{'$in':processed[status]}},{'$set':{'status':int(status)}},multi=True) finish=time.time() logfile.write("All books parsed in %s"%str(finish-start)) def prepareXMLFeed(): go() root=dom.XMLNode('books') start=time.time() for book in books: child=root.createChildNode('book') child.createChildNodes(book) f=open('booksadda.xml','w') f.write(root.nodeToString()) f.close() finish=time.time() logfile.write("XML file created in %s"%str(finish-start)) if __name__ == '__main__': go()
[ "lovesh.bond@gmail.com" ]
lovesh.bond@gmail.com
be0b1ecda58d90e672c985713d33a45eff2bee10
0a2c84d6c7e0f65d98ebf8c899b5b357d60a4f84
/all_ticker_details.py
0c5944bf0fc9ca2131b3fb6813c53803b58db032
[]
no_license
Xelanor/StockNinjaPython
6dcff3c2345d2516a45843b188f0b8660f4fe74d
8e01b11fcbd0dc4254b5bc18e2a1ad9469c17ede
refs/heads/master
2020-11-24T15:45:26.520563
2020-02-01T05:43:58
2020-02-01T05:43:58
228,224,085
0
0
null
null
null
null
UTF-8
Python
false
false
1,349
py
from constants.tickers import tickers import json import utils def fetch_all_stocks(): result = [] stock_names = ",".join(tickers) stocks_data = utils.get_current_tickers_data(stock_names) negative = 0 total = 0 for data_dict in stocks_data: price = data_dict["regularMarketPrice"] prevClose = data_dict["regularMarketPreviousClose"] rate = utils.rateCalculator(price, prevClose) negative += 1 if rate < 0 else 0 total += 1 try: stock_name = data_dict["symbol"] stock_dict = { "stockName": stock_name, "price": price, "dayRange": data_dict["regularMarketDayRange"], "rate": rate } result.append(stock_dict) except: pass result.append(negative) result.append(total) return result def result(event, context): prices = fetch_all_stocks() return { 'statusCode': 200, 'headers': { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "Content-Type, authorization", "Access-Control-Allow-Methods": "OPTIONS,POST,GET" }, 'body': json.dumps(prices) } if __name__ == '__main__': output = result("", "") print(output["body"])
[ "44201710+Xelanor@users.noreply.github.com" ]
44201710+Xelanor@users.noreply.github.com
71fa92b615354dcd3f6006400b3a7a0539adb78f
cbb2be6194ef23dbedef9a69732b210b54c8f03b
/users/admin.py
6de27bc5d23f660edec618ac95a1581c5a3a16e3
[]
no_license
cavblk/pub-net
28bd7e25e26ff61115dbd29a9d7e5add0fc7b458
4b2ff6eaae448028135102e7c11c3cb1c1456907
refs/heads/master
2023-04-20T13:27:39.145232
2021-05-10T12:32:51
2021-05-10T12:32:51
365,173,363
2
0
null
null
null
null
UTF-8
Python
false
false
1,281
py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.utils.translation import gettext_lazy as _ from django.urls import path from users.models import AuthUser from users.forms import UserCreationForm # Register your models here. @admin.register(AuthUser) class AuthUserAdmin(BaseUserAdmin): ordering = ('email',) list_display = ('email', 'first_name', 'last_name', 'is_staff', 'profile_avatar') fieldsets = ( (None, {'fields': ('email',)}), (_('Personal info'), {'fields': ('first_name', 'last_name')}), (_('Permissions'), { 'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions'), }), (_('Important dates'), {'fields': ('last_login', 'date_joined')}), ) add_fieldsets = ( (None, { 'classes': ('wide',), 'fields': ('first_name', 'last_name', 'email'), }), ) search_fields = ('first_name', 'last_name', 'email', 'profile__avatar') add_form = UserCreationForm def profile_avatar(self, instance): return instance.profile.avatar profile_avatar.short_description = 'Profile Avatar' def get_urls(self): return super(BaseUserAdmin, self).get_urls()
[ "mihai@academicmerit.com" ]
mihai@academicmerit.com
ecffd0cb40db3a2541dd08f1f6cbc13ea53320ed
ed0dd577f03a804cdc274f6c7558fafaac574dff
/python/pyre/weaver/mills/CxxMill.py
d5307d0adaae8fcbb9fa32dd74b5c3f627978cec
[ "Apache-2.0" ]
permissive
leandromoreira/vmaf
fd26e2859136126ecc8e9feeebe38a51d14db3de
a4cf599444701ea168f966162194f608b4e68697
refs/heads/master
2021-01-19T03:43:15.677322
2016-10-08T18:02:22
2016-10-08T18:02:22
70,248,500
3
0
null
2016-10-07T13:21:28
2016-10-07T13:21:27
null
UTF-8
Python
false
false
701
py
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Michael A.G. Aivazis # California Institute of Technology # (C) 1998-2005 All Rights Reserved # # <LicenseText> # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # from pyre.weaver.components.LineMill import LineMill class CxxMill(LineMill): names = ["c++", "cxx"] def __init__(self): LineMill.__init__(self, "//", "// -*- C++ -*-") return # version __id__ = "$Id: CxxMill.py,v 1.1.1.1 2006-11-27 00:10:09 aivazis Exp $" # End of file
[ "zli@netflix.com" ]
zli@netflix.com
d4adbe198d9a9e8a3154b16d3b046067822802d5
2836c3caf8ca332635640a27254a345afd449081
/iem/regain_hour_map.py
b88680e83d256a083176bb0d735984295da3bb65
[ "Apache-2.0", "MIT" ]
permissive
akrherz/DEV
27cf1bac978a0d6bbfba1851b90d2495a3bdcd66
3b1ef5841b25365d9b256467e774f35c28866961
refs/heads/main
2023-08-30T10:02:52.750739
2023-08-29T03:08:01
2023-08-29T03:08:01
65,409,757
2
0
MIT
2023-09-12T03:06:07
2016-08-10T19:16:28
Jupyter Notebook
UTF-8
Python
false
false
1,689
py
"""Plot the scam that is DST""" import ephem import mx.DateTime import tqdm from pyiem.plot import MapPlot def compute_sunrise(lat, long): arr = [] sun = ephem.Sun() ames = ephem.Observer() ames.lat = lat ames.long = long sts = mx.DateTime.DateTime(2018, 3, 10) interval = mx.DateTime.RelativeDateTime(days=1) now = sts doy = [] returnD = 0 ames.date = now.strftime("%Y/%m/%d") rise = mx.DateTime.strptime( str(ames.next_rising(sun)), "%Y/%m/%d %H:%M:%S" ) rise = rise.localtime() delta = rise.hour * 60 + rise.minute now += interval while True: ames.date = now.strftime("%Y/%m/%d") rise2 = mx.DateTime.strptime( str(ames.next_rising(sun)), "%Y/%m/%d %H:%M:%S" ) rise2 = rise2.localtime() delta2 = rise2.hour * 60 + rise2.minute if delta2 < delta: return (rise2 - rise).days now += interval return doy, arr, returnD def main(): """Go Main Go.""" lats = [] lons = [] vals = [] for lon in tqdm.tqdm(range(-130, -60, 2)): for lat in range(20, 55, 1): lats.append(lat) lons.append(lon) vals.append(compute_sunrise(str(lat), str(lon))) m = MapPlot( sector="conus", title="Days to Recover Morning Hour after Spring Saving Time Change", subtitle=( "days until local time of sunrise is earlier " "than on 10 March, local DST rules ignored for plot" ), ) m.contourf(lons, lats, vals, range(27, 78, 3), units="days") m.postprocess(filename="180313.png") if __name__ == "__main__": main()
[ "akrherz@iastate.edu" ]
akrherz@iastate.edu
e2707cb27cb58cb71c2bbf62349e32ddf30f03e5
12c371e397a00af391b796ae592a54794afdf42d
/code/FEMDataExtraction/test/testlish.py
e59e4bf12f81fcda546fe4e8112decd5486aea97
[]
no_license
zhaoweisonake/FFR_FlexibleBody
feefa5367c908c4ce98b43b6a8a652a9d939ecad
2a0554b5d0a0e1b0956892e1f8a335df194f45f7
refs/heads/master
2020-05-15T03:49:59.549201
2015-09-04T14:03:48
2015-09-04T14:03:48
null
0
0
null
null
null
null
UTF-8
Python
false
false
451
py
with open('testRead.txt') as input_data: # Skips text before the beginning of the interesting block: for line in input_data: if line.strip() == 'Start': # Or whatever test is needed break # Reads text until the end of the block: for line in input_data: # This keeps reading the file if line.strip() == 'End': break print line # Line is extracted (or block_of_lines.append(line), etc.)
[ "wangzhanrock@gmail.com" ]
wangzhanrock@gmail.com
71b73dbd03f5e6c2ae9f74bb922c758bf2c94fd9
71de5c4d038a470ba80bd978303a2f4438d6b7c8
/PyPoll/main.py
267bd771f8fff1291489044373f2725db6275797
[]
no_license
tardis123/python-challenge
463526c5b133cc9a81df5882cc50d2e3ca02c2fc
7f96d9b18cd0aefc9d7bdd14a4bd1cb40f7e48a7
refs/heads/master
2021-04-03T21:06:56.355730
2018-03-12T23:38:15
2018-03-12T23:38:15
124,706,288
0
0
null
null
null
null
UTF-8
Python
false
false
2,728
py
# Dependencies import os import csv #Ask which file should be analyzed (file must be in csv format) input_file = input("Enter the name of the file you want to analyze (without extension, must be csv file) : ") + ".csv" # Set file path (input file should be located on the same level as the folder raw_data) csvpath = os.path.join('raw_data', input_file) # Append file lines to list poll_data poll_data = [] with open(csvpath, 'r', newline ='', encoding="utf-8") as csvFile: csvReader = csv.reader(csvFile, delimiter=',') next(csvReader, None) # skip file header for row in csvReader: poll_data.append(row) # Calculate total number of votes total_votes = int(len(poll_data)) #print(poll_data[3]) #grab 4th row in the csv file (header not included) #print(poll_data[3][2]) #grab value in the 3th column for the 4th row (header not included) # Append candidate name plus total votes per candidate to dictionary candidates candidates = {} for i in range(total_votes): key = poll_data[i][2] if key not in candidates: candidates[key] = 1 else: candidates[key] += 1 def winner(): top_vote = 0 winner = "" for key, value in candidates.items(): if value > top_vote: top_vote = value winner = key return winner #Print output to terminal print("Election Results") print("-" * 25) print("Total Votes: {}".format(total_votes)) print("-" * 25) relative_votes = 0 for key, value in candidates.items(): relative_votes = "{:.2%}".format(float(value/total_votes)) print("{}: {} ({})".format(key, relative_votes, value)) print("-" * 25) print("Winner: {}".format(winner()) ) print("-" * 25) # Set variable for output file output_file = os.path.join("election_results.csv") # Print output to file # 1) Ask what the output file should be named liked (must be csv format) output_file = input("Enter the name for the output file (without extension): ") + ".csv" # 2) set variable for output file output_file = os.path.join(output_file) # 3) Open the output file with open(output_file, "w", newline="") as datafile: writer = csv.writer(datafile) # Write the header row writer.writerow(["Election Results"]) writer.writerow(["-" * 25]) writer.writerow(["Total Votes: {}".format(total_votes)]) writer.writerow(["-" * 25]) relative_votes = 0 for key, value in candidates.items(): # Relative number of votes in two digits relative_votes = "{:.2%}".format(float(value/total_votes)) writer.writerow(["{}: {} ({})".format(key, relative_votes, value)]) writer.writerow(["-" * 25]) writer.writerow(["Winner: {}".format(winner())]) writer.writerow(["-" * 25])
[ "renevenema@gmail.com" ]
renevenema@gmail.com
a705dfd941c63c982c157e1239484d4cc9ee5a5c
2417cdceb80e884ebc997c00a4203202e1e4bfe6
/src/754.reach-a-number/754.reach-a-number.py
572f45835d3ac931f4194b8582087266fa8bc01a
[ "MIT" ]
permissive
AnestLarry/LeetCodeAnswer
20a7aa78d1aaaa9b20a7149a72725889d0447017
f15d1f8435cf7b6c7746b42139225e5102a2e401
refs/heads/master
2023-06-23T07:20:44.839587
2023-06-15T14:47:46
2023-06-15T14:47:46
191,561,490
0
0
null
null
null
null
UTF-8
Python
false
false
1,308
py
# # @lc app=leetcode id=754 lang=python3 # # [754] Reach a Number # https://leetcode.com/problems/reach-a-number/discuss/410112/Python-Solution # @lc code=start # You are standing at position 0 on an infinite number line. There is a goal at position target. # On each move, you can either go left or right. During the n-th move (starting from 1), you take n steps. # Return the minimum number of steps required to reach the destination. # Example 1: # Input: target = 3 # Output: 2 # Explanation: # On the first move we step from 0 to 1. # On the second step we step from 1 to 3. # Example 2: # Input: target = 2 # Output: 3 # Explanation: # On the first move we step from 0 to 1. # On the second move we step from 1 to -1. # On the third move we step from -1 to 2. # Note: # target will be a non-zero integer in the range [-10^9, 10^9]. class Solution: def reachNumber(self, target: int) -> int: # Accepted # 73/73 cases passed (120 ms) # Your runtime beats 32.81 % of python3 submissions # Your memory usage beats 11.11 % of python3 submissions (13.7 MB) res = 0 target = abs(target) while target > 0: res += 1 target -= res if target % 2 != 0: res += 1+res % 2 return res # @lc code=end
[ "anest@66ws.cc" ]
anest@66ws.cc
0099a17b3d889215f6691b3cf3cf8b91a101bab1
05b4fc99b193530db6609e1eca1226ad9205e839
/CalUsingifelse.py
1705d0b8811cdf4a2856a92765088c4224a003b9
[]
no_license
hemanth1011/coding-dump
c5dc26ec684a911972765a8f88c4d19681285e31
91a6b5d2c455e1c0cce8be12eaa503b96abf2b35
refs/heads/master
2020-06-22T19:00:23.906974
2019-07-25T06:02:38
2019-07-25T06:02:38
197,781,716
0
0
null
null
null
null
UTF-8
Python
false
false
612
py
# Note : there is no switch case in python. so, here im using if and if-else statements. #--------------------------------------------------------------------------------------- a = input("Enter first number") b = input("Enter second number") op = input("Enter opertion from below \n+\n-\n*\n/\n") if(op=="+"): Result=float(a)+float(b) if(op=="-"): Result=float(a)-float(b) if(op=="*"): Result=float(a)*float(b) if(op=="/"): Result=float(a)/float(b) if(op=="+" or op=="-" or op=="*" or op=="/"): print("Result:",a,"+",b,"=",Result) else: print("Unidentified Operation...")
[ "hemanthmanikantabunga@gmail.com" ]
hemanthmanikantabunga@gmail.com
5b55fd22321c6012af593f2b24bd9b3c94ac8bc7
7003c85d303f0f18558cff629acebeed8e0893e4
/Algo/Divide and Conquer/isMajority.py
14401d728c2d8a0463eb10adf44cca6a502886f3
[]
no_license
hardik96bansal/Algorithm-DS-Practice
6e2e9b63df4487058483133a19534815a49c4b2e
eb2c0d0d21f4cd1fee00eaa2988d20da9c496dc1
refs/heads/master
2023-04-30T06:52:05.994755
2023-04-17T13:09:55
2023-04-17T13:09:55
241,435,628
0
0
null
null
null
null
UTF-8
Python
false
false
668
py
def isMajority(arr,num): firOcc = firstOccur(arr,num,0,len(arr),-1) n = len(arr) if(firOcc == -1 or firOcc>n//2): return False if(arr[firOcc+n//2]==num): return True else: return False def firstOccur(arr,num,l,r,i): if(r>l): mid = (l+r)//2 if(arr[mid] == num): j = mid if (mid<i or i==-1) else i return firstOccur(arr,num,l,mid,j) elif(num<arr[mid]): return firstOccur(arr,num,l,mid,i) else: return firstOccur(arr,num,mid+1,r,i) return i arr = [0,1,2,3,3,3,3,3,10] #print(firstOccur(arr,11,0,len(arr),-1)) print(isMajority(arr,10))
[ "hardik96bansal@gmail.com" ]
hardik96bansal@gmail.com
13c9e664f8305eab4364a967fcda8656ceb1630b
b41fd68840e7345066189d76a3ecdd7d7c00a67f
/food_tracker/food/views.py
53455d90e81e93d7cce666ea936343808ab8d9f0
[]
no_license
AlexisAguiluz/food_tracker
34064635d0260bd4143d5f0338b25201b96c1efb
ab3024af7eaffaa3a30f13761893c9b3460dbf53
refs/heads/master
2020-09-21T21:59:24.618266
2019-11-30T02:13:54
2019-11-30T02:13:54
224,947,161
0
0
null
null
null
null
UTF-8
Python
false
false
1,512
py
from django.shortcuts import render from django.http import HttpResponse from .models import Food, Meal from django.http import HttpResponseRedirect from django.urls import reverse_lazy from .forms import MealForm def index(request): template = 'list.html' meals = Meal.objects.all() context = { 'meals': meals, } return render(request, template, context) # return HttpResponse("Hello, world. You're at the index page.") def add_meal(request): template = "add_meal.html" if request.method == "POST": form = MealForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect(reverse_lazy('food:index')) else: context = { 'meal_form': MealForm(), } return render(request, template, context) def delete_meal(request, meal_id): meal = Meal.objects.get(id=int(meal_id)) meal.delete() return HttpResponseRedirect(reverse_lazy('food:index')) def update_meal(request, meal_id): template = "update_meal.html" meal = Meal.objects.get(id=int(meal_id)) if request.method == "POST": form = MealForm(request.POST, instance=meal) if form.is_valid(): form.save() return HttpResponseRedirect(reverse_lazy('food:index')) else: context = { 'meal_form': MealForm(instance=meal), } return render(request, template, context) def view_meal(request, meal_id): template = "view_meal.html" meal= Meal.objects.get(id=int(meal_id)) context = { 'meal': meal, } return render(request, template, context)
[ "noreply@github.com" ]
AlexisAguiluz.noreply@github.com
bc518a828d6081912b765f39a3b95bd87e6fbcf1
bc1c3b7386b80c8aa1ee9660606084aacf499e93
/Bronze II/2309.py
6046624080cc3e450a4191c11bcbc546e2e9ae02
[]
no_license
Thesine/BOJ_Sine
ad93bcd47f622cb68ae794fbd70c3b73044c76aa
4bde63726c0f14e9dea30eeb5d262039509b9e8b
refs/heads/master
2022-11-05T01:22:55.674606
2020-07-15T07:14:49
2020-07-15T07:14:49
265,505,315
0
0
null
null
null
null
UTF-8
Python
false
false
240
py
l = [] for i in range(9): l.append(int(input())) sum = 0 l.sort() for i in l: sum += i for i in l: if len(l)==7: break for j in l: if i+j == sum-100: l.remove(j) l.remove(i) break for i in l: print(i)
[ "noreply@github.com" ]
Thesine.noreply@github.com
dd2f007d5531fe7a3a72581701ad253e6d6eb614
9815041feb5bd2a89e39d86e544ca44c2e17e318
/config/settings.py
fdd605a6aef832ee03fc0708d15aa8ca4282d1b3
[]
no_license
raimbaev223/django-docker-postgres-template
5ecb62fdc57bb3af77815c3c4d1f03c98d0fdaf3
f97449cf90b87daed374576ba52e545fc1694be0
refs/heads/master
2023-04-03T05:22:38.668148
2021-04-05T10:47:52
2021-04-05T10:47:52
354,720,373
0
0
null
null
null
null
UTF-8
Python
false
false
3,247
py
""" Django settings for djangoforprofessionals_ch3 project. Generated by 'django-admin startproject' using Django 3.1.7. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'j)xol&2u_4%!32uegp@x)y*=hmn8!nlp4_1tfxq#zwu#0et$46' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] 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 = 'djangoforprofessionals_ch3.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [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 = 'djangoforprofessionals_ch3.wsgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'postgres', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': 'db', 'PORT': 5432 } } # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/3.1/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.1/howto/static-files/ STATIC_URL = '/static/'
[ "raimbaev.223@gmail.com" ]
raimbaev.223@gmail.com
8539aa648cbcf6f39e0fe38345d487fbf450fffa
bb1118b2bf391af6671c55e68121e64795791411
/week2/asig2/pa2-autocorrect-v1/python/StupidBackoffLanguageModel.py
58980bce15b3805309d064eb0dcfda14e0b21bb6
[]
no_license
jdcheesman/python-nlp
5dbe65252755d205f287a90ef6c08c545936393a
fac11bf5fac5323031e7e11b9609f31584412b99
refs/heads/master
2020-05-29T22:37:50.739462
2012-06-14T15:29:24
2012-06-14T15:29:24
3,726,555
1
0
null
null
null
null
UTF-8
Python
false
false
3,116
py
import math class StupidBackoffLanguageModel: unigrams = dict() bigrams = dict() total_tokens = 0 total_vocab = 0 def __init__(self, corpus): """Initialize your data structures in the constructor.""" # TODO your code here self.train(corpus) def train(self, corpus): """ Takes a corpus and trains your language model. Compute any counts or other corpus statistics in this function. """ # TODO your code here self.load_unigrams(corpus) self.load_bigrams(corpus) def load_unigrams(self, corpus): """Load the unigrams dictionary """ for sentence in corpus.corpus: for datum in sentence.data: # iterate over datums in the sentence m = datum.word # get the word self.total_tokens += 1 val = 1 if m in self.unigrams: val = self.unigrams[m] + 1 else: self.total_vocab += 1 self.unigrams[m] = val def load_bigrams(self, corpus): """Load the bigrams dictionary""" last_word = '' for sentence in corpus.corpus: for datum in sentence.data: # iterate over datums in the sentence m = datum.word # get the word if last_word is not '': val = 1 new_bigram = last_word + ' ' + m if new_bigram in self.bigrams: val = self.bigrams[new_bigram] + 1 self.bigrams[new_bigram] = val last_word = m def score(self, sentence): """ Takes a list of strings as argument and returns the log-probability of the sentence using your language model. Use whatever data you computed in train() here. Steps 1) count(bigram)/count(unigram) if count(unigram) > 0 otherwise 2) 0.4 * Laplace unigram for known words 3) 0.4 * Laplace unigram fro unknown words Laplace unigram is log(count(unigram) + 1) / V + N """ # TODO your code here case3_probability = 0.4 * (1.0 / (self.total_tokens + self.total_vocab + 0.0)) result = 0.0 previous_word = '' for m in sentence: probability = case3_probability cntUnigram = 0.0 cntBigram = 0.0 if previous_word is '': if m in self.unigrams: cntUnigram = self.unigrams[m] probability = 0.4 * ((cntUnigram + 1.0) / (self.total_tokens + self.total_vocab + 0.0)) else: current_bigram = previous_word + ' ' + m if previous_word in self.unigrams and current_bigram in self.bigrams: cntUnigram = self.unigrams[previous_word] cntBigram = self.bigrams[current_bigram] probability = (cntBigram+0.0) / (cntUnigram+0.0) else: if m in self.unigrams: cntUnigram = self.unigrams[m] probability = 0.4 * ((cntUnigram + 1.0) / (self.total_tokens + self.total_vocab + 0.0)) result = result + math.log(probability) previous_word = m #print result return result
[ "jim.cheesman.work@gmail.com" ]
jim.cheesman.work@gmail.com
a07324a9d67bfb019bf47a4e379d797eab6ed5f3
728f639b8d536348e200a6c6b8dfd3e70a781d85
/HTMLTestRunner测试报告&unittest/可以复用项目/webTest/comm/common.py
967c849ad0793853febfe741f742e28639cee19c
[]
no_license
jingshiyue/my_dict_forPython
00adad2a1492b7ecff66a3de44793f17682aaea6
7a0da28d68eb130e62d196467d0ef0ee3d8ebf95
refs/heads/master
2023-04-05T18:29:36.707082
2023-03-30T10:30:13
2023-03-30T10:30:13
192,511,669
0
0
null
null
null
null
UTF-8
Python
false
false
7,436
py
# -*- coding:utf-8 -*- import os import readConfig as readConfig from xlrd import open_workbook from xml.etree import ElementTree as ElementTree from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from comm.webDriver import MyDriver as Driver import time import comm.runSet as runSet localReadConfig = readConfig.ReadConfig() def open_browser(): """ open browser by url :return: """ browser = webdriver.Chrome() # 绐楀彛鏈�ぇ鍖� browser.maximize_window() return browser def close_browser(browser): """ close browser :param browser: :return: """ browser.close() def open_url(name): """ open web page by url :param name: :return: """ url = localReadConfig.get_webServer(name) browser = open_browser() browser.get(url) return browser def get_xls(xls_name, sheet_name): """ :param xls_name: excel file name :param sheet_name: sheet name :return: sheet value """ web = runSet.get_web() site = runSet.get_site() cls = [] # get excel file path xls_path = os.path.join(readConfig.proDir, 'file', web, site, xls_name) print("xls path:"+xls_path) # open excel file book = open_workbook(xls_path) # get sheet by name sheet = book.sheet_by_name(sheet_name) # get nrows nrows = sheet.nrows for i in range(nrows): if sheet.row_values(i)[0] != u'case_name': cls.append(sheet.row_values(i)) # print(sheet.row_values(i)) return cls activity = {} def set_xml(): """ get element :return: """ web = runSet.get_web() site = runSet.get_site() if len(activity) == 0: file_path = os.path.join(readConfig.proDir, 'file', web, site, 'element.xml') tree = ElementTree.parse(file_path) for a in tree.findall('activity'): activity_name = a.get('name') element = {} for e in a.getchildren(): element_name = e.get('id') element_child = {} for t in e.getchildren(): element_child[t.tag] = t.text element[element_name] = element_child activity[activity_name] = element def get_el_dict(activity_name, element): """ According to page, activity and element getting element :param activity_name: activity name :param element: element name :return: """ set_xml() element_dict = activity.get(activity_name).get(element) print(element_dict) return element_dict class Element: #Element("shein", "www", "login", "login_link").is_exist() def __init__(self, activity_name, element_name): self.driver1 = Driver.get_browser() self.driver = self.driver1.get_driver() self.activity = activity_name self.element = element_name element_dict = get_el_dict(self.activity, self.element) self.pathType = element_dict.get('pathType') self.pathValue = element_dict.get('pathValue') def is_exist(self): """ Determine element is exist :return: TRUE OR FALSE """ try: if self.pathType == 'ID': self.driver.find_element_by_id(self.pathValue) return True if self.pathType == 'XPATH': self.driver.find_elements_by_xpath(self.pathValue) return True if self.pathType == 'CLASSNAME': self.driver.find_element_by_class_name(self.pathValue) return True if self.pathType == 'NAME': self.driver.find_element_by_name(self.pathValue) return True except NoSuchElementException: return False def wait_element(self, wait_time): """ wait element appear in time :param wait_time: wait time :return: true or false """ time.sleep(wait_time) if self.is_exist(): return True else: return False def get_element(self): """ get element :return: element """ try: if self.pathType == 'ID': element = self.driver.find_element_by_id(self.pathValue) return element if self.pathType == 'XPATH': element = self.driver.find_elements_by_xpath(self.pathValue) return element if self.pathType == 'CLASSNAME': element = self.driver.find_element_by_class_name(self.pathValue) return element if self.pathType == 'NAME': element = self.driver.find_element_by_name(self.pathValue) return element except NoSuchElementException: return None def get_element_by_index(self, index): """ get element by index :param index: index :return: element """ try: if self.pathType == 'ID': element = self.driver.find_element_by_id(self.pathValue) return element[index] if self.pathType == 'XPATH': element = self.driver.find_elements_by_xpath(self.pathValue) return element[index] if self.pathType == 'CLASSNAME': element = self.driver.find_element_by_class_name(self.pathValue) return element[index] if self.pathType == 'NAME': element = self.driver.find_element_by_name(self.pathValue) return element[index] except NoSuchElementException: return None def get_element_list(self): """ get element list :return: element list """ try: if self.pathType == 'ID': element_list = self.driver.find_element_by_id(self.pathValue) return element_list if self.pathType == 'XPATH': element_list = self.driver.find_elements_by_xpath(self.pathValue) return element_list if self.pathType == 'CLASSNAME': element_list = self.driver.find_element_by_class_name(self.pathValue) return element_list if self.pathType == 'NAME': element_list = self.driver.find_element_by_name(self.pathValue) return element_list except NoSuchElementException: return None def click(self): """ click element :return: """ element = self.get_element() time.sleep(1) element.click() def send_key(self, key): """ input key :param key: input value :return: """ element = self.get_element() time.sleep(1) element.clear() element.send_keys(key) def input_keys(self, index, key): """ By index send key :param index: index :param key: key :return: """ element = self.get_element_by_index(index) time.sleep(1) element.clear() element.send_keys(key) def get_text_value(self): """ get attribute :return: """ element = self.get_element() value = element.get_attribute('text') return str(value)
[ "173302591@qq.com" ]
173302591@qq.com
3f2b9edec5b874889539962e8060e37f70b0e80b
ce03246acb0759c698b096430d7a3d8f5bf2be41
/ups/migrations/0007_auto_20141230_1451.py
58635d7a6754e9715c1a9fe260444855b77f4b1d
[]
no_license
grovesr/mirai-clinical-ups
07b8f8f9b596fdad26f81622b1baec972d7bc9bb
89db247b3ac4431859dd65c3582a4840c3809483
refs/heads/master
2020-05-17T04:12:50.973958
2015-02-23T12:49:48
2015-02-23T12:49:48
28,535,784
0
0
null
null
null
null
UTF-8
Python
false
false
979
py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('ups', '0006_auto_20141230_0814'), ] operations = [ migrations.AlterField( model_name='custorderqueryrow', name='queryId', field=models.DateTimeField(default=datetime.datetime(2014, 12, 30, 19, 51, 46, 892, tzinfo=utc)), preserve_default=True, ), migrations.AlterField( model_name='ph', name='PH1_STOP_SHIP_DATE', field=models.DateTimeField(blank=True), preserve_default=True, ), migrations.AlterField( model_name='pickticket', name='DOC_DATE', field=models.CharField(default=b'12/30/14 19:51:45', max_length=17), preserve_default=True, ), ]
[ "grovesr1@yahoo.com" ]
grovesr1@yahoo.com
09cebb2e4a74f46e415c95b46e898d0f613ea202
1dae87abcaf49f1d995d03c0ce49fbb3b983d74a
/programs/subroutines/Grav Comp Ramp.sub.py
d53530d7c120d2b2fbd9cc6eeda242696b5c8d6d
[]
no_license
BEC-Trento/BEC1-data
651cd8e5f15a7d9848f9921b352e0830c08f27dd
f849086891bc68ecf7447f62962f791496d01858
refs/heads/master
2023-03-10T19:19:54.833567
2023-03-03T22:59:01
2023-03-03T22:59:01
132,161,998
0
0
null
null
null
null
UTF-8
Python
false
false
115
py
prg_comment = "" prg_version = "0.5.1" def program(prg, cmd): prg.add(0, "Grav Comp", 0.000000) return prg
[ "carmelo.mordini@unitn.it" ]
carmelo.mordini@unitn.it
8a6f89c809cc96aab322db6b24f652d3838b3138
487fb49582444005fd55158b22b1428b8146adf4
/models/resnet.py
11f4cf9e8341e90600c0c78c9b3cd99c77f7d32e
[]
no_license
speciallan/BCNN
c7a7374931b581c73b8b24ec5e31b77578bdf6b0
6964181acb35c3005f65fb0aa38263a986efcaf0
refs/heads/master
2020-09-21T18:18:03.819322
2019-12-23T12:19:25
2019-12-23T12:19:25
224,879,530
0
0
null
null
null
null
UTF-8
Python
false
false
22,474
py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Speciallan """ResNet, ResNetV2, and ResNeXt models for Keras. # Reference papers - [Deep Residual Learning for Image Recognition] (https://arxiv.org/abs/1512.03385) (CVPR 2016 Best Paper Award) - [Identity Mappings in Deep Residual Networks] (https://arxiv.org/abs/1603.05027) (ECCV 2016) - [Aggregated Residual Transformations for Deep Neural Networks] (https://arxiv.org/abs/1611.05431) (CVPR 2017) # Reference implementations - [TensorNets] (https://github.com/taehoonlee/tensornets/blob/master/tensornets/resnets.py) - [Caffe ResNet] (https://github.com/KaimingHe/deep-residual-networks/tree/master/prototxt) - [Torch ResNetV2] (https://github.com/facebook/fb.resnet.torch/blob/master/models/preresnet.lua) - [Torch ResNeXt] (https://github.com/facebookresearch/ResNeXt/blob/master/models/resnext.lua) """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from . import get_submodules_from_kwargs from .imagenet_utils import _obtain_input_shape backend = None layers = None models = None keras_utils = None BASE_WEIGHTS_PATH = ( 'https://github.com/keras-team/keras-applications/' 'releases/download/resnet/') WEIGHTS_HASHES = { 'resnet50': ('2cb95161c43110f7111970584f804107', '4d473c1dd8becc155b73f8504c6f6626'), 'resnet101': ('f1aeb4b969a6efcfb50fad2f0c20cfc5', '88cf7a10940856eca736dc7b7e228a21'), 'resnet152': ('100835be76be38e30d865e96f2aaae62', 'ee4c566cf9a93f14d82f913c2dc6dd0c'), 'resnet50v2': ('3ef43a0b657b3be2300d5770ece849e0', 'fac2f116257151a9d068a22e544a4917'), 'resnet101v2': ('6343647c601c52e1368623803854d971', 'c0ed64b8031c3730f411d2eb4eea35b5'), 'resnet152v2': ('a49b44d1979771252814e80f8ec446f9', 'ed17cf2e0169df9d443503ef94b23b33'), 'resnext50': ('67a5b30d522ed92f75a1f16eef299d1a', '62527c363bdd9ec598bed41947b379fc'), 'resnext101': ('34fb605428fcc7aa4d62f44404c11509', '0f678c91647380debd923963594981b3') } def block1(x, filters, kernel_size=3, stride=1, conv_shortcut=True, name=None): """A residual block. # Arguments x: input tensor. filters: integer, filters of the bottleneck layer. kernel_size: default 3, kernel size of the bottleneck layer. stride: default 1, stride of the first layer. conv_shortcut: default True, use convolution shortcut if True, otherwise identity shortcut. name: string, block label. # Returns Output tensor for the residual block. """ bn_axis = 3 if backend.image_data_format() == 'channels_last' else 1 if conv_shortcut is True: shortcut = layers.Conv2D(4 * filters, 1, strides=stride, name=name + '_0_conv')(x) shortcut = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_0_bn')(shortcut) else: shortcut = x x = layers.Conv2D(filters, 1, strides=stride, name=name + '_1_conv')(x) x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_1_bn')(x) x = layers.Activation('relu', name=name + '_1_relu')(x) x = layers.Conv2D(filters, kernel_size, padding='SAME', name=name + '_2_conv')(x) x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_2_bn')(x) x = layers.Activation('relu', name=name + '_2_relu')(x) x = layers.Conv2D(4 * filters, 1, name=name + '_3_conv')(x) x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_3_bn')(x) x = layers.Add(name=name + '_add')([shortcut, x]) x = layers.Activation('relu', name=name + '_out')(x) return x def stack1(x, filters, blocks, stride1=2, name=None): """A set of stacked residual blocks. # Arguments x: input tensor. filters: integer, filters of the bottleneck layer in a block. blocks: integer, blocks in the stacked blocks. stride1: default 2, stride of the first layer in the first block. name: string, stack label. # Returns Output tensor for the stacked blocks. """ x = block1(x, filters, stride=stride1, name=name + '_block1') for i in range(2, blocks + 1): x = block1(x, filters, conv_shortcut=False, name=name + '_block' + str(i)) return x def block2(x, filters, kernel_size=3, stride=1, conv_shortcut=False, name=None): """A residual block. # Arguments x: input tensor. filters: integer, filters of the bottleneck layer. kernel_size: default 3, kernel size of the bottleneck layer. stride: default 1, stride of the first layer. conv_shortcut: default False, use convolution shortcut if True, otherwise identity shortcut. name: string, block label. # Returns Output tensor for the residual block. """ bn_axis = 3 if backend.image_data_format() == 'channels_last' else 1 preact = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_preact_bn')(x) preact = layers.Activation('relu', name=name + '_preact_relu')(preact) if conv_shortcut is True: shortcut = layers.Conv2D(4 * filters, 1, strides=stride, name=name + '_0_conv')(preact) else: shortcut = layers.MaxPooling2D(1, strides=stride)(x) if stride > 1 else x x = layers.Conv2D(filters, 1, strides=1, use_bias=False, name=name + '_1_conv')(preact) x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_1_bn')(x) x = layers.Activation('relu', name=name + '_1_relu')(x) x = layers.ZeroPadding2D(padding=((1, 1), (1, 1)), name=name + '_2_pad')(x) x = layers.Conv2D(filters, kernel_size, strides=stride, use_bias=False, name=name + '_2_conv')(x) x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_2_bn')(x) x = layers.Activation('relu', name=name + '_2_relu')(x) x = layers.Conv2D(4 * filters, 1, name=name + '_3_conv')(x) x = layers.Add(name=name + '_out')([shortcut, x]) return x def stack2(x, filters, blocks, stride1=2, name=None): """A set of stacked residual blocks. # Arguments x: input tensor. filters: integer, filters of the bottleneck layer in a block. blocks: integer, blocks in the stacked blocks. stride1: default 2, stride of the first layer in the first block. name: string, stack label. # Returns Output tensor for the stacked blocks. """ x = block2(x, filters, conv_shortcut=True, name=name + '_block1') for i in range(2, blocks): x = block2(x, filters, name=name + '_block' + str(i)) x = block2(x, filters, stride=stride1, name=name + '_block' + str(blocks)) return x def block3(x, filters, kernel_size=3, stride=1, groups=32, conv_shortcut=True, name=None): """A residual block. # Arguments x: input tensor. filters: integer, filters of the bottleneck layer. kernel_size: default 3, kernel size of the bottleneck layer. stride: default 1, stride of the first layer. groups: default 32, group size for grouped convolution. conv_shortcut: default True, use convolution shortcut if True, otherwise identity shortcut. name: string, block label. # Returns Output tensor for the residual block. """ bn_axis = 3 if backend.image_data_format() == 'channels_last' else 1 if conv_shortcut is True: shortcut = layers.Conv2D((64 // groups) * filters, 1, strides=stride, use_bias=False, name=name + '_0_conv')(x) shortcut = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_0_bn')(shortcut) else: shortcut = x x = layers.Conv2D(filters, 1, use_bias=False, name=name + '_1_conv')(x) x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_1_bn')(x) x = layers.Activation('relu', name=name + '_1_relu')(x) c = filters // groups x = layers.ZeroPadding2D(padding=((1, 1), (1, 1)), name=name + '_2_pad')(x) x = layers.DepthwiseConv2D(kernel_size, strides=stride, depth_multiplier=c, use_bias=False, name=name + '_2_conv')(x) kernel = np.zeros((1, 1, filters * c, filters), dtype=np.float32) for i in range(filters): start = (i // c) * c * c + i % c end = start + c * c kernel[:, :, start:end:c, i] = 1. x = layers.Conv2D(filters, 1, use_bias=False, trainable=False, kernel_initializer={'class_name': 'Constant', 'config': {'value': kernel}}, name=name + '_2_gconv')(x) x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_2_bn')(x) x = layers.Activation('relu', name=name + '_2_relu')(x) x = layers.Conv2D((64 // groups) * filters, 1, use_bias=False, name=name + '_3_conv')(x) x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_3_bn')(x) x = layers.Add(name=name + '_add')([shortcut, x]) x = layers.Activation('relu', name=name + '_out')(x) return x def stack3(x, filters, blocks, stride1=2, groups=32, name=None): """A set of stacked residual blocks. # Arguments x: input tensor. filters: integer, filters of the bottleneck layer in a block. blocks: integer, blocks in the stacked blocks. stride1: default 2, stride of the first layer in the first block. groups: default 32, group size for grouped convolution. name: string, stack label. # Returns Output tensor for the stacked blocks. """ x = block3(x, filters, stride=stride1, groups=groups, name=name + '_block1') for i in range(2, blocks + 1): x = block3(x, filters, groups=groups, conv_shortcut=False, name=name + '_block' + str(i)) return x def ResNet(stack_fn, preact, use_bias, model_name='resnet', include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000, **kwargs): """Instantiates the ResNet, ResNetV2, and ResNeXt architecture. Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is the one specified in your Keras config at `~/.keras/keras.json`. # Arguments stack_fn: a function that returns output tensor for the stacked residual blocks. preact: whether to use pre-activation or not (True for ResNetV2, False for ResNet and ResNeXt). use_bias: whether to use biases for convolutional layers or not (True for ResNet and ResNetV2, False for ResNeXt). model_name: string, model name. include_top: whether to include the fully-connected layer at the top of the network. weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified if `include_top` is False (otherwise the input shape has to be `(224, 224, 3)` (with `channels_last` data format) or `(3, 224, 224)` (with `channels_first` data format). It should have exactly 3 inputs channels. pooling: optional pooling mode for feature extraction when `include_top` is `False`. - `None` means that the output of the model will be the 4D tensor output of the last convolutional layer. - `avg` means that global average pooling will be applied to the output of the last convolutional layer, and thus the output of the model will be a 2D tensor. - `max` means that global max pooling will be applied. classes: optional number of classes to classify images into, only to be specified if `include_top` is True, and if no `weights` argument is specified. # Returns A Keras model instance. # Raises ValueError: in case of invalid argument for `weights`, or invalid input shape. """ global backend, layers, models, keras_utils backend, layers, models, keras_utils = get_submodules_from_kwargs(kwargs) if not (weights in {'imagenet', None} or os.path.exists(weights)): raise ValueError('The `weights` argument should be either ' '`None` (random initialization), `imagenet` ' '(pre-training on ImageNet), ' 'or the path to the weights file to be loaded.') if weights == 'imagenet' and include_top and classes != 1000: raise ValueError('If using `weights` as `"imagenet"` with `include_top`' ' as true, `classes` should be 1000') # Determine proper input shape input_shape = _obtain_input_shape(input_shape, default_size=224, min_size=32, data_format=backend.image_data_format(), require_flatten=include_top, weights=weights) if input_tensor is None: img_input = layers.Input(shape=input_shape) else: if not backend.is_keras_tensor(input_tensor): img_input = layers.Input(tensor=input_tensor, shape=input_shape) else: img_input = input_tensor bn_axis = 3 if backend.image_data_format() == 'channels_last' else 1 x = layers.ZeroPadding2D(padding=((3, 3), (3, 3)), name='conv1_pad')(img_input) x = layers.Conv2D(64, 7, strides=2, use_bias=use_bias, name='conv1_conv')(x) if preact is False: x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name='conv1_bn')(x) x = layers.Activation('relu', name='conv1_relu')(x) x = layers.ZeroPadding2D(padding=((1, 1), (1, 1)), name='pool1_pad')(x) x = layers.MaxPooling2D(3, strides=2, name='pool1_pool')(x) x = stack_fn(x) if preact is True: x = layers.BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name='post_bn')(x) x = layers.Activation('relu', name='post_relu')(x) if include_top: x = layers.GlobalAveragePooling2D(name='avg_pool')(x) x = layers.Dense(classes, activation='softmax', name='probs')(x) else: if pooling == 'avg': x = layers.GlobalAveragePooling2D(name='avg_pool')(x) elif pooling == 'max': x = layers.GlobalMaxPooling2D(name='max_pool')(x) # Ensure that the model takes into account # any potential predecessors of `input_tensor`. if input_tensor is not None: inputs = keras_utils.get_source_inputs(input_tensor) else: inputs = img_input # Create model. model = models.Model(inputs, x, name=model_name) # Load weights. if (weights == 'imagenet') and (model_name in WEIGHTS_HASHES): if include_top: file_name = model_name + '_weights_tf_dim_ordering_tf_kernels.h5' file_hash = WEIGHTS_HASHES[model_name][0] else: file_name = model_name + '_weights_tf_dim_ordering_tf_kernels_notop.h5' file_hash = WEIGHTS_HASHES[model_name][1] weights_path = keras_utils.get_file(file_name, BASE_WEIGHTS_PATH + file_name, cache_subdir='models', file_hash=file_hash) by_name = True if 'resnext' in model_name else False model.load_weights(weights_path, by_name=by_name) elif weights is not None: model.load_weights(weights) return model def ResNet50(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000, **kwargs): def stack_fn(x): x = stack1(x, 64, 3, stride1=1, name='conv2') x = stack1(x, 128, 4, name='conv3') x = stack1(x, 256, 6, name='conv4') x = stack1(x, 512, 3, name='conv5') return x return ResNet(stack_fn, False, True, 'resnet50', include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs) def ResNet101(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000, **kwargs): def stack_fn(x): x = stack1(x, 64, 3, stride1=1, name='conv2') x = stack1(x, 128, 4, name='conv3') x = stack1(x, 256, 23, name='conv4') x = stack1(x, 512, 3, name='conv5') return x return ResNet(stack_fn, False, True, 'resnet101', include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs) def ResNet152(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000, **kwargs): def stack_fn(x): x = stack1(x, 64, 3, stride1=1, name='conv2') x = stack1(x, 128, 8, name='conv3') x = stack1(x, 256, 36, name='conv4') x = stack1(x, 512, 3, name='conv5') return x return ResNet(stack_fn, False, True, 'resnet152', include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs) def ResNet50V2(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000, **kwargs): def stack_fn(x): x = stack2(x, 64, 3, name='conv2') x = stack2(x, 128, 4, name='conv3') x = stack2(x, 256, 6, name='conv4') x = stack2(x, 512, 3, stride1=1, name='conv5') return x return ResNet(stack_fn, True, True, 'resnet50v2', include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs) def ResNet101V2(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000, **kwargs): def stack_fn(x): x = stack2(x, 64, 3, name='conv2') x = stack2(x, 128, 4, name='conv3') x = stack2(x, 256, 23, name='conv4') x = stack2(x, 512, 3, stride1=1, name='conv5') return x return ResNet(stack_fn, True, True, 'resnet101v2', include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs) def ResNet152V2(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000, **kwargs): def stack_fn(x): x = stack2(x, 64, 3, name='conv2') x = stack2(x, 128, 8, name='conv3') x = stack2(x, 256, 36, name='conv4') x = stack2(x, 512, 3, stride1=1, name='conv5') return x return ResNet(stack_fn, True, True, 'resnet152v2', include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs) def ResNeXt50(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000, **kwargs): def stack_fn(x): x = stack3(x, 128, 3, stride1=1, name='conv2') x = stack3(x, 256, 4, name='conv3') x = stack3(x, 512, 6, name='conv4') x = stack3(x, 1024, 3, name='conv5') return x return ResNet(stack_fn, False, False, 'resnext50', include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs) def ResNeXt101(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000, **kwargs): def stack_fn(x): x = stack3(x, 128, 3, stride1=1, name='conv2') x = stack3(x, 256, 4, name='conv3') x = stack3(x, 512, 23, name='conv4') x = stack3(x, 1024, 3, name='conv5') return x return ResNet(stack_fn, False, False, 'resnext101', include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs) setattr(ResNet50, '__doc__', ResNet.__doc__) setattr(ResNet101, '__doc__', ResNet.__doc__) setattr(ResNet152, '__doc__', ResNet.__doc__) setattr(ResNet50V2, '__doc__', ResNet.__doc__) setattr(ResNet101V2, '__doc__', ResNet.__doc__) setattr(ResNet152V2, '__doc__', ResNet.__doc__) setattr(ResNeXt50, '__doc__', ResNet.__doc__) setattr(ResNeXt101, '__doc__', ResNet.__doc__)
[ "350394776@qq.com" ]
350394776@qq.com
6c0c670495008cbd06140f21e047f3da7ee7a9c9
6ceea2578be0cbc1543be3649d0ad01dd55072aa
/src/examples/elphf/diffusion/mesh1D.py
b8a851a3a7a81fb4e593b52c70dcb733f0cf0331
[ "LicenseRef-scancode-public-domain" ]
permissive
regmi/fipy
57972add2cc8e6c04fda09ff2faca9a2c45ad19d
eb4aacf5a8e35cdb0e41beb0d79a93e7c8aacbad
refs/heads/master
2020-04-27T13:51:45.095692
2010-04-09T07:32:42
2010-04-09T07:32:42
602,099
1
0
null
null
null
null
UTF-8
Python
false
false
6,365
py
#!/usr/bin/env python ## # ################################################################### # FiPy - Python-based finite volume PDE solver # # FILE: "mesh1D.py" # # Author: Jonathan Guyer <guyer@nist.gov> # Author: Daniel Wheeler <daniel.wheeler@nist.gov> # Author: James Warren <jwarren@nist.gov> # mail: NIST # www: http://www.ctcms.nist.gov/fipy/ # # ======================================================================== # This software was developed at the National Institute of Standards # and Technology by employees of the Federal Government in the course # of their official duties. Pursuant to title 17 Section 105 of the # United States Code this software is not subject to copyright # protection and is in the public domain. FiPy is an experimental # system. NIST assumes no responsibility whatsoever for its use by # other parties, and makes no guarantees, expressed or implied, about # its quality, reliability, or any other characteristic. We would # appreciate acknowledgement if the software is used. # # This software can be redistributed and/or modified freely # provided that any derivative works bear some notice that they are # derived from it, and any modified versions bear some notice that # they have been modified. # ======================================================================== # # ################################################################### ## r""" A simple 1D example to test the setup of the multi-component diffusion equations. The diffusion equation for each species in single-phase multicomponent system can be expressed as .. math:: \frac{\partial C_j}{\partial t} = D_{jj}\nabla^2 C_j + D_{j}\nabla\cdot \frac{C_j}{1 - \sum_{\substack{k=2\\ k \neq j}}^{n-1} C_k} \sum_{\substack{i=2\\ i \neq j}}^{n-1} \nabla C_i where :math:`C_j` is the concentration of the :math:`j^\text{th}` species, :math:`t` is time, :math:`D_{jj}` is the self-diffusion coefficient of the :math:`j^\text{th}` species, and :math:`\sum_{\substack{i=2\\ i \neq j}}^{n-1}` represents the summation over all substitutional species in the system, excluding the solvent and the component of interest. We solve the problem on a 1D mesh >>> nx = 400 >>> dx = 0.01 >>> L = nx * dx >>> from fipy import * >>> mesh = Grid1D(dx = dx, nx = nx) One component in this ternary system will be designated the "solvent" >>> class ComponentVariable(CellVariable): ... def __init__(self, mesh, value = 0., name = '', ... standardPotential = 0., barrier = 0., ... diffusivity = None, valence = 0, equation = None): ... CellVariable.__init__(self, mesh = mesh, value = value, ... name = name) ... self.standardPotential = standardPotential ... self.barrier = barrier ... self.diffusivity = diffusivity ... self.valence = valence ... self.equation = equation ... ... def copy(self): ... return self.__class__(mesh = self.getMesh(), ... value = self.getValue(), ... name = self.getName(), ... standardPotential = ... self.standardPotential, ... barrier = self.barrier, ... diffusivity = self.diffusivity, ... valence = self.valence, ... equation = self.equation) >>> solvent = ComponentVariable(mesh = mesh, name = 'Cn', value = 1.) We can create an arbitrary number of components, simply by providing a :keyword:`tuple` or :keyword:`list` of components >>> substitutionals = [ ... ComponentVariable(mesh = mesh, name = 'C1', diffusivity = 1., ... standardPotential = 1., barrier = 1.), ... ComponentVariable(mesh = mesh, name = 'C2', diffusivity = 1., ... standardPotential = 1., barrier = 1.), ... ] >>> interstitials = [] >>> for component in substitutionals: ... solvent -= component We separate the solution domain into two different concentration regimes >>> x = mesh.getCellCenters()[0] >>> substitutionals[0].setValue(0.3) >>> substitutionals[0].setValue(0.6, where=x > L / 2) >>> substitutionals[1].setValue(0.6) >>> substitutionals[1].setValue(0.3, where=x > L / 2) We create one diffusion equation for each substitutional component >>> for Cj in substitutionals: ... CkSum = ComponentVariable(mesh = mesh, value = 0.) ... CkFaceSum = FaceVariable(mesh = mesh, value = 0.) ... for Ck in [Ck for Ck in substitutionals if Ck is not Cj]: ... CkSum += Ck ... CkFaceSum += Ck.getHarmonicFaceValue() ... ... convectionCoeff = CkSum.getFaceGrad() \ ... * (Cj.diffusivity / (1. - CkFaceSum)) ... ... Cj.equation = (TransientTerm() ... == DiffusionTerm(coeff=Cj.diffusivity) ... + PowerLawConvectionTerm(coeff=convectionCoeff)) If we are running interactively, we create a viewer to see the results >>> if __name__ == '__main__': ... viewer = Viewer(vars=[solvent] + substitutionals, ... datamin=0, datamax=1) ... viewer.plot() Now, we iterate the problem to equilibrium, plotting as we go >>> for i in range(40): ... for Cj in substitutionals: ... Cj.updateOld() ... for Cj in substitutionals: ... Cj.equation.solve(var = Cj, ... dt = 10000.) ... if __name__ == '__main__': ... viewer.plot() Since there is nothing to maintain the concentration separation in this problem, we verify that the concentrations have become uniform >>> substitutionals[0].allclose(0.45, rtol = 1e-7, atol = 1e-7).getValue() 1 >>> substitutionals[1].allclose(0.45, rtol = 1e-7, atol = 1e-7).getValue() 1 """ __docformat__ = 'restructuredtext' if __name__ == '__main__': ## from fipy.tools.profiler.profiler import Profiler ## from fipy.tools.profiler.profiler import calibrate_profiler # fudge = calibrate_profiler(10000) # profile = Profiler('profile', fudge=fudge) import fipy.tests.doctestPlus exec(fipy.tests.doctestPlus._getScript()) # profile.stop() raw_input("finished")
[ "regmisk@gmail.com" ]
regmisk@gmail.com
b4e3ece9d63cafcc0094b68b757097aa4f19d1a0
6c00499dfe1501294ac56b0d1607fb942aafc2ee
/eventregistry/Query.py
b5101c6dd57c31efc43c5f5eb21add58b4e548fd
[ "MIT" ]
permissive
EventRegistry/event-registry-python
dd692729cb5c505e421d4b771804e712e5b6442b
bf3ce144fa61cc195840591bae5ca88b31ca9139
refs/heads/master
2023-07-06T11:04:41.033864
2023-06-23T08:40:31
2023-06-23T08:40:31
40,995,963
176
48
MIT
2020-10-21T09:17:06
2015-08-18T20:29:23
Python
UTF-8
Python
false
false
16,151
py
from .Base import QueryParamsBase, QueryItems import six, datetime from typing import Union, List class _QueryCore(object): def __init__(self): self._queryObj = {} def getQuery(self): return self._queryObj def setQueryParam(self, paramName, val): self._queryObj[paramName] = val def _setValIfNotDefault(self, propName, value, defVal): if value != defVal: self._queryObj[propName] = value class BaseQuery(_QueryCore): def __init__(self, keyword: Union[str, QueryItems, None] = None, conceptUri: Union[str, QueryItems, None] = None, categoryUri: Union[str, QueryItems, None] = None, sourceUri: Union[str, QueryItems, None] = None, locationUri: Union[str, QueryItems, None] = None, lang: Union[str, QueryItems, None] = None, dateStart: Union[datetime.datetime, datetime.date, str, None] = None, dateEnd: Union[datetime.datetime, datetime.date, str, None] = None, sourceLocationUri: Union[str, List[str], None] = None, sourceGroupUri: Union[str, List[str], None] = None, # article or event search only: dateMention: Union[datetime.datetime, datetime.date, str, None] = None, authorUri: Union[str, List[str], None] = None, keywordLoc: str = "body", # event search only: minMaxArticlesInEvent = None, # mention search only: industryUri: Union[str, QueryItems, None] = None, sdgUri: Union[str, QueryItems, None] = None, sasbUri: Union[str, QueryItems, None] = None, esgUri: Union[str, QueryItems, None] = None, # universal: exclude: Union["BaseQuery", "CombinedQuery", None] = None): """ @param keyword: keyword(s) to query. Either None, string or QueryItems instance @param conceptUri: concept(s) to query. Either None, string or QueryItems instance @param sourceUri: source(s) to query. Either None, string or QueryItems instance @param locationUri: location(s) to query. Either None, string or QueryItems instance @param categoryUri: categories to query. Either None, string or QueryItems instance @param lang: language(s) to query. Either None, string or QueryItems instance @param dateStart: starting date. Either None, string or date or datetime @param dateEnd: ending date. Either None, string or date or datetime @param dateMention: search by mentioned dates - Either None, string or date or datetime or a list of these types @param sourceLocationUri: find content generated by news sources at the specified geographic location - can be a city URI or a country URI. Multiple items can be provided using a list @param sourceGroupUri: a single or multiple source group URIs. A source group is a group of news sources, commonly defined based on common topic or importance @param authorUri: author(s) to query. Either None, string or QueryItems instance @param keywordLoc: where should we look when searching using the keywords provided by "keyword" parameter. "body" (default), "title", or "body,title" @param minMaxArticlesInEvent: a tuple containing the minimum and maximum number of articles that should be in the resulting events. Parameter relevant only if querying events @param exclude: a instance of BaseQuery, CombinedQuery or None. Used to filter out results matching the other criteria specified in this query """ super(BaseQuery, self).__init__() self._setQueryArrVal("keyword", keyword) self._setQueryArrVal("conceptUri", conceptUri) self._setQueryArrVal("categoryUri", categoryUri) self._setQueryArrVal("sourceUri", sourceUri) self._setQueryArrVal("locationUri", locationUri) self._setQueryArrVal("lang", lang) # starting date of the published articles (e.g. 2014-05-02) if dateStart is not None: self._queryObj["dateStart"] = QueryParamsBase.encodeDate(dateStart) # ending date of the published articles (e.g. 2014-05-02) if dateEnd is not None: self._queryObj["dateEnd"] = QueryParamsBase.encodeDate(dateEnd) # mentioned date detected in articles (e.g. 2014-05-02) if dateMention is not None: if isinstance(dateMention, list): self._queryObj["dateMention"] = [QueryParamsBase.encodeDate(d) for d in dateMention] else: self._queryObj["dateMention"] = QueryParamsBase.encodeDate(dateMention) self._setQueryArrVal("sourceLocationUri", sourceLocationUri) self._setQueryArrVal("sourceGroupUri", sourceGroupUri) self._setQueryArrVal("authorUri", authorUri) self._setQueryArrVal("industryUri", industryUri) self._setQueryArrVal("sdgUri", sdgUri) self._setQueryArrVal("sasbUri", sasbUri) self._setQueryArrVal("esgUri", esgUri) if keywordLoc != "body": self._queryObj["keywordLoc"] = keywordLoc if minMaxArticlesInEvent is not None: assert isinstance(minMaxArticlesInEvent, tuple), "minMaxArticlesInEvent parameter should either be None or a tuple with two integer values" self._queryObj["minArticlesInEvent"] = minMaxArticlesInEvent[0] self._queryObj["maxArticlesInEvent"] = minMaxArticlesInEvent[1] if exclude is not None: assert isinstance(exclude, (CombinedQuery, BaseQuery)), "exclude parameter was not a CombinedQuery or BaseQuery instance" self._queryObj["$not"] = exclude.getQuery() def _setQueryArrVal(self, propName: str, value): # by default we have None - so don't do anything if value is None: return # if we have an instance of QueryItems then apply it if isinstance(value, QueryItems): self._queryObj[propName] = { value.getOper(): value.getItems() } # if we have a string value, just use it elif isinstance(value, six.string_types): self._queryObj[propName] = value # there should be no other valid types else: assert False, "Parameter '%s' was of unsupported type. It should either be None, a string or an instance of QueryItems" % (propName) class CombinedQuery(_QueryCore): def __init__(self): super(CombinedQuery, self).__init__() @staticmethod def AND(queryArr: List[Union["BaseQuery", "CombinedQuery"]], exclude: Union["BaseQuery", "CombinedQuery", None] = None): """ create a combined query with multiple items on which to perform an AND operation @param queryArr: a list of items on which to perform an AND operation. Items can be either a CombinedQuery or BaseQuery instances. @param exclude: a instance of BaseQuery, CombinedQuery or None. Used to filter out results matching the other criteria specified in this query """ assert isinstance(queryArr, list), "provided argument as not a list" assert len(queryArr) > 0, "queryArr had an empty list" q = CombinedQuery() q.setQueryParam("$and", []) for item in queryArr: assert isinstance(item, (CombinedQuery, BaseQuery)), "item in the list was not a CombinedQuery or BaseQuery instance" q.getQuery()["$and"].append(item.getQuery()) if exclude is not None: assert isinstance(exclude, (CombinedQuery, BaseQuery)), "exclude parameter was not a CombinedQuery or BaseQuery instance" q.setQueryParam("$not", exclude.getQuery()) return q @staticmethod def OR(queryArr: List[Union["BaseQuery", "CombinedQuery"]], exclude: Union["BaseQuery", "CombinedQuery", None] = None): """ create a combined query with multiple items on which to perform an OR operation @param queryArr: a list of items on which to perform an OR operation. Items can be either a CombinedQuery or BaseQuery instances. @param exclude: a instance of BaseQuery, CombinedQuery or None. Used to filter out results matching the other criteria specified in this query """ assert isinstance(queryArr, list), "provided argument as not a list" assert len(queryArr) > 0, "queryArr had an empty list" q = CombinedQuery() q.setQueryParam("$or", []) for item in queryArr: assert isinstance(item, (CombinedQuery, BaseQuery)), "item in the list was not a CombinedQuery or BaseQuery instance" q.getQuery()["$or"].append(item.getQuery()) if exclude is not None: assert isinstance(exclude, (CombinedQuery, BaseQuery)), "exclude parameter was not a CombinedQuery or BaseQuery instance" q.setQueryParam("$not", exclude.getQuery()) return q class ComplexArticleQuery(_QueryCore): def __init__(self, query: Union["BaseQuery", "CombinedQuery"], dataType: Union[str, List[str]] = "news", minSentiment: Union[float, None] = None, maxSentiment: Union[float, None] = None, minSocialScore: int = 0, minFacebookShares: int = 0, startSourceRankPercentile: int = 0, endSourceRankPercentile: int = 100, isDuplicateFilter: str = "keepAll", hasDuplicateFilter: str = "keepAll", eventFilter: str = "keepAll"): """ create an article query using a complex query @param query: an instance of CombinedQuery or BaseQuery to use to find articles that match the conditions @param dataType: data type to search for. Possible values are "news" (news content), "pr" (PR content) or "blogs". If you want to use multiple data types, put them in an array (e.g. ["news", "pr"]) @param minSentiment: what should be the minimum sentiment on the articles in order to return them (None means that we don't filter by sentiment) @param maxSentiment: what should be the maximum sentiment on the articles in order to return them (None means that we don't filter by sentiment) @param minSocialScore: at least how many times should the articles be shared on social media in order to return them @param minFacebookShares: at least how many times should the articles be shared on Facebook in order to return them @param startSourceRankPercentile: starting percentile of the sources to consider in the results (default: 0). Value should be in range 0-90 and divisible by 10. @param endSourceRankPercentile: ending percentile of the sources to consider in the results (default: 100). Value should be in range 10-100 and divisible by 10. @param isDuplicateFilter: some articles can be duplicates of other articles. What should be done with them. Possible values are: "skipDuplicates" (skip the resulting articles that are duplicates of other articles) "keepOnlyDuplicates" (return only the duplicate articles) "keepAll" (no filtering, default) @param hasDuplicateFilter: some articles are later copied by others. What should be done with such articles. Possible values are: "skipHasDuplicates" (skip the resulting articles that have been later copied by others) "keepOnlyHasDuplicates" (return only the articles that have been later copied by others) "keepAll" (no filtering, default) @param eventFilter: some articles describe a known event and some don't. This filter allows you to filter the resulting articles based on this criteria. Possible values are: "skipArticlesWithoutEvent" (skip articles that are not describing any known event in ER) "keepOnlyArticlesWithoutEvent" (return only the articles that are not describing any known event in ER) "keepAll" (no filtering, default) """ super(ComplexArticleQuery, self).__init__() assert isinstance(query, (CombinedQuery, BaseQuery)), "query parameter was not a CombinedQuery or BaseQuery instance" self._queryObj["$query"] = query.getQuery() filter = {} if dataType != "news": filter["dataType"] = dataType if minSentiment is not None: filter["minSentiment"] = minSentiment if maxSentiment is not None: filter["maxSentiment"] = maxSentiment if minSocialScore > 0: filter["minSocialScore"] = minSocialScore if minFacebookShares > 0: filter["minFacebookShares"] = minFacebookShares if startSourceRankPercentile != 0: filter["startSourceRankPercentile"] = startSourceRankPercentile if endSourceRankPercentile != 100: filter["endSourceRankPercentile"] = endSourceRankPercentile if isDuplicateFilter != "keepAll": filter["isDuplicate"] = isDuplicateFilter if hasDuplicateFilter != "keepAll": filter["hasDuplicate"] = hasDuplicateFilter if eventFilter != "keepAll": filter["hasEvent"] = eventFilter if len(filter) > 0: self._queryObj["$filter"] = filter class ComplexEventQuery(_QueryCore): def __init__(self, query: Union["BaseQuery", "CombinedQuery"], minSentiment: Union[float, None] = None, maxSentiment: Union[float, None] = None): """ create an event query using a complex query @param query: an instance of CombinedQuery or BaseQuery to use to find events that match the conditions """ super(ComplexEventQuery, self).__init__() assert isinstance(query, (CombinedQuery, BaseQuery)), "query parameter was not a CombinedQuery or BaseQuery instance" filter = {} if minSentiment is not None: filter["minSentiment"] = minSentiment if maxSentiment is not None: filter["maxSentiment"] = maxSentiment if len(filter) > 0: self._queryObj["$filter"] = filter self._queryObj["$query"] = query.getQuery() class ComplexMentionQuery(_QueryCore): def __init__(self, query: Union["BaseQuery", "CombinedQuery"], minSentiment: Union[float, None] = None, maxSentiment: Union[float, None] = None, minSentenceIndex: Union[int, None] = None, maxSentenceIndex: Union[int, None] = None, showDuplicates: bool = False): """ create a mention query using a complex query @param query: an instance of CombinedQuery or BaseQuery to use to find events that match the conditions @param minSentiment: the minimum sentiment of the mentions to return @param maxSentiment: the maximum sentiment of the mentions to return @param minSentenceIndex: the minimum sentence index of the mentions to return @param maxSentenceIndex: the maximum sentence index of the mentions to return """ super(ComplexMentionQuery, self).__init__() assert isinstance(query, (CombinedQuery, BaseQuery)), "query parameter was not a CombinedQuery or BaseQuery instance" filter = {} if minSentiment is not None: filter["minSentiment"] = minSentiment if maxSentiment is not None: filter["maxSentiment"] = maxSentiment if minSentenceIndex is not None: filter["minSentenceIndex"] = minSentenceIndex if maxSentenceIndex is not None: filter["maxSentenceIndex"] = maxSentenceIndex if showDuplicates: filter["showDuplicates"] = showDuplicates if len(filter) > 0: self._queryObj["$filter"] = filter self._queryObj["$query"] = query.getQuery()
[ "gleban@gmail.com" ]
gleban@gmail.com
4f1582bbf56436afb92f7af0ff6c1f673aacefc3
d625191d67030c8008e3e60264ca0cfe7c0cb3d9
/test_rollsum.py
4274b65a958c8d4bc6318aa82d0f5e8c30644cf2
[ "MIT" ]
permissive
pombredanne/camlipy
be809215e6aa562eb4e694fc40131b921dd94178
e17069e5609e5ca93baf7a484eb5975ab230d06f
refs/heads/master
2021-01-17T14:04:32.471174
2013-10-02T20:31:51
2013-10-02T20:31:51
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,278
py
# -*- coding: utf-8 -*- __author__ = 'Thomas Sileo (thomas@trucsdedev.com)' import random from camlipy.rollsum import Rollsum, WINDOW_SIZE def test_rollsum(): buf = [] for i in range(100000): buf.append(random.randint(0, 255)) def rsum(offset, length): """ Test function that returns Rollsum digest. """ rs = Rollsum() for b in buf[offset:length]: rs.roll(b) return rs.digest() sum1a = rsum(0, len(buf)) sum1b = rsum(1, len(buf)) assert sum1a == sum1b sum2a = rsum(len(buf) - WINDOW_SIZE * 5 / 2, len(buf) - WINDOW_SIZE) sum2b = rsum(0, len(buf) - WINDOW_SIZE) assert sum2a == sum2b sum3a = rsum(0, WINDOW_SIZE + 3) sum3b = rsum(3, WINDOW_SIZE + 3) assert sum3a == sum3b def benchmark_rollsum(): bytes_size = 1024 * 1024 * 5 rs = Rollsum() splits = 0 for i in range(bytes_size): rs.roll(random.randint(0, 255)) if rs.on_split(): rs.bits() splits += 1 every = int(bytes_size / splits) print 'num splits: {0}; every {1} bytes.'.format(splits, every) if __name__ == '__main__': import time start = time.time() test_rollsum() benchmark_rollsum() end = time.time() print start - end
[ "thomas.sileo@gmail.com" ]
thomas.sileo@gmail.com
b5d487b81b641cc90591376e94929e2e5628c3a1
bb4d490ee0af38c02ff5ab324a69a47a5df58acc
/recomendr/wsgi.py
9dab3d4f4fcdc4d318faf3ee77b21612cced267f
[]
no_license
courageousillumination/recomendr
e0c56a68fce3477ae365d0f8751bf15237e1ee5b
279d0571dd4560f788e50a32ac45a1a4086e0c50
refs/heads/master
2016-09-01T18:10:59.458408
2014-05-10T18:30:59
2014-05-10T18:30:59
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,428
py
""" WSGI config for recomendr project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` setting. Usually you will have the standard Django WSGI application here, but it also might make sense to replace the whole Django WSGI application with a custom one that later delegates to the Django one. For example, you could introduce WSGI middleware here, or combine a Django application with an application of another framework. """ import os # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks # if running multiple sites in the same mod_wsgi process. To fix this, use # mod_wsgi daemon mode with each site in its own daemon process, or use # os.environ["DJANGO_SETTINGS_MODULE"] = "recomendr.settings" os.environ.setdefault("DJANGO_SETTINGS_MODULE", "recomendr.settings") # This application object is used by any WSGI server configured to use this # file. This includes Django's development server, if the WSGI_APPLICATION # setting points here. from django.core.wsgi import get_wsgi_application application = get_wsgi_application() # Apply WSGI middleware here. # from helloworld.wsgi import HelloWorldApplication # application = HelloWorldApplication(application)
[ "tristanr93@gmail.com" ]
tristanr93@gmail.com
f2b143296fbea3999a82fe232f7a8f0538481cb9
87921ae417ff1e47a086ce03747509666f9d1dd0
/ServerConsole/test/retstat.py
5a48298d0ef99fae9aa00beb0e705731f6a3f829
[]
no_license
Demon-HY/monitor-history
f7e0ad0f0763a22d4afabc99ed049a634ba4790b
1c268d1704a87bd9369e93e5afb68e0dea6a3f59
refs/heads/master
2021-06-13T16:55:00.595005
2017-04-11T03:47:37
2017-04-11T03:47:37
75,525,738
1
0
null
null
null
null
UTF-8
Python
false
false
2,269
py
# coding:utf8 # System Error OK = "OK" # 错误码:参数错误 ERR_BAD_PARAMS = "ERR_BAD_PARAMS" # 错误码:无访问权限 ERR_FORBIDDEN = "ERR_FORBIDDEN" # 错误码:非法JSON串 ERR_INVALID_JSON = "ERR_INVALID_JSON" # 错误码:资源不存在 ERR_NOT_FOUND = "ERR_NOT_FOUND" # 错误码:无法解析post数据 ERR_READ_POST_EXCEPTION = "ERR_READ_POST_EXCEPTION" # 错误码:没有返回码 ERR_STAT_NOT_SET = "ERR_STAT_NOT_SET" # 错误码:服务端异常 ERR_SERVER_EXCEPTION = "ERR_SERVER_EXCEPTION" # 错误码:事件中断 ERR_EVENT_INTERRUPT = "ERR_EVENT_INTERRUPT" # 错误码:用户没有登录 ERR_USER_NOT_LOGIN = "ERR_USER_NOT_LOGIN" # 错误码:邮件队列已满 ERR_MAILBOX_FULL = "ERR_MAILBOX_FULL" # 错误码:不支持该操作 ERR_OPERATION_NOT_SUPPORTED = "ERR_OPERATION_NOT_SUPPORTED" # auth,user model # 该账号已被使用 ERR_ACCOUNT_EXIST = "ERR_ACCOUNT_EXIST" # 手机号已经被绑定 ERR_PHONE_ALREADY_BOUND = "ERR_PHONE_ALREADY_BOUND" # 请不要重复发送验证码 ERR_SEND_CODE_FREQUENTLY = "ERR_SEND_CODE_FREQUENTLY" # 验证码错误 ERR_CODE = "ERR_CODE" # 清除用户数据失败 ERR_CLEAN_ACCOUNT_FAILED = "ERR_CLEAN_ACCOUNT_FAILED" # 注册登录信息失败 ERR_ADD_LOGIN_ID_FAILED = "ERR_ADD_LOGIN_ID_FAILED" # 账号不存在 ERR_NO_SUCH_ACCOUNT = "ERR_NO_SUCH_ACCOUNT" # 用户不存在 ERR_USER_NOT_FOUND = "ERR_USER_NOT_FOUND" # 用户信息损坏 ERR_USER_INFO_BROKEN = "ERR_USER_INFO_BROKEN" # 密码错误 ERR_INVALID_PASSWORD = "ERR_INVALID_PASSWORD" # 密码过期 ERR_PASSWORD_EXPIRED = "ERR_PASSWORD_EXPIRED" # 非法账号类型 ERR_ILLEGAL_ACCOUNT_TYPE = "ERR_ILLEGAL_ACCOUNT_TYPE" # 非法邮箱 ERR_ILLEGAL_EMAIL_ACCOUNT = "ERR_ILLEGAL_EMAIL_ACCOUNT" # 非法手机号 ERR_ILLEGAL_PHONE_ACCOUNT = "ERR_ILLEGAL_PHONE_ACCOUNT" # 用户还未登录 ERR_TOKEN_NOT_FOUND = "ERR_TOKEN_NOT_FOUND" # 用户登录超时 ERR_TOKEN_EXPIRED = "ERR_TOKEN_EXPIRED" # 验证码过期 ERR_VALIDATE_CODE_EXPIRED = "ERR_VALIDATE_CODE_EXPIRED" # 验证码错误 ERR_INVALID_VALIDATE_CODE = "ERR_INVALID_VALIDATE_CODE" # 登录的用户与新建token用户不为一个用户 ERR_TOKEN_UID_MISMATCHING = "ERR_TOKEN_UID_MISMATCHING" # 错误码:用户已被锁定 ERR_USER_LOCKED = "ERR_USER_LOCKED"
[ "1764496637@qq.com" ]
1764496637@qq.com
e4819429a7fe9df8fcb508e0a4e58e531c3b358e
c6d4fa98b739a64bb55a8750b4aecd0fc0b105fd
/ScanPi/QRbytes/472.py
cd01befc97225989650424096a854c59ae1dc148
[]
no_license
NUSTEM-UK/Heart-of-Maker-Faire
de2c2f223c76f54a8b4c460530e56a5c74b65ca3
fa5a1661c63dac3ae982ed080d80d8da0480ed4e
refs/heads/master
2021-06-18T13:14:38.204811
2017-07-18T13:47:49
2017-07-18T13:47:49
73,701,984
2
0
null
null
null
null
UTF-8
Python
false
false
94,948
py
data = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF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x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x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F0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00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0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,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0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x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 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,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, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0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0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF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 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0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xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
[ "jonathan.sanderson@northumbria.ac.uk" ]
jonathan.sanderson@northumbria.ac.uk
5cd9e9dd98ec55f0c9de426827164c6dd342b934
873e591baaede123face7c317e6e014df0366d65
/listeners/ADBCatAllListener.py
ce3e940144667dd926a4cc04f5e5d11ac9d9c00a
[]
no_license
Lynazhang/UIDocMonkey
aa57521c86448242c12bc704b356e72e3ccfbd76
3fbc41b7c70b43851b2e74e5b32ac912e82d8ba4
refs/heads/master
2021-06-09T17:32:21.483718
2016-11-22T13:59:44
2016-11-22T13:59:44
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,660
py
import SocketServer from subprocess import* import json from threading import Timer class ADBCatAllListener(SocketServer.BaseRequestHandler): """ The RequestHandler class for our server. It is instantiated once per connection to the server, and must override the handle() method to implement communication to the client. """ def handle(self): # self.request is the TCP socket connected to the client self.data = self.request.recv(10240) self.data = self.data.strip() print self.data self.procs=[] self.HandleMessage(self.data) def HandleMessage(self,data): try: dicts=json.loads(data.strip()) print dicts if "tag" in dicts: tag=dicts["tag"] if tag=="start": command=dicts["command"] filename=dicts["filename"] duration=dicts["duration"] proc=self.dumpLogcat(filename,command,duration) except: print "parse failed" pass def terminate(self,process): if process.poll() is None: try: process.terminate() except: pass def dumpLogcat(self,filename,command,duration): print command p = Popen(command, creationflags=CREATE_NEW_CONSOLE,stdout=PIPE, stderr=PIPE, bufsize=1, universal_newlines=True) print "here" timer = Timer(duration, self.terminate, args=[p]) timer.start() f=file(filename,'w') for line in iter(p.stdout.readline, ''): f.write(line.strip()+"\n") f.flush() p.stdout.close() p.wait() timer.cancel() ''' while True: line = p.stdout.readline() flag=self.readFlag() print "found flag",flag if flag: print "ready to kill" p.kill() break if not line: break if line.strip()!="": f.write(line) f.flush() ''' return p def dumpLogcatEvent(self): return if __name__ == "__main__": HOST, PORT = "127.0.0.1", 10004 # Create the server, binding to localhost on port 9999 server = SocketServer.TCPServer((HOST, PORT), ADBCatAllListener) # Activate the server; this will keep running until you # interrupt the program with Ctrl-C server.serve_forever()
[ "v-lzhani@microsoft.com" ]
v-lzhani@microsoft.com
60d6cb2db006e20e4b18abeedfcd5b7a69a9801b
5d48aba44824ff9b9ae7e3616df10aad323c260e
/tree/653.two_sum_IV_input_is_a_BST.py
4ece9fd24ef54b435eb886456dcb70ac2d4e7d17
[]
no_license
eric496/leetcode.py
37eab98a68d6d3417780230f4b5a840f6d4bd2a6
32a76cf4ced6ed5f89b5fc98af4695b8a81b9f17
refs/heads/master
2021-07-25T11:08:36.776720
2021-07-01T15:49:31
2021-07-01T15:49:31
139,770,188
3
0
null
null
null
null
UTF-8
Python
false
false
940
py
""" Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. Example 1: Input: 5 / \ 3 6 / \ \ 2 4 7 Target = 9 Output: True Example 2: Input: 5 / \ 3 6 / \ \ 2 4 7 Target = 28 Output: False """ # Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None # Solution 1: class Solution: def findTarget(self, root: TreeNode, k: int) -> bool: target = set() return self.dfs(root, k, target) def dfs(self, root: TreeNode, k: int, target: int) -> bool: if not root: return False if root.val in target: return True else: target.add(k - root.val) return self.dfs(root.left, k, target) or self.dfs(root.right, k, target)
[ "eric.mlengineer@gmail.com" ]
eric.mlengineer@gmail.com
f3b5e09e66bafffac5eec9791d1a6b1d10af59e6
64ebf80fb795daab018241ee2933732866540d2a
/reservationapp/migrations/0004_alter_reservation_seat.py
e0c0c640e96a524778da1de1c7ad4c11ec3439fe
[]
no_license
minwoo9629/ticketing_service
48248fb66e4cf0209d77224212d41c647dff6d05
2367dd3dd15a12e7ccf707ee1824d6b22662abcb
refs/heads/main
2023-08-14T16:41:32.092443
2021-09-24T13:18:34
2021-09-24T13:18:34
387,129,430
0
0
null
null
null
null
UTF-8
Python
false
false
626
py
# Generated by Django 3.2.5 on 2021-08-11 17:36 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('concertapp', '0016_remove_seat_reserve'), ('reservationapp', '0003_auto_20210811_1608'), ] operations = [ migrations.AlterField( model_name='reservation', name='seat', field=models.ForeignKey(blank=True, limit_choices_to={'reservation': False}, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reservation', to='concertapp.seat'), ), ]
[ "minwoo9629@gmail.com" ]
minwoo9629@gmail.com
652a982f2c2c8f30b11e873185f76263a3ae85b2
0bc2f9fd2a8cf8acfb36e88b9fd489921b7afaa0
/resumes/forms.py
53217e956929e64f729c406117481db6bcac60d1
[]
no_license
temitope3201/hng_resume_app
e83bf108be921602467b55e9934ee815f2e39f45
c1bfa43711d0fc5d0c82539522e42a7f857e3d32
refs/heads/main
2023-07-11T06:56:25.431978
2021-08-24T08:13:28
2021-08-24T08:13:28
398,298,694
0
0
null
null
null
null
UTF-8
Python
false
false
170
py
from django import forms from .models import Contact class ContactForm(forms.ModelForm): class Meta: model = Contact fields = ('email', 'message',)
[ "temitopeadebayo749@gmail.com" ]
temitopeadebayo749@gmail.com
2a189c9890d4fe2943b93bd7d46bd3a23066fce2
c48c71b2f798361d6892d3bec88a077839366d31
/phy/test_scripts/tput/tput_test.py
56287bef55935f0f5536d2f582a2bf9d9a6689e4
[]
no_license
wenh81/scatter-phy
5026d8fa6a38221e362f20c707f2b4d734c418ed
e9b1fec1eced5c356e753f79fd62567cca55aa02
refs/heads/master
2022-03-05T04:07:14.586517
2019-11-21T12:22:35
2019-11-21T12:22:35
null
0
0
null
null
null
null
UTF-8
Python
false
false
4,937
py
import select import socket import time import _thread import threading import getopt import queue import random from time import sleep import signal, os import sys sys.path.append('../../../') sys.path.append('../../../communicator/python/') from communicator.python.Communicator import Message from communicator.python.LayerCommunicator import LayerCommunicator import communicator.python.interf_pb2 as interf PRB_VECTOR = [6, 15, 25, 50] NOF_SLOTS_VECTOR = [1, 10, 25] MCS_VECTOR = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 31] tx_exit_flag = False def handler(signum, frame): global tx_exit_flag tx_exit_flag = True def getExitFlag(): global tx_exit_flag return tx_exit_flag def kill_phy(): os.system("~/radio_api/stop.sh") os.system("~/radio_api/kill_stack.py") os.system("killall -9 trx") os.system("killall -9 measure_throughput_fd_auto") def start_phy(nof_phys, bw, center_freq, comp_bw): cmd1 = "sudo ../../../build/phy/srslte/examples/trx -f " + str(center_freq) + " -E " + str(nof_phys) + " -B " + str(comp_bw) + " -p " + str(bw) + " &" os.system(cmd1) def start_tput_measurement(nof_prb, nof_slots, mcs, txgain, rxgain): cmd1 = "sudo ../../../build/phy/srslte/examples/measure_throughput_fd_auto -b " + str(txgain) + " -g " + str(rxgain) + " -n " + str(nof_slots) + " -m " + str(mcs) + " -p " + str(nof_prb) os.system(cmd1) def start_scenario(): cmd1 = "colosseumcli rf start 8981 -c" os.system(cmd1) def save_files(nof_prb): cmd1 = "mkdir dir_tput_prb_" + str(nof_prb) os.system(cmd1) cmd2 = "mv tput_prb_* dir_tput_prb_" + str(nof_prb) os.system(cmd2) cmd3 = "tar -cvzf" + " dir_tput_prb_" + str(nof_prb) + ".tar.gz" + " dir_tput_prb_" + str(nof_prb) + "/" os.system(cmd3) def get_bw_from_prb(nof_prb): bw = 0 if(nof_prb == 6): bw = 1400000 elif(nof_prb == 15): bw = 3000000 elif(nof_prb == 25): bw = 5000000 elif(nof_prb == 50): bw = 10000000 else: printf("Invalid number of PRB") exit(-1) return bw def inputOptions(argv): nof_prb = 25 # By dafult we set the number of resource blocks to 25, i.e., 5 MHz bandwidth. mcs = 0 # By default MCS is set to 0, the most robust MCS. txgain = 10 # By default TX gain is set to 10. rxgain = 10 # By default RX gain is set to 10. tx_slots = 1 tx_channel = 0 rx_channel = 0 run_scenario = False center_freq = 2500000000 comp_bw = 40000000 nof_phys = 2 try: opts, args = getopt.getopt(argv,"h",["help","bw=","mcs=","txgain=","rxgain=","txslots=","txchannel=","rxchannel=","runscenario","centerfreq=","compbw=","nofphys="]) except getopt.GetoptError: help() sys.exit(2) for opt, arg in opts: if opt in ("--help"): sys.exit() elif opt in ("--bw"): nof_prb = int(arg) elif opt in ("--mcs"): mcs = int(arg) elif opt in ("--txgain"): txgain = int(arg) elif opt in ("--rxgain"): rxgain = int(arg) elif opt in ("--txslots"): tx_slots = int(arg) elif opt in ("--txchannel"): tx_channel = int(arg) elif opt in ("--rxchannel"): rx_channel = int(arg) elif opt in ("--runscenario"): run_scenario = True elif opt in ("--centerfreq"): center_freq = int(arg) elif opt in ("--compbw"): comp_bw = int(arg) elif opt in ("--nofphys"): nof_phys = int(arg) return nof_prb, mcs, txgain, rxgain, tx_slots, tx_channel, rx_channel, run_scenario, center_freq, comp_bw, nof_phys if __name__ == '__main__': # Set the signal handler. signal.signal(signal.SIGINT, handler) nof_prb, mcs, txgain, rxgain, tx_slots, tx_channel, rx_channel, run_scenario, center_freq, comp_bw, nof_phys = inputOptions(sys.argv[1:]) if(run_scenario == True): start_scenario() time.sleep(10) for prb_idx in range(0,len(PRB_VECTOR)): nof_prb = PRB_VECTOR[prb_idx] bw = get_bw_from_prb(nof_prb) for mcs_idx in range(0,len(MCS_VECTOR)): for nof_slots_idx in range(0,len(NOF_SLOTS_VECTOR)): # Make sure PHY is not running. kill_phy() time.sleep(5) # Start PHY. start_phy(nof_phys, bw, center_freq, comp_bw) time.sleep(15) nof_slots = NOF_SLOTS_VECTOR[nof_slots_idx] mcs = MCS_VECTOR[mcs_idx] start_tput_measurement(nof_prb, nof_slots, mcs, txgain, rxgain) if(getExitFlag() == True): exit(0) if(getExitFlag() == True): exit(0) # Save files. save_files(nof_prb) if(getExitFlag() == True): exit(0)
[ "zz4fap@users.noreply.github.com" ]
zz4fap@users.noreply.github.com
479053d6aa7c88f3da69053c1db32172e48dadc4
af1723ba6a09cc116c1a7697c990bcf3349dfa6e
/Python book/Chapter_8/even.py
ffc65a4aea62740f873797127a73b7d8a11f5b2d
[]
no_license
ballib/SC-T-111-PROG
1eb7233c985ddb8330a604bb3191f64147ea2c78
24f63aa1e1a7dc7e891f3ad916039f39da58d5c3
refs/heads/master
2020-12-05T03:38:46.335547
2019-01-10T11:07:12
2019-01-10T11:07:12
null
0
0
null
null
null
null
UTF-8
Python
false
false
599
py
def evens(n): evens_list = [] for i in range(1,n+1): evens_list.append(2*i) return evens_list # or def evens2(n): return [2*i for i in range(1, n+1)] print(evens(5)) print(evens2(5)) ####################################### def mirror(pair): return pair[1], pair[0] first, second = mirror((2,3)) mirror((2,3)) print(first) print(second) print(first,second) a_tuple = mirror((2,3)) print(a_tuple) ######################################## def func1(param_required, param_default = 2): print(param_required, param_default) print(func1(5,6)) print(func1(5))
[ "jonio18@ru.is" ]
jonio18@ru.is
d7b88364e46a9b7f3dd0506ed9c5415e3564bb45
5fae31c2aa1e47f82048e9856778efc35106e248
/django/orm/orm/settings.py
3ecd159fd73b5f3d98d3dd9a05e9eea90a1f80f3
[]
no_license
Eomazing/TIL-c9
989f208cf3947ef32eac9a68704d70d8aa1b2330
bd1e2361d3ecfc677b6851edf6fc9b49d9e74951
refs/heads/master
2020-04-17T17:18:05.943544
2019-05-09T10:48:10
2019-05-09T10:48:10
166,777,139
0
0
null
null
null
null
UTF-8
Python
false
false
3,151
py
""" Django settings for orm project. Generated by 'django-admin startproject' using Django 2.1.8. 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 = '36%1b(^zz076oalcr!$k%mz*0j6e6vd*bil73=!yz54_7fdw$)' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_extensions', 'crud', 'onetomany', 'manytomany', ] 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 = 'orm.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 = 'orm.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/'
[ "amuse0701@gmail.com" ]
amuse0701@gmail.com
b439d7638443722eacd39df345093a0d8b47adfa
ded67d2ddc604fad9ff53caf33ffa69ccc229482
/bin/easy_install-3.7
ca6e4985a433e0a369c96fb8b7b1081627f8a336
[]
no_license
CeliaGMqrz/wagtail
ed5c3e6ca336e6de7361d9f4aae386f69bed36ad
1eddebb178630119dcfcb6000cb4e2b732d823f5
refs/heads/main
2023-03-04T03:14:14.546619
2021-02-17T20:51:53
2021-02-17T20:51:53
332,208,660
0
0
null
null
null
null
UTF-8
Python
false
false
255
7
#!/home/celiagm/venv/wagtail/bin/python3 # -*- coding: utf-8 -*- import re import sys from setuptools.command.easy_install import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(main())
[ "celiagm@debian" ]
celiagm@debian
cf59517324943219c2e5d63407b2866a634428cf
981901751c35eabaef52e263900d10ff22936830
/autoSvn.py
3bc4e8fa56756b2fd50f3d5bf37a861f17db5844
[]
no_license
tsuyuzaki00/subversionScripts
573ba23fb75d9e15a09ebb916b4ccbe7bd04676a
2414f771c2483b9452b4d4c5cc217b9d124f31e1
refs/heads/main
2023-02-01T22:13:51.896457
2020-12-17T02:02:43
2020-12-17T02:02:43
321,924,993
0
0
null
null
null
null
UTF-8
Python
false
false
1,831
py
import os import subprocess import svn.local def kameSvnAdd(_path): commit_command = [ "TortoiseProc", "/command:add", "/path:" + _path, "/closeforlocal:0" ] subprocess.call(commit_command) def kameSvnCommit(_path): message = "testUpdate_to_USD" commit_command = [ "TortoiseProc", "/command:commit", "/logmsg:" + message, "/path:" + _path, "/command:update" "/closeOnend:0" ] subprocess.call(commit_command) def svnUpdate(_path): _path = "D:/Shotgun_work/new_angle_test" os.chdir(_path) subprocess.call('svn up') def usdAdd(_path): svlocal = svn.local.LocalClient(_path) path = _path result = svlocal.run_command("status", [path, "--non-recursive"]) while(True): result = svlocal.run_command("status", [path, "--non-recursive"]) if(result[0] == "" or result[0][0] == "A"): break path, d = os.path.split(path) os.chdir(_path) files = os.listdir(_path) usdfiles = [file for file in files if '.usd' in file] for usd in usdfiles: subprocess.call('svn add ' + usd) def svnDCCtoUSD(_path): svlocal = svn.local.LocalClient(_path) path = _path result = svlocal.run_command("status", [path, "--non-recursive"]) while(True): result = svlocal.run_command("status", [path, "--non-recursive"]) if(result[0] == "" or result[0][0] == "A"): break path, d = os.path.split(path) os.chdir(_path) message = "Update_to_USD" subprocess.call("svn ci -m " + message) """ #Run scripts _path = "D:/Shotgun_work/new_angle_test/assets/01-Character/asset_test000/MDL/work/maya" kameSvnAdd(_path) kameSvnCommit(_path) svnUpdate(_path) usdAdd(_path) svnDCCtoUSD(_path) """
[ "tsuyuzaki.tatsuya@engi-st.jp" ]
tsuyuzaki.tatsuya@engi-st.jp
f1bfe5de0e26671054c332bdfc93d2f0d9d4265e
53fab060fa262e5d5026e0807d93c75fb81e67b9
/backup/user_070/ch74_2020_04_06_14_56_45_688915.py
fbd6fc22f27f23767e365de5db1099f9b9558694
[]
no_license
gabriellaec/desoft-analise-exercicios
b77c6999424c5ce7e44086a12589a0ad43d6adca
01940ab0897aa6005764fc220b900e4d6161d36b
refs/heads/main
2023-01-31T17:19:42.050628
2020-12-16T05:21:31
2020-12-16T05:21:31
306,735,108
0
0
null
null
null
null
UTF-8
Python
false
false
197
py
def conta_bigramas(x): dicionario = {} for i in range(len(x)-1): dicionario[x[i],x[i+1]] = 0 for i in range(len(x)-1): dicionario[x[i],x[i+1]] += 1 return dicionario
[ "you@example.com" ]
you@example.com
00ae17b2c630ccf0d4036a300ee15ed0a9356121
4e3c976773526fd610d64ffb83589bccfaee5e68
/sponge-app/sponge-app-demo-service/sponge/sponge_demo_depending.py
ff40131a936612f5da6d6cd33534a1a8234f44d8
[ "Apache-2.0" ]
permissive
softelnet/sponge
2313d2328953fcff49a002e727bb803757870627
7190f23ae888bbef49d0fbb85157444d6ea48bcd
refs/heads/master
2022-10-28T16:19:55.619882
2021-09-16T19:50:08
2021-09-16T19:50:08
95,256,030
10
2
Apache-2.0
2022-10-04T23:55:09
2017-06-23T20:58:49
Java
UTF-8
Python
false
false
2,884
py
""" Sponge Knowledge Base Demo """ class DependingArgumentsAction(Action): def onConfigure(self): self.withLabel("Depending arguments") self.withArgs([ StringType("continent").withLabel("Continent").withProvided(ProvidedMeta().withValueSet()), StringType("country").withLabel("Country").withProvided(ProvidedMeta().withValueSet().withDependency("continent")), StringType("city").withLabel("City").withProvided(ProvidedMeta().withValueSet().withDependency("country")), StringType("river").withLabel("River").withProvided(ProvidedMeta().withValueSet().withDependency("continent")), StringType("weather").withLabel("Weather").withProvided(ProvidedMeta().withValueSet()) ]).withResult(StringType().withLabel("Sentences")) self.withFeatures({"icon":"flag", "showClear":True, "showCancel":True}) def onCall(self, continent, country, city, river, weather): return "There is a city {} in {} in {}. The river {} flows in {}. It's {}.".format(city, country, continent, river, continent, weather.lower()) def onInit(self): self.countries = { "Africa":["Nigeria", "Ethiopia", "Egypt"], "Asia":["China", "India", "Indonesia"], "Europe":["Russia", "Germany", "Turkey"] } self.cities = { "Nigeria":["Lagos", "Kano", "Ibadan"], "Ethiopia":["Addis Ababa", "Gondar", "Mek'ele"], "Egypt":["Cairo", "Alexandria", "Giza"], "China":["Guangzhou", "Shanghai", "Chongqing"], "India":["Mumbai", "Delhi", "Bangalore"], "Indonesia":["Jakarta", "Surabaya", "Medan"], "Russia":["Moscow", "Saint Petersburg", "Novosibirsk"], "Germany":["Berlin", "Hamburg", "Munich"], "Turkey":["Istanbul", "Ankara", "Izmir"] } self.rivers = { "Africa":["Nile", "Chambeshi", "Niger"], "Asia":["Yangtze", "Yellow River", "Mekong"], "Europe":["Volga", "Danube", "Dnepr"] } def onProvideArgs(self, context): if "continent" in context.provide: context.provided["continent"] = ProvidedValue().withValueSet(["Africa", "Asia", "Europe"]) if "country" in context.provide: context.provided["country"] = ProvidedValue().withValueSet(self.countries.get(context.current["continent"], [])) if "city" in context.provide: context.provided["city"] = ProvidedValue().withValueSet(self.cities.get(context.current["country"], [])) if "river" in context.provide: context.provided["river"] = ProvidedValue().withValueSet(self.rivers.get(context.current["continent"], [])) if "weather" in context.provide: context.provided["weather"] = ProvidedValue().withValueSet(["Sunny", "Cloudy", "Raining", "Snowing"])
[ "marcin.pas@softelnet.com" ]
marcin.pas@softelnet.com
9c71981567308ad84f8cdd6d9663bb32cd4dd6f4
bca9c2fa3c4c3d06dd612280ce39090a9dfab9bd
/neekanee/neekanee_solr/solr_query_builder.py
bb3792600dc6a9c0af8eefbc4cd05bff2fbb4fb6
[]
no_license
thayton/neekanee
0890dd5e5cf5bf855d4867ae02de6554291dc349
f2b2a13e584469d982f7cc20b49a9b19fed8942d
refs/heads/master
2021-03-27T11:10:07.633264
2018-07-13T14:19:30
2018-07-13T14:19:30
11,584,212
2
0
null
null
null
null
UTF-8
Python
false
false
5,806
py
KM_PER_MILE = 1.61 class SOLRQueryBuilder(): """ Build a SOLR query given a GET QueryDict for a job search. """ def __init__(self): self.qdict = {} # # Mapping of refine search query parameter names to SOLR doc # field names. All refine search query parameters are implemented # as filter queries. For each param in GET from the left column # below, we add a new filter query using the field name in the # right column and value GET[param]. # self.refine_search_fq = { # # param SOLR field name # ----- --------------- 'tld': 'tld', 'title': 'title', 'company': 'company_name', 'size': 'company_size', 'tags': 'company_tags', 'ltags': 'company_location_tags', 'awards': 'company_awards', 'vacation': 'vacation_year_1', 'country': 'country', 'state': 'state', 'city': 'city', } def add_fq(self, filt, val): if filt != 'vacation_year_1': new_fq = '%s:"%s"' % (filt,val) else: new_fq = '%s:%s' % (filt,val) if self.qdict.has_key('fq'): self.qdict['fq'].append(new_fq) else: self.qdict['fq'] = [new_fq] def build_query(self, GET): """ GET : QueryDict object for an HTTP GET request """ self.qdict['q'] = '{!q.op=AND}' + GET.get('q', '*:*') self.qdict['wt'] = 'json' if 'lat' in GET and 'lng' and GET: self.qdict['fq'] = [ '{!bbox}' ] self.qdict['sfield'] = 'latlng' self.qdict['pt'] = '%.2f,%.2f' % (float(GET['lat']),float(GET['lng'])) self.qdict['d'] = '%.2f' % (float(GET['radius']) * KM_PER_MILE) for parm,filt in self.refine_search_fq.items(): val = GET.get(parm, None) if val is None: continue if parm == 'tags' or parm == 'ltags' or parm == 'awards': # multivalued for v in val.split(): self.add_fq(filt, v) elif parm == 'vacation': self.add_fq(filt, '[%d TO %d]' % (int(val), int(val)+4)) else: self.add_fq(filt, val) return self.qdict class SOLRJobSearchQueryBuilder(SOLRQueryBuilder): def __init__(self, items_per_page): SOLRQueryBuilder.__init__(self) self.items_per_page = items_per_page # # Pararms specific to job search query with faceting for the # sidebar. The state facet field is set to 51 so that all of # the states will show up in the map (and not just 10 of them). # params = { 'fl': 'id,title,url,url_data,company_id,company_name,company_ats,company_jobs_page_url,city,state,country', 'facet': 'true', 'facet.field': ['country', 'state', 'city', 'tld', 'company_size', 'company_name', 'company_tags', 'company_location_tags', 'company_awards'], 'facet.mincount': '1', 'facet.limit': '10', 'f.company_tags.facet.limit': '32', 'f.country.facet.limit': '200', 'f.state.facet.limit': '51', 'facet.range': 'vacation_year_1', 'facet.range.start': '10', 'facet.range.end': '50', 'facet.range.gap': '5', 'hl': 'true', 'hl.fl': 'desc', 'hl.snippets': 2, 'hl.alternateField': 'desc', 'hl.maxAlternateFieldLength': '210', 'rows': '%d' % self.items_per_page } self.qdict.update(params) def build_query(self, GET): page_number = int(GET.get('page', '1')) self.qdict.update({'start': '%d' % (self.items_per_page * (page_number - 1))}) return SOLRQueryBuilder.build_query(self, GET) class SOLRCompanyFacetQueryBuilder(SOLRQueryBuilder): def __init__(self): SOLRQueryBuilder.__init__(self) params = { 'fl': 'id', 'facet': 'true', 'facet.field': ['country', 'state', 'city', 'tld', 'company_size', 'company_tags', 'company_location_tags', 'company_awards', 'company_id'], 'facet.mincount': '1', 'facet.limit': '10', 'facet.range': 'vacation_year_1', 'facet.range.start': '10', 'facet.range.end': '50', 'facet.range.gap': '5', 'f.company_tags.facet.limit': '32', 'f.country.facet.limit': '200', 'f.state.facet.limit': '51', 'f.company_id.facet.limit': '-1' } self.qdict.update(params) def build_query(self, GET): return SOLRQueryBuilder.build_query(self, GET) class SOLRLocationFacetQueryBuilder(SOLRQueryBuilder): def __init__(self): SOLRQueryBuilder.__init__(self) params = { 'fl': 'id', 'facet': 'true', 'facet.field': ['country', 'state', 'city', 'tld', 'company_size', 'company_name', 'company_tags', 'company_location_tags', 'company_awards'], 'facet.mincount': '1', 'facet.limit': '10', 'facet.range': 'vacation_year_1', 'facet.range.start': '10', 'facet.range.end': '50', 'facet.range.gap': '5', 'f.company_tags.facet.limit': '32', 'f.country.facet.limit': '200', 'f.state.facet.limit': '60', 'f.city.facet.limit': '-1' } self.qdict.update(params) def build_query(self, GET): return SOLRQueryBuilder.build_query(self, GET) class SOLRJobTitleFacetQueryBuilder(SOLRQueryBuilder): pass
[ "thayton@neekanee.com" ]
thayton@neekanee.com
89e8d4c866269cd3f51dddc34d7b5e3cf06252a1
8993c99a50ce8813c53d6e49ac524f9ca9e5843c
/setup.py
b4098b433855c8d1114e948eab338decdcc08ccf
[ "BSD-2-Clause" ]
permissive
thisfred/val
2b84d5c8c0bf704385e5f101bad6c8b8c14e6aae
7bbe4d892d74cc5c1bc3c9345e938f9f8f6e658f
refs/heads/master
2021-01-21T11:45:20.983710
2019-08-12T21:06:59
2019-08-12T21:06:59
11,887,783
7
0
null
2015-04-12T16:58:57
2013-08-05T01:28:28
Python
UTF-8
Python
false
false
1,516
py
""" val: A validator for arbitrary python objects. Copyright (c) 2013-2015 Eric Casteleijn, <thisfred@gmail.com> """ from setuptools import setup import os import re def find_version(*file_paths): """Get version from python file.""" with open(os.path.join(os.path.dirname(__file__), *file_paths)) as version_file: contents = version_file.read() version_match = re.search( r"^__version__ = ['\"]([^'\"]*)['\"]", contents, re.M) if version_match: return version_match.group(1) raise RuntimeError("Unable to find version string.") HERE = os.path.abspath(os.path.dirname(__file__)) setup( name='val', version=find_version('val/__init__.py'), author='Eric Casteleijn', author_email='thisfred@gmail.com', description='Python object validator', license='BSD', keywords='validation validators', url='http://github.com/thisfred/val', packages=['val'], long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4'])
[ "ec@trapit.com" ]
ec@trapit.com
492d57c20836f33c2380017662aa3dbd57fd1f04
21e5bbc1888ca85f68e6d511f222f9e94746632d
/ai/AlgoritmoGenetico.py
3be622e8f3bfad9204ac3e370e488daea09ee837
[]
no_license
fgsl/classes
83614cc5ee654aa484a0bfd5ea91aaf97f91a282
e41e103beafa8b68c011c4c96486a82e47d12dd7
refs/heads/master
2020-06-05T21:15:39.342214
2020-03-11T17:49:12
2020-03-11T17:49:12
192,548,182
0
0
null
null
null
null
UTF-8
Python
false
false
2,088
py
# coding: utf-8 import random class AlgoritmoGenetico: tamanhoDaPopulacao = 0 regras = None maximoDeIteracoes = 0 def __init__(self, tamanhoDaPopulacao, regras, maximoDeIteracoes): self.tamanhoDaPopulacao = tamanhoDaPopulacao self.regras = regras self.maximoDeIteracoes = maximoDeIteracoes def executar(self): # inicia população aleatoriamente populacao = [0] * self.tamanhoDaPopulacao for i,v in enumerate(populacao): populacao[i] = self.novoIndividuo() for i in range(0, self.maximoDeIteracoes): print "Iteração " + str(i) + "\n" individuosDaPopulacao = " ".join([str(elemento) for elemento in populacao]) print "População: " + individuosDaPopulacao + "\n" novaPopulacao = [] for j,v in enumerate(populacao): self.buscarPeloMelhorIndividuo(populacao[j]) novaPopulacao.append(populacao[j]) if novaPopulacao == []: for j in enumerate(populacao): populacao[j] = self.novoIndividuo() while len(novaPopulacao) < self.tamanhoDaPopulacao: novaPopulacao.append(self.crossover(populacao)) for j in enumerate(novaPopulacao): novaPopulacao[j] = self.mutacao(novaPopulacao[j]) populacao = novaPopulacao melhorIndividuo = None for individuo in populacao: self.buscarPeloMelhorIndividuo(individuo) if melhorIndividuo == null: print "Não obteve êxito \n" def mutacao(self, individuo): if random.randint( 0, 10 ) % 2 == 0: individuo = self.novoIndividuo() return individuo def crossover(self, populacao): return self.regras.crossover(populacao, self.regras.nvalores) def novoIndividuo(self): individuo = [] for i in range(0, self.regras.nvalores): individuo.append(self.regras.randomValue()) return individuo def buscarPeloMelhorIndividuo(self, individuo): melhorIndividuo = self.regras.obterMelhorIndividuo(individuo) if melhorIndividuo != None: print "\n" + ('=' * 80) print "\nMelhor solução: " + self.regras.mostrarIndividuo(melhorIndividuo) + "\n" print "\n" + ('=' * 80) + "\n" exit() return melhorIndividuo
[ "flavio.lisboa@fgsl.eti.br" ]
flavio.lisboa@fgsl.eti.br
8bc823c166c4a65c4048e30e2d7438e795a32306
018d804d6b53cc544e0adf8c38656bf27152706c
/ucsd_catalog_order.py
ed744750f3c2affb71f43eccdfbf1a19bb0c13f8
[]
no_license
luisroco/cisco_cloud
c664520eb1021c7b36577a08d23dbf1b8dd7bd75
6bbf7c4f0c0af47860170835cfebc924f1b4c867
refs/heads/master
2021-01-09T20:11:19.048918
2017-02-07T19:06:58
2017-02-07T19:06:58
81,242,442
0
0
null
2017-02-07T18:53:53
2017-02-07T18:53:53
null
UTF-8
Python
false
false
3,208
py
#! /usr/bin/env python ''' Command Line Utility to order a Catalog option ''' import requests import json from ucsd_library import catalog_order if __name__ == '__main__': import sys from pprint import pprint from argparse import ArgumentParser, FileType p = ArgumentParser() p.add_argument('catalog', # Name stored in namespace metavar = 'UCSD Catalog', # Arguement name displayed to user help = 'The UCSD Catalog to order', type = str ) p.add_argument('-v', '--vdc', # Name stored in namespace metavar = 'UCSD VDC', # Arguement name displayed to user help = 'The UCSD VDC to place the cVM in', type = str ) p.add_argument('-c', '--comment', # Name stored in namespace metavar = 'UCSD Comment', # Arguement name displayed to user help = 'The comment to record - default blank', type = str, default="" ) p.add_argument('-g', '--group', # Name stored in namespace metavar = 'UCSD Group', # Arguement name displayed to user help = 'The group to order on behalf of', type = str, default="" ) p.add_argument('-n', '--vmname', # Name stored in namespace metavar = 'UCSD VMname', # Arguement name displayed to user help = 'The VM Name or prefix', type = str, default="" ) p.add_argument('--vcpus', # Name stored in namespace metavar = 'vCPU Count', # Arguement name displayed to user help = 'The number of vCPUs. Only used if vDC allows', type = str, default="0" ) p.add_argument('--vram', # Name stored in namespace metavar = 'vRAM Count', # Arguement name displayed to user help = 'The amount of vRAM. Only used if vDC allows', type = str, default="0" ) p.add_argument('--datastores', # Name stored in namespace metavar = 'Datastore details', # Arguement name displayed to user help = 'The datastore details. Only used if vDC allows.', type = str, default="" ) p.add_argument('--vnics', # Name stored in namespace metavar = 'vNIC Details', # Arguement name displayed to user help = 'The details for vNICS. Only used if vDC allows', type = str, default="" ) ns = p.parse_args() result = catalog_order(ns.catalog, ns.vdc, ns.group, ns.comment, ns.vmname, ns.vcpus, ns.vram, ns.datastores, ns.vnics) pprint (result)
[ "hank.preston@gmail.com" ]
hank.preston@gmail.com
c8bea8e9e2f916ff8d8abe5acd8693635d3a3f4f
f2bd2a3c4d8d48341cc96e7842020dd5caddff8e
/archive/DUCS-MCA-Batch-2017-2020/DU-PG-2018-2nd-sem/PGmca.py
fa2ab42fe2316ce7c0a48373a06c343fb8a0bde8
[ "MIT" ]
permissive
jatin69/du-result-fetcher
ab51684bfa9c52ffcd45edf0d9d6784f1e6fd28e
4106810cc06b662ba53acd5853b56c865f39f1a4
refs/heads/master
2022-12-09T07:08:25.614765
2022-12-01T12:56:02
2022-12-01T12:56:02
118,005,826
7
0
MIT
2022-12-01T12:56:03
2018-01-18T16:08:03
Python
UTF-8
Python
false
false
9,043
py
""" DU MCA 2018 2nd sem """ import sys import requests from bs4 import BeautifulSoup CONST_VIEWSTATE = """/wEPDwUKMTU1ODI4OTc2Mw8WAh4JSXBBZGRyZXNzBQwxMDMuNzguMTQ4LjgWAgIDD2QWCgIBD2QWAgIFDw8WAh4EVGV4dAU0UmVzdWx0cyAoMy1ZZWFyIFNlbWVzdGVyIEV4YW1pbmF0aW9uIE1heS1KdW5lIDIwMTggKWRkAgcPDxYCHwEFECAoTWF5LUp1bmUgMjAxOClkZAIVDxAPFgYeDURhdGFUZXh0RmllbGQFCUNPTExfTkFNRR4ORGF0YVZhbHVlRmllbGQFCUNPTExfQ09ERR4LXyFEYXRhQm91bmRnZBAVYRI8LS0tLS1TZWxlY3QtLS0tLT4cQWNoYXJ5YSBOYXJlbmRyYSBEZXYgQ29sbGVnZRNBZGl0aSBNYWhhdmlkeWFsYXlhPUFyeWFiaGF0dGEgQ29sbGVnZSBbRm9ybWVybHkgUmFtIExhbCBBbmFuZCBDb2xsZWdlIChFdmVuaW5nKV0fQXRtYSBSYW0gU2FuYXRhbiBEaGFyYW0gQ29sbGVnZRhCaGFnaW5pIE5pdmVkaXRhIENvbGxlZ2UPQmhhcmF0aSBDb2xsZWdlKkJoYXNrYXJhY2hhcnlhIENvbGxlZ2Ugb2YgQXBwbGllZCBTY2llbmNlcxFDQU1QVVMgTEFXIENFTlRSRRdDYW1wdXMgb2YgT3BlbiBMZWFybmluZyJDbHVzdGVyIElubm92YXRpb24gQ2VudHJlIChDLkkuQy4pHUNvbGxlZ2UgT2YgVm9jYXRpb25hbCBTdHVkaWVzEkRhdWxhdCBSYW0gQ29sbGVnZRxEZWVuIERheWFsIFVwYWRoeWF5YSBDb2xsZWdlIERlbGhpIENvbGxlZ2UgT2YgQXJ0cyAmIENvbW1lcmNlGkRlbGhpIFNjaG9vbCBvZiBKb3VybmFsaXNtckRlcGFydG1lbnQgb2YgQm90YW55ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJEZXBhcnRtZW50IG9mIENoZW1pc3RyeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAWRGVwYXJ0bWVudCBvZiBDb21tZXJjZXJEZXBhcnRtZW50IG9mIENvbXB1dGVyIFNjaWVuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAXRGVwYXJ0bWVudCBvZiBFZHVjYXRpb24VRGVwYXJ0bWVudCBvZiBFbmdsaXNoF0RlcGFydG1lbnQgb2YgR2VvZ3JhcGh5KkRlcGFydG1lbnQgb2YgR2VybWFuaWMgYW5kIFJvbWFuY2UgU3R1ZGllcxNEZXBhcnRtZW50IG9mIEhpbmRpFURlcGFydG1lbnQgb2YgSGlzdG9yeS1EZXBhcnRtZW50IG9mIExpYnJhcnkgYW5kIEluZm9ybWF0aW9uIFNjaWVuY2VyRGVwYXJ0bWVudCBvZiBNYXRoZW1hdGljcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgE0RlcGFydG1lbnQgb2YgTXVzaWNyRGVwYXJ0bWVudCBvZiBQaHlzaWNzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgH0RlcGFydG1lbnQgb2YgUG9saXRpY2FsIFNjaWVuY2UWRGVwYXJ0bWVudCBvZiBTYW5za3JpdHJEZXBhcnRtZW50IG9mIFNvY2lhbCBXb3JrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByRGVwYXJ0bWVudCBvZiBTdGF0aXN0aWNzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgckRlcGFydG1lbnQgb2YgWm9vbG9neSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBhEZXNoYmFuZGh1IENvbGxlZ2UgKERheSkdRHIuIEJoaW0gUmFvIEFtYmVka2FyIENvbGxlZ2UuRHVyZ2FiYWkgRGVzaG11a2ggQ29sbGVnZSBvZiBTcGVjaWFsIEVkdWNhdGlvbhhEeWFsIFNpbmdoIENvbGxlZ2UgKERheSkYRHlhbCBTaW5naCBDb2xsZWdlIChFdmUpHUZhY3VsdHkgb2YgTWFuYWdlbWVudCBTdHVkaWVzDUdhcmdpIENvbGxlZ2UQSGFucyBSYWogQ29sbGVnZQ1IaW5kdSBDb2xsZWdlFUkuUC5Db2xsZWdlIEZvciBXb21lbjZJbmRpcmEgR2FuZGh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L0BgLJzov3BQLXj6HeBwLl65aqAgL+gum3BAKuwq+LCAKTuMvACQK0163qAwLJzo/3BQLi5eGADwLA/KiBCAL+gu23BAKTuM/ACQK016HqAwKuwqv+CQLJzoP3BQLi5eWADwLXj6XeBwLopoPrCQLl64qqAgLopofrCQKvxYr0BgLA/OyBCAKsxar0BgKTuIPBCQLJzsf3BQK01+XqAwK097DwDAKln/OLAsH7fo1IVVKIl4i/u9OVN2QRC4K4""" college_sgpa_list = [] dduc= [] # s = 1 # e = 48 # for i in range(1,2): # if(i<10): # i = '0' + str(i) # el = '17245' + str(i) # dduc.append(el) # print(dduc) r= requests.get('http://duexam.du.ac.in/RSLT_MJ2018/Students/List_Of_Students.aspx?StdType=REG&ExamFlag=PG_SEMESTER_2Y&CourseCode=823&CourseName=(P.G)-%20MASTER%20OF%20COMPUTER%20APPLICATION%20(M.C.A.)&Part=I&Sem=II') soup = BeautifulSoup(r.text, 'html.parser') students_table = soup.find("table", {"rules": "all"}) data = [] all_students = students_table.find_all('tr') for student in all_students: cols = student.find_all('td') cols = [ele.text.strip() for ele in cols] data.append([ele for ele in cols if ele]) # Get rid of empty values data[0] = ['sno','srollno','sname','sfathername'] data.pop(0) dduc = data #print(*dduc,sep="\n") for VAR_stud in dduc: VAR_rollno = VAR_stud[1] payload = { 'ddlcollege' : '234', 'txtrollno' : VAR_rollno, 'btnsearch': 'Print+Score+Card', '__EVENTTARGET' : '', '__EVENTARGUMENT' : '', '__LASTFOCUS':'', '__VIEWSTATE': CONST_VIEWSTATE, '__EVENTVALIDATION': CONST_EVENTVALIDATION } soup = None while(soup == None): # print('trying') r = requests.post("http://duexam.du.ac.in/RSLT_MJ2018/Students/Combine_GradeCard.aspx", data=payload) # print(r.text) soup = BeautifulSoup(r.text, 'html.parser') if(soup==None): continue # print(soup.title.string) if(soup.title.string == "Runtime Error"): soup = None continue # writing result to html file for img in soup.find_all('img'): img.decompose() VAR_filename = "htmlsavemca/" + VAR_rollno + '.html' with open(VAR_filename, "w") as file: file.write(str(soup)) sgpa_table = soup.find("table", {"id": "gvrslt"}) # print(sgpa_table) if(sgpa_table == None ): continue xrows = sgpa_table.findAll('tr') sgpa_row = xrows[2].find_all('td') m = sgpa_row[1].text # print([VAR_rollno, int(m) ]) name = VAR_stud[2] college_sgpa_list.append([VAR_rollno, name, int(m) ]) college_sgpa_list.sort(key = lambda x : x[2], reverse=True) #print(college_sgpa_list) with open('DU-PG-MCA-2nd-sem-Result.txt','w') as f: print('{0:<5} {1:10} {2:21} {3:5} {4:7}'.format("S.No","Roll No.","Name","Marks","Percentage"), file=f) for i,marks in enumerate(college_sgpa_list): print('{0:<5} {1:10} {2:21} {3:5} {4:7}'.format(i+1, marks[0], marks[1], marks[2], float(marks[2]/5)),file=f)
[ "jatinrohilla69@gmail.com" ]
jatinrohilla69@gmail.com
5616b42ddb8bebe817060b5cb8acfdce3c667372
7776fce3e9ee1da84ea299a757905c3cc6f2ada7
/stockindex/admin.py
83ef09b6f16532c4aad99c45dbfcf29213bfd46c
[]
no_license
krystian-warzocha/PythonZaliczenie
c0852bfdd30456c66ea431a20f5d8969cca493af
e2b551fd53e559f3ca36826b169775257d2ff756
refs/heads/master
2021-01-10T07:59:31.918144
2016-03-28T19:42:11
2016-03-28T19:42:11
54,917,864
0
0
null
null
null
null
UTF-8
Python
false
false
133
py
from django.contrib import admin from .models import StockIndex, Equity admin.site.register(StockIndex) admin.site.register(Equity)
[ "kwarzocha@sigma.ug.edu.pl" ]
kwarzocha@sigma.ug.edu.pl
78dafda26133ed996d721c0ceffcb533ef977b3b
afdd3c8bb99a6351f958c62eb7b8d7dbe0c8fe48
/TextCNN/loader.py
75e50b85dbad566b44a5945f2e5cdf4d603ddd82
[]
no_license
JingfengYang/PTEexperiments
9be5aead7f7e9652f3d990816e30e4f7fd23d4c7
0265638a34c238850dd52b96b5452e9633b0ce43
refs/heads/master
2020-09-05T10:40:40.263354
2019-11-18T04:15:24
2019-11-18T04:15:24
220,074,779
3
5
null
2019-11-18T02:21:25
2019-11-06T19:34:04
JavaScript
UTF-8
Python
false
false
3,318
py
import os import re import random import numpy as np import pickle import sys import torch from utils import read_word_embeds from torch.utils.data import Dataset, DataLoader class TextDataset(Dataset): def __init__(self, dataset, prc='', test=False, wo_unlabel=False): _extend = '.without_unlabel' if wo_unlabel else '' if len(prc) > 0: prc = '.' + prc else: assert(not wo_unlabel) # Train files train_label_file = 'data/%s/label_train%s.txt' % (dataset, prc) train_label_file = os.path.join('..', train_label_file) train_text_file = 'data/%s/text_train.txt' % (dataset) train_text_file = os.path.join('..', train_text_file) # Test files test_label_file = 'data/%s/label_test.txt' % (dataset) test_label_file = os.path.join('..', test_label_file) test_text_file = 'data/%s/text_test.txt' % (dataset) test_text_file = os.path.join('..', test_text_file) # Word embedings emb_file = '%s_workspace%s/word.emb' % (dataset, prc+_extend) emb_file = os.path.join('..', emb_file) # Unused directories sent_ebd_file = '%s_workspace%s/text.emb' % (dataset, prc) sent_ebd_file = os.path.join('..', sent_ebd_file) all_text_file = 'data/%s/text_all.txt' % (dataset) all_text_file = os.path.join('..', all_text_file) self.voc, self.emb = read_word_embeds(emb_file) _temp = np.zeros((1,self.emb.shape[1]),dtype=self.emb.dtype) # Add two more embeddings at the front and tail of # word embedding for padding and UNK respectively. self.emb = np.concatenate((_temp, self.emb, _temp.copy())) self.dicts = {self.voc[i]:i+1 for i in range(len(self.voc))} self.text_data = [] self.label_data = [] self.num_class = 1 # Switch between train dataset and test dataset text_file = test_text_file if test else train_text_file label_file = test_label_file if test else train_label_file with open(text_file,'r',encoding='utf-8') as reader1, open(label_file) as reader2: for line1, line2 in zip(reader1, reader2): words = line1.strip().split() _data = [self.dicts.get(word) for word in words] line_data = [self.emb.shape[0]-1 if v is None else v for v in _data] self.text_data.append(np.array(line_data,dtype=np.int64)) self.label_data.append(int(line2.strip())) self.label_data = np.array(self.label_data, dtype=np.int64) # Make labels start from 0 if np.min(self.label_data) != 0: self.label_data -= np.min(self.label_data) self.num_class = np.max(self.label_data)+1 text_len = map(lambda x:len(x), self.text_data) sent_len = min(max(text_len), 300) for v in self.text_data: v.resize(sent_len, refcheck=False) self.text_data = np.array(self.text_data) def __len__(self): return len(self.text_data) def __getitem__(self, idx): if torch.is_tensor(idx): idx = idx.tolist() return self.text_data[idx], self.label_data[idx] def get_dict(self): return self.dicts def get_emb(self): return self.emb
[ "zoxtang@gmail.com" ]
zoxtang@gmail.com
78c07603a7231513247c90a35a64d892b27da22e
6bb47d64abcc131781b702495e690efeba59b988
/Hello/home/urls.py
882036078de5dcb609bffa8dc8fbd5b55e0902ee
[]
no_license
jewells07/Django-Startup
acd349cef056569f815317f92ffcbd06ed807991
8cb2de607e0a19e70181689ebcec7fa72eb44396
refs/heads/master
2022-06-20T12:05:36.388950
2020-05-08T14:02:02
2020-05-08T14:02:02
262,338,233
0
0
null
null
null
null
UTF-8
Python
false
false
355
py
from django.contrib import admin from django.urls import path from home import views urlpatterns = [ path("",views.index, name = 'home'), path("about",views.about, name = 'about'), path("services",views.services, name = 'services'), path("contact",views.contact, name = 'contact'), path("contact",views.contact, name = 'contact'), ]
[ "jewellsjoshi437@gmail.com" ]
jewellsjoshi437@gmail.com
673ab9861bcae85a1a55c3ed742550710ec90195
99d7a6448a15e7770e3b6f3859da043300097136
/src/hardware/core/i_core_device.py
653c0e71ab0666d2da9b754da7fe944a400daac1
[]
no_license
softtrainee/arlab
125c5943f83b37bc7431ae985ac7b936e08a8fe4
b691b6be8214dcb56921c55daed4d009b0b62027
refs/heads/master
2020-12-31T07:54:48.447800
2013-05-06T02:49:12
2013-05-06T02:49:12
53,566,313
0
0
null
null
null
null
UTF-8
Python
false
false
1,211
py
#=============================================================================== # Copyright 2011 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #=============================================================================== #============= enthought library imports ======================= from traits.api import Interface #============= standard library imports ======================== #============= local library imports ========================== class ICoreDevice(Interface): def get(self): ''' ''' def set(self, *args, **kw): ''' ''' #============= views =================================== #============= EOF ====================================
[ "jirhiker@localhost" ]
jirhiker@localhost
ba92d4f9f437fcf74daf2e0b5f28089408f310c4
aaa06c63f0fba6c5aad5121d83715d0be828ce4e
/OpenStreetMap/models.py
6746038957e195d82202ad40ba008a0f5667564b
[]
no_license
scotm/Comrade
b023b338f0daf5d083ae37e2e3a73d3d424f8a7c
c7186f00cd20916a78cc2282ea201f440102ebb7
refs/heads/master
2020-05-18T06:49:01.411310
2014-07-25T08:13:10
2014-07-25T08:13:10
null
0
0
null
null
null
null
UTF-8
Python
false
false
4,658
py
from django.contrib.gis.db import models class BaseOsmModel(models.Model): access = models.TextField(blank=True) addr_housename = models.TextField(db_column='addr:housename', blank=True) addr_housenumber = models.TextField(db_column='addr:housenumber', blank=True) addr_interpolation = models.TextField(db_column='addr:interpolation', blank=True) admin_level = models.TextField(blank=True) aerialway = models.TextField(blank=True) aeroway = models.TextField(blank=True) amenity = models.TextField(blank=True) area = models.TextField(blank=True) barrier = models.TextField(blank=True) bicycle = models.TextField(blank=True) boundary = models.TextField(blank=True) brand = models.TextField(blank=True) bridge = models.TextField(blank=True) building = models.TextField(blank=True) construction = models.TextField(blank=True) covered = models.TextField(blank=True) culvert = models.TextField(blank=True) cutting = models.TextField(blank=True) denomination = models.TextField(blank=True) disused = models.TextField(blank=True) embankment = models.TextField(blank=True) foot = models.TextField(blank=True) generator_source = models.TextField(db_column='generator:source', blank=True) harbour = models.TextField(blank=True) highway = models.TextField(blank=True) historic = models.TextField(blank=True) horse = models.TextField(blank=True) intermittent = models.TextField(blank=True) junction = models.TextField(blank=True) landuse = models.TextField(blank=True) layer = models.TextField(blank=True) leisure = models.TextField(blank=True) lock = models.TextField(blank=True) man_made = models.TextField(blank=True) military = models.TextField(blank=True) motorcar = models.TextField(blank=True) name = models.TextField(blank=True) natural = models.TextField(blank=True) office = models.TextField(blank=True) oneway = models.TextField(blank=True) operator = models.TextField(blank=True) place = models.TextField(blank=True) population = models.TextField(blank=True) power = models.TextField(blank=True) power_source = models.TextField(blank=True) public_transport = models.TextField(blank=True) railway = models.TextField(blank=True) ref = models.TextField(blank=True) religion = models.TextField(blank=True) route = models.TextField(blank=True) service = models.TextField(blank=True) shop = models.TextField(blank=True) sport = models.TextField(blank=True) surface = models.TextField(blank=True) toll = models.TextField(blank=True) tourism = models.TextField(blank=True) tower_type = models.TextField(db_column='tower:type', blank=True) tunnel = models.TextField(blank=True) water = models.TextField(blank=True) waterway = models.TextField(blank=True) wetland = models.TextField(blank=True) width = models.TextField(blank=True) wood = models.TextField(blank=True) z_order = models.IntegerField(blank=True, null=True) class Meta: abstract = True # Create your models here. class PlanetOsmLine(BaseOsmModel): osm_id = models.BigIntegerField(blank=True, primary_key=True) way_area = models.FloatField(blank=True, null=True) way = models.LineStringField(srid=900913, blank=True, null=True) objects = models.GeoManager() class Meta: managed = False db_table = 'planet_osm_line' class PlanetOsmPoint(BaseOsmModel): osm_id = models.BigIntegerField(blank=True, primary_key=True) capital = models.TextField(blank=True) ele = models.TextField(blank=True) poi = models.TextField(blank=True) way = models.PointField(srid=900913, blank=True, null=True) objects = models.GeoManager() class Meta: managed = False db_table = 'planet_osm_point' class PlanetOsmPolygon(BaseOsmModel): osm_id = models.BigIntegerField(blank=True, primary_key=True) tracktype = models.TextField(blank=True) way_area = models.FloatField(blank=True, null=True) way = models.GeometryField(srid=900913, blank=True, null=True) objects = models.GeoManager() class Meta: managed = False db_table = 'planet_osm_polygon' class PlanetOsmRoads(BaseOsmModel): osm_id = models.BigIntegerField(blank=True, primary_key=True) tracktype = models.TextField(blank=True) way_area = models.FloatField(blank=True, null=True) way = models.LineStringField(srid=900913, blank=True, null=True) objects = models.GeoManager() class Meta: managed = False db_table = 'planet_osm_roads'
[ "scott.scotm@gmail.com" ]
scott.scotm@gmail.com
b086729dbab27bed113d6c9a6300cbe79200e959
481e3dd1953ab4444e37cee8892f6b8dfb567a98
/app/models/example_todo.py
40cedf6926ec8ab3de0eb9998a69c92915793f28
[]
no_license
JeongHoJeong/react-flask-boilerplate
b34262fa895ee28c2366dbd50183024eeadec2dc
bd36ddc41cbcbbb5ae3101ba7d1947584e66b06a
refs/heads/master
2020-03-30T01:33:25.677581
2018-11-08T08:02:27
2018-11-08T08:02:27
150,581,781
1
0
null
null
null
null
UTF-8
Python
false
false
227
py
from sqlalchemy import Column, BigInteger, String from app.models import OrmBase class ExampleTodo(OrmBase): __tablename__ = 'example_todo' id = Column(BigInteger, primary_key=True) description = Column(String)
[ "fiil12@hotmail.com" ]
fiil12@hotmail.com
362cdc331020a5268fd371e1eac03259c7a14bba
f3d01659c2a4465cdf7a5903d18058da008f1aac
/src/sentry/models/groupbookmark.py
f6cee4369c180e59d520ca7fe8093daee2869739
[ "BSD-2-Clause" ]
permissive
Mattlk13/sentry-1
f81a1e5dc5d02a07e5c6bbcdb5e1ce53f24f53c1
19b0870916b80250f3cb69277641bfdd03320415
refs/heads/master
2023-08-30T21:49:49.319791
2019-07-30T19:23:07
2019-07-30T19:23:07
81,418,058
0
1
BSD-3-Clause
2023-04-04T00:22:49
2017-02-09T06:36:41
Python
UTF-8
Python
false
false
1,064
py
from __future__ import absolute_import from django.conf import settings from django.db import models from django.utils import timezone from sentry.db.models import FlexibleForeignKey, Model, BaseManager, sane_repr class GroupBookmark(Model): """ Identifies a bookmark relationship between a user and an aggregated event (Group). """ __core__ = False project = FlexibleForeignKey('sentry.Project', related_name="bookmark_set") group = FlexibleForeignKey('sentry.Group', related_name="bookmark_set") # namespace related_name on User since we don't own the model user = FlexibleForeignKey(settings.AUTH_USER_MODEL, related_name="sentry_bookmark_set") date_added = models.DateTimeField(default=timezone.now, null=True) objects = BaseManager() class Meta: app_label = 'sentry' db_table = 'sentry_groupbookmark' # composite index includes project for efficient queries unique_together = (('project', 'user', 'group'), ) __repr__ = sane_repr('project_id', 'group_id', 'user_id')
[ "dcramer@gmail.com" ]
dcramer@gmail.com
b55fd799bada92e8f1cd6d17a26da62618bdf02a
f6a8d93c0b764f84b9e90eaf4415ab09d8060ec8
/Lists Advanced/the_office.py
de39a3b8b66d23417344eae1ded709f3c883b3b7
[]
no_license
DimoDimchev/SoftUni-Python-Fundamentals
90c92f6e8128b62954c4f9c32b01ff4fbb405a02
970360dd6ffd54b852946a37d81b5b16248871ec
refs/heads/main
2023-03-18T17:44:11.856197
2021-03-06T12:00:32
2021-03-06T12:00:32
329,729,960
2
0
null
null
null
null
UTF-8
Python
false
false
656
py
employees_list = [int(x) for x in (input().split(" "))] HIF = int(input()) # happiness improvement factor happy_count = 0 increased_happiness_list = list(map(lambda employee: employee * HIF, employees_list)) average_happiness = sum(increased_happiness_list) / len(increased_happiness_list) happy_list = list(filter(lambda employee: employee >= average_happiness, increased_happiness_list)) for i in range(len(happy_list)): happy_count += 1 if happy_count >= len(employees_list)/2: print(f"Score: {happy_count}/{len(employees_list)}. Employees are happy!") else: print(f"Score: {happy_count}/{len(employees_list)}. Employees are not happy!")
[ "noreply@github.com" ]
DimoDimchev.noreply@github.com
3cb225f72576655ceb256774a37ab22d8364393f
6a25171b9f0a6b47f844aa6f22538917c25c2a45
/REST API - Tensorflow/server.py
c63739a4aeb3685b5a5fdd163b769146a99b8be0
[ "MIT" ]
permissive
mauryas/DataScienceTasks
c37d52f88a03d7c15d7cbc7dff33084b24098138
78cd4c47067101128de668a641b999d6fb406ab8
refs/heads/master
2020-04-01T13:59:02.947765
2018-10-16T13:39:58
2018-10-16T13:39:58
153,275,401
0
0
null
null
null
null
UTF-8
Python
false
false
4,715
py
#%% Import Libraries import flask from model.model import ImageClassifier import io import numpy as np import os from sklearn.preprocessing import OneHotEncoder import zipfile from PIL import Image import psutil import logging from config.config import IMG_COLS, IMG_ROWS, TO_TRAIN # Setting logging file path try: log_path = os.stat(os.path.join(os.getcwd(), 'log')) except: log_path = os.mkdir(os.path.join(os.getcwd(), 'log')) # Logging object configrations logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s', filename='server.log', filemode='w') #%% Initializa the application and model app = flask.Flask(__name__) cls = None #%% Methods def init_model(): ''' Initialize the model and train it for ''' global cls cls = ImageClassifier() if TO_TRAIN: cls.train() logging.info("Train Variable Value: {}". format(TO_TRAIN)) logging.info("Straining to train model") else: cls.load_model() logging.info("Train Variable Value: {}". format(TO_TRAIN)) logging.info("Loaded Trained Model") #%% Post Methods @app.route("/predict", methods=["POST"]) def predict(): ''' Read the input images from input and return the predicted class. ''' result = {'success':False} #Fetch the file # ensure an image was properly uploaded to our endpoint if flask.request.method == "POST": if flask.request.files.get("image"): # read the image in PIL format image = flask.request.files["image"].read() image = Image.open(io.BytesIO(image)) image = np.reshape(image,(1,IMG_ROWS,IMG_COLS,1)) y_pred = cls.predict(image) result['success'] = True result['prediction'] = (np.argmax(y_pred[0])).tolist() return flask.jsonify(result) @app.route("/batch_train", methods=["POST"]) def batch_train(): ''' Take an input batch of images and train the classifier ''' result = {'success':False} #Fetch the file if flask.request.method == "POST": """ Validate the zip file which we will receive. If the available memory is more than request file size + DNN model, then train the model. """ avl_mem = (psutil.virtual_memory().free)*1024 cls_mem = cls.get_model_memory_usage() content_length = flask.request.content_length logging.info('Mem: {}'.format(avl_mem - cls_mem -content_length)) if (avl_mem - cls_mem -content_length) < 0.05*(avl_mem): result = {'success':False, 'Error': 'large file'} return flask.jsonify(result) if flask.request.files.get("zip"): zip_read = flask.request.files["zip"] logging.info('Zip read Sucess') # if the file uploaded is a zip, open the file and save create a numpy array zip_ref = zipfile.ZipFile(zip_read, 'r') # before extracting create a temp dir where we will save those files try: os.stat('tmp') except: os.mkdir('tmp') zip_ref.extractall(os.path.join(os.getcwd(), 'tmp')) zip_ref.close() new_train = [] new_label = [] # Now open the tmp dir and one by one extract the images for root, dirs, files in os.walk(os.path.join(os.getcwd(), 'tmp')): # we will get the labels from the file name for file in files: file_name = os.path.splitext(file)[0] _label = file_name.split('_')[1] # read the image and convert it into numpy array image = Image.open(os.path.join(root,file)) image = np.reshape(image,(IMG_ROWS,IMG_COLS,1)) # append the labels and image array to the list new_train.append(image) new_label.append(int(_label)) # One hot encoding enc = OneHotEncoder() new_labels = enc.fit_transform(np.reshape(new_label, (-1, 1))).toarray() # Now send this to the training logging.info(np.shape(new_train)) cls.batch_train_online(np.array(new_train), new_labels) logging.info('Batch Training is done.') result = {'success':True} return flask.jsonify(result) if __name__ == "__main__": init_model() print('Model Loaded') app.run()
[ "shivammaurya@outlook.com" ]
shivammaurya@outlook.com