<s> import random <EOL> import string <EOL> import sys <EOL> import os <EOL> import hashlib <EOL> if sys . version_info >= ( <NUM_LIT:3> , <NUM_LIT:0> ) : <EOL> import urllib . parse as urlparse <EOL> else : <EOL> import urlparse <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ) ) ) ) <EOL> def md5sum ( b ) : <EOL> return hashlib . md5 ( b ) . hexdigest ( ) . encode ( '<STR_LIT:utf8>' ) <EOL> def randstr ( l = None , chars = string . ascii_letters + string . digits ) : <EOL> l = l or random . randint ( <NUM_LIT:1> , <NUM_LIT:100> ) <EOL> return '<STR_LIT>' . join ( random . choice ( chars ) for i in range ( l ) ) <EOL> randint = random . randint <EOL> def randdict ( l = None ) : <EOL> i = l or random . randint ( <NUM_LIT:1> , <NUM_LIT:100> ) <EOL> d = { } <EOL> for i in range ( i ) : <EOL> d [ randstr ( ) ] = randstr ( ) <EOL> return d <EOL> test_server_host = '<STR_LIT>' <EOL> url = lambda path = None : urlparse . urljoin ( test_server_host , path ) if path else test_server_host </s>
