Classify the input resource as a directory index or not.
198707
def is_directory_index(resource):
    
    remote_regexp = re.compile(r"^https?://(.+)/?$", re.I)
    result = remote_regexp.match(resource)

    if result is not None:
        juicer.utils.Log.log_debug("%s matches directory index regexp" % resource)
        return True
    else:
        juicer.utils.Log.log_debug("%s doesn't match directory index regexp" % resource)
        return False
1276332
function(stat)
{
	if(stat)
	{
		if(stat.isDirectory)
		{
			return stat.isDirectory()
		}
		if(stat.type)
		{
			if(stat.type=="dir")
			{
				return true
			}
		}
	}
	return false
}
193417
function classifyFile (file) {
    return stat(file).then(({ err, stats }) => {
      if (err) {
        if (err.code === 'ENOENT') {
          missingFiles.push(file)
        } else {
          throw err
        }
      } else {
        foundFiles.push(file)
      }
    })
  }
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
500940
def choose_type(cls, content_type):
        """"""
        return cls.type_cls.SUBDIR if content_type in cls.subdir_types \
            else cls.type_cls.FILE
1278640
public boolean isUseSecondryIndex()
    {
        // if lucene directory and indexer class both not present then return
        // true.

        return StringUtils.isEmpty(LuceneIndexDir) && StringUtils.isBlank(LuceneIndexDir)
                && StringUtils.isEmpty(indexImplementor) && StringUtils.isBlank(indexImplementor);
    }
122147
def is_directory(self, path):
        '''

        '''
        node = self.get_node(path)
        if not node:
            return False
        return node.is_directory
49785
def _IsDirectory(parent, item):
  """"""
  return tf.io.gfile.isdir(os.path.join(parent, item))
33221
def index(self, index):
        
        if self._index != index:
            self._dirty = True
        self._index = index
663784
def set_indexing(working_dir, flag):
    
    indexing_path = get_indexing_lockfile(working_dir)
    if flag:
        try:
            fd = open( indexing_path, "w+" )
            fd.close()
            return True
        except:
            return False

    else:
        try:
            os.unlink( indexing_path )
            return True
        except:
            return False
42743
def get_entries(path):
    """"""
    dirs, files = [], []
    for entry in os.listdir(path):
        # Categorize entry as directory or file.
        if os.path.isdir(os.path.join(path, entry)):
            dirs.append(entry)
        else:
            files.append(entry)
    dirs.sort()
    files.sort()
    return dirs, files
1012135
function createPredicateIndexFinder(dir) {
                return function(array, predicate, context) {
                  predicate = cb(predicate, context);
                  var length = getLength(array);
                  var index = dir > 0 ? 0 : length - 1;
                  for (; index >= 0 && index < length; index += dir) {
                    if (predicate(array[index], index, array)) return index;
                  }
                  return -1;
                };
              }
1205412
function is_dir($path) {

        // be sure path is utf-8
        $item = $this->gpi($path);

        if ($item === false) {
            return false;
        } else {
            return ($item['resourcetype'] == 'collection');
        }
    }
513903
def file_attribs(location, mode=None, owner=None, group=None, sudo=False):
    """"""
    return dir_attribs(location, mode, owner, group, False, sudo)
1168387
def is_directory(self, path):
        """"""
        return self._getReturnCodeCmd([self._hadoop_cmd, 'fs', '-test', '-d', self._full_hdfs_path(path)]) == 0
872786
def is_dir(path):
    """"""
    try:
        return path.expanduser().absolute().is_dir()
    except AttributeError:
        return os.path.isdir(os.path.abspath(os.path.expanduser(str(path))))
804028
def is_files(self, path):
        """"""
        return self._getReturnCodeCmd([self._hadoop_cmd, 'fs', '-test', '-f', self._full_hdfs_path(path)]) == 0