def METHOD_NAME(data):
    """
    Sanitize the data using cgi.escape.
    """
    if isinstance(data, (int, float, dict, list)):
        res = data
    else:
        try:
            if data:
                res = cgi.escape(data, METHOD_NAME=True)
            else:
                res = ""
        except Exception as exc:
            print("Unable to cgi.escape(%s, quote=True)" % data)
            print(exc)
            res = ""
    return res