S3 directory is not S3Ojbect.
321423
def _exists(self, path):
        
        if path.endswith('/'):
            return True
        return self.storage.exists(path)
739111
def bucket_and_path(self, url):
        """"""
        url = compat.as_str_any(url)
        if url.startswith("s3://"):
            url = url[len("s3://"):]
        idx = url.index("/")
        bucket = url[:idx]
        path = url[(idx + 1):]
        return bucket, path
1141930
function filesInRepository(dir) {
        var ignoreDirs = cog.getOption('ignore_dirs');
        // TODO: Allow an array and move to config.
        var ignoreFiles = /~$/;
        var files = glob.sync(dir ? dir + '/*' : '*');
        var ret = [];
        for (var i = 0; i < files.length; i++) {
            if (fs.lstatSync(files[i]).isDirectory()) {
                // Ignore standard directories of uninterest.
                if (!dir && ignoreDirs.indexOf(files[i]) >= 0) {
                    continue;
                }
                ret = filesInRepository(files[i]).concat(ret);
            } else {
                if (!ignoreFiles.test(files[i])) {
                    ret.push(files[i]);
                }
            }
        }
        return ret;
    }
1203594
def dir_type(arg):
	""""""
	if not os.path.isdir(arg):
		raise argparse.ArgumentTypeError("{0} is not a valid directory".format(repr(arg)))
	return arg
374424
function isSrcSubdir (src, dest) {
  try {
    return fs.statSync(src).isDirectory() &&
           src !== dest &&
           dest.indexOf(src) > -1 &&
           dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src)
  } catch (e) {
    return false
  }
}
1219763
def dfs_absent(path):
    '''
    
    '''
    cmd_return = _hadoop_cmd('dfs', 'stat', path)
    match = 'No such file or directory'
    return True if match in cmd_return else False
299705
function cdProjectRoot(dir) {
    var projectRoot = this.isCordova(dir);
    if (!projectRoot) {
        throw new CordovaError('Current working directory is not a judpack project.');
    }
    if (!origCwd) {
        origCwd = process.env.PWD || process.cwd();
    }
    process.env.PWD = projectRoot;
    process.chdir(projectRoot);
    return projectRoot;
}
856014
def isdir(self, relpath):
    """"""
    if self._isdir_raw(relpath):
      if not self.isignored(relpath, directory=True):
        return True

    return False
1262397
def s3_app_bucket(self, include_region=False):
        
        if include_region:
            s3_app_bucket = self.format['s3_app_region_bucket'].format(**self.data)
        else:
            s3_app_bucket = self.format['s3_app_bucket'].format(**self.data)
        return s3_app_bucket
754164
def bokehjssrcdir(self):
        ''' 

        '''
        if self._is_dev or self.debugjs:
            bokehjssrcdir = abspath(join(ROOT_DIR, '..', 'bokehjs', 'src'))

            if isdir(bokehjssrcdir):
                return bokehjssrcdir

        return None
1187809
def deploy_to_s3(self):
        
        self.tempdir = tempfile.mkdtemp('s3deploy')

        for keyname, absolute_path in self.find_file_paths():
            self.s3_upload(keyname, absolute_path)

        shutil.rmtree(self.tempdir, True)
        return True
1067952
def upload(remote_location, remotes=None, ignores=None,
           static_root="/static/", prefix="", dry_run=False):
    # pylint:disable=too-many-arguments
    
    if remotes is None:
        remotes, ignores = _resources_files(
            abs_paths=remote_location.startswith('s3://'))
    if remote_location.startswith('s3://'):
        from deployutils.s3 import S3Backend
        backend = S3Backend(remote_location,
            static_root=static_root, dry_run=dry_run)
        backend.upload(list_local(remotes, prefix), prefix)
    else:
        excludes = []
        if ignores:
            for ignore in ignores:
                excludes += ['--exclude', ignore]
        # -O omit to set mod times on directories to avoid permissions error.
        shell_command(['/usr/bin/rsync']
            + excludes + ['-pOthrRvz', '--rsync-path', '/usr/bin/rsync']
            + remotes + [remote_location], dry_run=dry_run)
303873
boolean isDir(String src) {
    byte[][] components = INodeDirectory.getPathComponents(normalizePath(src));
    readLock();
    try {
      INode node = rootDir.getNode(components);
      return isDir(node);
    } finally {
      readUnlock();
    }
  }
1098409
def mkdir(jottapath, JFS):
    """"""
    jf = JFS.post('%s?mkDir=true' % jottapath)
    return instanceof(jf, JFSFolder)
181108
private static S3Recoverable castToS3Recoverable(CommitRecoverable recoverable) {
		if (recoverable instanceof S3Recoverable) {
			return (S3Recoverable) recoverable;
		}
		throw new IllegalArgumentException(
				"S3 File System cannot recover recoverable for other file system: " + recoverable);
	}
983152
def is_directory (self):
        
        filename = self.get_os_filename()
        return os.path.isdir(filename) and not os.path.islink(filename)
1122672
static String findJarsDir(String sparkHome, String scalaVersion, boolean failIfNotFound) {
    // TODO: change to the correct directory once the assembly build is changed.
    File libdir = new File(sparkHome, "jars");
    if (!libdir.isDirectory()) {
      libdir = new File(sparkHome, String.format("assembly/target/scala-%s/jars", scalaVersion));
      if (!libdir.isDirectory()) {
        checkState(!failIfNotFound,
          "Library directory '%s' does not exist; make sure Spark is built.",
          libdir.getAbsolutePath());
        return null;
      }
    }
    return libdir.getAbsolutePath();
  }