<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_cwd(cls, cwd):
 """ Set the cwd that is used to manipulate paths. """

        if not cwd:
            try:
                cwd = os.getcwdu()
            except AttributeError:
                cwd = os.getcwd()
        if isinstance(cwd, six.binary_type):
            cwd = cwd.decode(sys.getdefaultencoding())
        cls._cwd = cwd
        cls._root = cls._git_root()