def random_urlsafe_str():
 return base64.urlsafe_b64encode(uuid.uuid4().bytes)[:(-2)].decode('utf-8')

def random_urlsafe_str ( ) : return base64 . urlsafe_b64encode ( uuid . uuid4 ( ) . bytes ) [ : ( - 2 ) ] . decode ( 'utf-8' )
generate a random url-safe string .