init: MVP
This commit is contained in:
commit
46e870be42
17 changed files with 1202 additions and 0 deletions
17
codeforces/client/helpers.py
Normal file
17
codeforces/client/helpers.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import random
|
||||
from contextlib import _GeneratorContextManager
|
||||
from seleniumbase import BaseCase, SB as _SB
|
||||
|
||||
|
||||
def random_string(n: int, format = '[a-zA-Z0-9]') -> str:
|
||||
format = format[1:-1]
|
||||
chars = ''
|
||||
for i in range(0, len(format), 3):
|
||||
for j in range(ord(format[i]), ord(format[i+2]) + 1):
|
||||
chars += chr(j)
|
||||
return ''.join(random.choice(chars) for _ in range(n))
|
||||
|
||||
|
||||
# make seleniumbase somewhat typed
|
||||
def SB() -> _GeneratorContextManager[BaseCase]:
|
||||
return _SB(uc = True)
|
Loading…
Add table
Add a link
Reference in a new issue