<gh_stars>0
from contextlib import contextmanager
import os
# function for changing directory
@contextmanager
def working_directory(directory):
    owd = os.getcwd()
    try:
        os.chdir(directory)
        yield directory
    finally:
        os.chdir(owd)