1-
21import random
32import time
43import hashlib
54import collections
65
7- class CodeforcesApiRequestMaker ():
6+
7+ class CodeforcesApiRequestMaker :
88
99 api_key = ""
1010 secret = ""
@@ -18,13 +18,13 @@ def __init__(self, api_key=None, secret=None, random_number=1000000):
1818 and 1000000 unless specified)
1919 """
2020
21- if random_number == 1000000 :
21+ if random_number == 1000000 :
2222 random_number = random .randint (100000 , 999999 )
2323 self .assigned_rand = True
2424 elif random_number < 100000 and random_number > 999999 :
2525 raise Exception (
2626 "Non 6-digit number passed as random_number for API Signature" ,
27- random_number
27+ random_number ,
2828 )
2929 if api_key is None and secret is None :
3030 self .anonimus = True
@@ -41,7 +41,7 @@ def generate_url(self, method_name, **fields):
4141
4242 if not self .anonimus :
4343
44- #Renew Rand
44+ # Renew Rand
4545 if not self .assigned_rand :
4646 self .renew_rand ()
4747
@@ -104,12 +104,12 @@ def renew_rand(self, random_number=1000000):
104104 It's recommended that you renew your apiSig for each request
105105 default is between 100000 and 1000000 unless specified)
106106 """
107- if random_number == 1000000 :
107+ if random_number == 1000000 :
108108 random_number = random .randint (100000 , 999999 )
109109 elif random_number < 100000 and random_number > 999999 :
110110 raise Exception (
111111 "Non 6-digit number passed as random_number for renew_rand" ,
112- random_number
112+ random_number ,
113113 )
114114
115115 def get_response (self , request ):
0 commit comments