def simplify_path(path):
skip = {'<STR_LIT:..>', '<STR_LIT:.>', '<STR_LIT>'}<EOL>stack = []<EOL>paths = path.split('<STR_LIT:/>')<EOL>for tok in paths:<EOL><INDENT>if tok == '<STR_LIT:..>':<EOL><INDENT>if stack:<EOL><INDENT>stack.pop()<EOL><DEDENT><DEDENT>elif tok not in skip:<EOL><INDENT>stack.append(tok)<EOL><DEDENT><DEDENT>return '<STR_LIT:/>' + '<STR_LIT:/>'.join(stack)<EOL>
:type path: str
:rtype: str