@contextmanager<EOL>def inside_dir(dirpath):
old_path = os.getcwd()<EOL>try:<EOL><INDENT>os.chdir(dirpath)<EOL>yield<EOL><DEDENT>finally:<EOL><INDENT>os.chdir(old_path)<EOL><DEDENT>
Execute code from inside the given directory
:param dirpath: String, path of the directory the command is being run.