def make_random_password(length=None, choice_fn=random.SystemRandom().choice):
 length = (length if (length is not None) else _DEFAULT_RANDOM_PASSWORD_LENGTH)
 return ''.join((choice_fn(_PASSWORD_CHARSET) for _ in xrange(length)))

def make_random_password ( length = None , choice_fn = random . SystemRandom ( ) . choice ) : length = ( length if ( length is not None ) else _DEFAULT_RANDOM_PASSWORD_LENGTH ) return '' . join ( ( choice_fn ( _PASSWORD_CHARSET ) for _ in xrange ( length ) ) )
makes a random password .