def load_credentials(flnm):
flnm = os.path.expanduser(os.path.expandvars(flnm))<EOL>with open(flnm, '<STR_LIT:r>') as fl: dat = fl.read(<NUM_LIT> * <NUM_LIT:8>)<EOL>try:              return str_to_credentials(dat)<EOL>except Exception: raise ValueError('<STR_LIT>' % flnm)<EOL>
load_credentials(filename) yields the credentials stored in the given file as a tuple
  (key, secret). The file must contain <key>:<secret> on a single line. If the file does not
  contain valid credentials, then an exception is raised. Yields (key, secret).

Optionally, if the file contains exactly two lines, then the key is taken as the first line and
the secret is taken as the second line. This can be used if ':' is a valid character in either
the key or secret for a particular service.

Note that if the key/secret are more than 8kb in size, this function's behaviour is undefined.