def MoveDirectory(source_dir, target_dir):
if not IsDir(source_dir):<EOL><INDENT>from ._exceptions import DirectoryNotFoundError<EOL>raise DirectoryNotFoundError(source_dir)<EOL><DEDENT>if Exists(target_dir):<EOL><INDENT>from ._exceptions import DirectoryAlreadyExistsError<EOL>raise DirectoryAlreadyExistsError(target_dir)<EOL><DEDENT>from six.moves.urllib.parse import urlparse<EOL>source_url = urlparse(source_dir)<EOL>target_url = urlparse(target_dir)<EOL>if _UrlIsLocal(source_url) and _UrlIsLocal(target_url):<EOL><INDENT>import shutil<EOL>shutil.move(source_dir, target_dir)<EOL><DEDENT>elif source_url.scheme == '<STR_LIT>' and target_url.scheme == '<STR_LIT>':<EOL><INDENT>from ._exceptions import NotImplementedProtocol<EOL>raise NotImplementedProtocol(target_url.scheme)<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError('<STR_LIT>')<EOL><DEDENT>
Moves a directory.

:param unicode source_dir:

:param unicode target_dir:

:raises NotImplementedError:
    If trying to move anything other than:
        Local dir -> local dir
        FTP dir -> FTP dir (same host)