def str_to_credentials(s):
if not pimms.is_str(s): raise ValueError('<STR_LIT>')<EOL>s = s.strip()<EOL>try:<EOL><INDENT>js = json.loads(s)<EOL>return to_credentials(s)<EOL><DEDENT>except Exception: pass<EOL>dat = s.split('<STR_LIT:\n>')<EOL>if len(dat) == <NUM_LIT:1>: dat = s.split('<STR_LIT::>')<EOL>if len(dat) != <NUM_LIT:2>: raise ValueError('<STR_LIT>' % s)<EOL>return tuple([q.strip() for q in dat])<EOL>
str_to_credentials(s) yields (key, secret) if the given string is a valid representation of a
  set of credentials. Valid representations include '<key>:<secret>' and '<key>\n<secret>'. All
  initial and trailing whitespace is always stripped from both key and scret. If a newline
  appears in the string, then this character always takes precedense as the separator over a
  colon character. The given string may also be a json object, in which case it is parsed and
  considered valid if it is either a