code: def create_temporary_workspace(version=None, mode=0700):
      # type: (str, int) -> str
      
      workspace = mkdtemp('hemp_')
      if version is not None:
          workspace = join(workspace, version)
          mkdir(workspace, mode)
      chmod(workspace, mode)
      return workspace
docs: Create a temporary directory, optionally by placing a subdirectory: version
      :rtype: str
      :return: Directory path