def expanduser(path):<EOL>
expanded = os.path.expanduser(path)<EOL>if path.startswith('<STR_LIT>') and expanded.startswith('<STR_LIT>'):<EOL><INDENT>expanded = expanded[<NUM_LIT:1>:]<EOL><DEDENT>return expanded<EOL>
Expand ~ and ~user constructions.

Includes a workaround for https://bugs.python.org/issue14768