<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def escape_latex(s):
 r"""Escape characters that are special in latex. Args ---- s : `str`, `NoEscape` or anything that can be converted to string The string to be escaped. If this is not a string, it will be converted to a string using `str`. If it is a `NoEscape` string, it will pass through unchanged. Returns ------- NoEscape The string, with special characters in latex escaped. Examples -------- 'Total cost: \$30,000' 'Issue \#5 occurs in 30\% of all cases' References * http://tex.stackexchange.com/a/34586/43228 * http://stackoverflow.com/a/16264094/2570866 """


    if isinstance(s, NoEscape):
        return s

    return NoEscape(''.join(_latex_special_chars.get(c, c) for c in str(s)))