def base64_len(s):
 (groups_of_3, leftover) = divmod(len(s), 3)
 n = (groups_of_3 * 4)
 if leftover:
  n += 4
 return n

def base64_len ( s ) : ( groups_of_3 , leftover ) = divmod ( len ( s ) , 3 ) n = ( groups_of_3 * 4 ) if leftover : n += 4 return n
return the length of s when it is encoded with base64 .