def _create_url_identifier(user, password):
if user is not None:<EOL><INDENT>user = parse.quote(user.encode('<STR_LIT:utf-8>'), safe=USERINFO_SAFE_CHARS)<EOL>if password:<EOL><INDENT>password = parse.quote(password.encode('<STR_LIT:utf-8>'),<EOL>safe=USERINFO_SAFE_CHARS)<EOL>return '<STR_LIT>'.format(user, password)<EOL><DEDENT>return user<EOL><DEDENT>return None<EOL>
Generate the user+password portion of a URL.

:param str user: the user name or :data:`None`
:param str password: the password or :data:`None`