def loadrc(filename):
filename = os.path.expanduser(os.path.expandvars(filename))<EOL>if not os.path.isfile(filename): raise ValueError('<STR_LIT>' % filename)<EOL>with open(filename, '<STR_LIT:r>') as fl:<EOL><INDENT>dat = json.load(fl)<EOL><DEDENT>try: dat = dict(dat)<EOL>except Exception: raise ValueError('<STR_LIT>' % filename)<EOL>return dat<EOL>
loadrc(filename) yields the dict object encoded in JSON in the given filename; if the filename
  does not exist or does not contain a valid JSON dict, then an error is raised.