def obfuscate(p, action):
key = "<STR_LIT>"<EOL>s = list()<EOL>if action == '<STR_LIT:store>':<EOL><INDENT>if PY2:<EOL><INDENT>for i in range(len(p)):<EOL><INDENT>kc = key[i % len(key)]<EOL>ec = chr((ord(p[i]) + ord(kc)) % <NUM_LIT>)<EOL>s.append(ec)<EOL><DEDENT>return base64.urlsafe_b64encode("<STR_LIT>".join(s))<EOL><DEDENT>else:<EOL><INDENT>return base64.urlsafe_b64encode(p.encode()).decode()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if PY2:<EOL><INDENT>e = base64.urlsafe_b64decode(p)<EOL>for i in range(len(e)):<EOL><INDENT>kc = key[i % len(key)]<EOL>dc = chr((<NUM_LIT> + ord(e[i]) - ord(kc)) % <NUM_LIT>)<EOL>s.append(dc)<EOL><DEDENT>return "<STR_LIT>".join(s)<EOL><DEDENT>else:<EOL><INDENT>e = base64.urlsafe_b64decode(p)<EOL>return e.decode()<EOL><DEDENT><DEDENT>
Obfuscate the auth details to avoid easy snatching.

    It's best to use a throw away account for these alerts to avoid having
    your authentication put at risk by storing it locally.