def pcwd(func):
    """A decorator to provide the functionality of the
    PreserveWorkingDirectory context manager for functions and methods."""
    
    @wraps(func)
    def inner(*args, **kw):
        with PreserveWorkingDirectory():
            return func(*args, **kw)
    
    return inner
def pcwd ( func ) : @ wraps ( func ) def inner ( * args , ** kw ) : with PreserveWorkingDirectory ( ) : return func ( * args , ** kw ) return inner
A decorator to provide the functionality of the
    PreserveWorkingDirectory context manager for functions and methods.