-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_quick_tests.py
executable file
·147 lines (87 loc) · 2.31 KB
/
_quick_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# print [x for x in xrange(1,3)]
print [i for i in xrange(0,10) if i % 2 == 0]
exit()
# import json
#
# jsonData = '{"qwe":"asd"}'
# data = json.loads(jsonData)
# print data
# from datetime import datetime, timedelta
# print int(datetime.date(datetime.utcnow()).strftime("%s"))+8*3600
# print int(datetime.date(datetime.utcnow()).strftime("%s"))+9*3600
# print int(datetime.date(datetime.utcnow()).strftime("%s"))+10*3600
# print (datetime.now() + timedelta(days=5)).strftime("%s")
# print ((str(10)+" ") * 3).split()
# X = map(int, "6 12 8 10 20 16".split())
# F = map(int, "5 4 3 2 1 5".split())
#
# a = map(int, "".join([(str(X[i])+" ") * F[i] for i,v in enumerate(X)]).split())
#
# print a
import boto3
# Let's use Amazon S3
s3 = boto3.resource('s3')
## Print out bucket names
# for bucket in s3.buckets.all():
# print(bucket.name)
## Print bucket location
# print (s3.get_bucket_location(Bucket = 'incoming.ziprecruiter.com'))
bucket = s3.Bucket('incoming.ziprecruiter.com')
# acl = bucket.Acl()
# for grant in acl.grants:
# print(grant['Grantee']['DisplayName'], grant['Permission'])
for key in bucket.objects.all():
print(key.key)
# object = s3.Object('incoming.ziprecruiter.com','five9')
# for key in object.get():
# print key
exit()
def this_fails():
x = 1/0
try:
this_fails()
except ZeroDivisionError as detail:
print 'Handling run-time error:', detail
exit()
print 'qwe'
exit()
def find_delims(n, a={}):
for i in range(2,n):
if n % i == 0:
if i not in a:
a[i] = 0
a[i] += 1
return find_delims(n/i, a)
if n not in a:
a[n] = 0
a[n] += 1
return a
print find_delims(4)
exit()
class A(object):
def __init__(self):
self.a = 'initA'
self.b = 'initB'
self.c = 'initC'
def getA(self):
return self.a
def getB(self):
return self.b
def getC(self):
return self.c
class B(A):
def __init__(self):
super(self.__class__, self).__init__()
def getC(self):
return 'c from class B'
class C(A):
def __init__(self):
super(self.__class__, self).__init__()
def getC(self):
return 'c from class C'
qwe = B()
print qwe.getC()
asd = C()
print asd.getC()
print qwe.getA()
print asd.getB()