@staticmethod<EOL><INDENT>def escape_url(url, lowercase_urlencoding=False):<DEDENT>
encoded = quote_plus(url)<EOL>return re.sub(r"<STR_LIT>", lambda m: m.group(<NUM_LIT:0>).lower(), encoded) if lowercase_urlencoding else encoded<EOL>
escape the non-safe symbols in url
The encoding used by ADFS 3.0 is not compatible with
python's quote_plus (ADFS produces lower case hex numbers and quote_plus produces
upper case hex numbers)
:param url: the url to escape
:type url: str

:param lowercase_urlencoding: lowercase or no
:type lowercase_urlencoding: boolean

:return: the escaped url
:rtype str