Count number of files from admin set works
 @param [Array] AdminSets to count files in
 @return [Hash] admin set id keys and file count values
19007
def count_files(admin_sets)
        file_counts = Hash.new(0)
        admin_sets.each do |admin_set|
          query = "{!join from=file_set_ids_ssim to=id}isPartOf_ssim:#{admin_set.id}"
          file_results = ActiveFedora::SolrService.instance.conn.get(
            ActiveFedora::SolrService.select_path,
            params: { fq: [query, "has_model_ssim:FileSet"],
                      rows: 0 }
          )
          file_counts[admin_set.id] = file_results['response']['numFound']
        end
        file_counts
      end
269937
public static int checkDirectoryArray(final String[] names) {
    int count = 0;
    for (int i = 0; i < names.length; i++) {
      if (names[i] != null) {
        final File dir = new File(names[i]);
        if (dir.exists() && dir.isDirectory()) {
          count++;
        } else {
          names[i] = null;
        }
      }
    }
    return count;
  }
455043
def keys(pattern = SCAN_PATTERN, count = DEFAULT_COUNT)
      return redis(&:keys) if pattern.nil?

      redis { |conn| conn.scan_each(match: prefix(pattern), count: count).to_a }
    end
94948
def _collect_all_files(self, files=None):
        
        if files is None:
            files = self._root_elements
        collected = set()
        for entry in files:
            collected.add(entry)
            collected.update(self._collect_all_files(entry.children))
        return collected
431583
function countChildren(pipelineId) {
  var current = STATUS_MAP.pipelines[pipelineId];
  if (!current) {
    return [0, 0];
  }
  var total = 1;
  var done = 0;
  if (current.status == 'done') {
    done += 1;
  }
  for (var i = 0, n = current.children.length; i < n; i++) {
    var parts = countChildren(current.children[i]);
    total += parts[0];
    done += parts[1];
  }
  return [total, done];
}
1056444
def mget(msg_id, keys)
      keys = keys.map{|suffix| key(msg_id, suffix)}
      with_failover { redis.mget(*keys) }
    end
60139
def create
      admin_set.creator = [creating_user.user_key] if creating_user
      admin_set.save.tap do |result|
        if result
          ActiveRecord::Base.transaction do
            permission_template = create_permission_template
            workflow = create_workflows_for(permission_template: permission_template)
            create_default_access_for(permission_template: permission_template, workflow: workflow) if admin_set.default_set?
          end
        end
      end
    end
661999
def scan
      unless @@files_seen.include? @file_name
	@@files_seen << @file_name
	remove_commented_out_lines
	if module_name = do_module
	  @@module_name = module_name
	  do_methods module_name
	else
	  do_classes
	  @classes.keys.each do |c|
	    do_constants c
	    do_methods c
	    do_includes
	    do_aliases c
	    end
	  end
      else
	puts "Seen #{@file_name} before" unless @options.quiet
      end
      @top_level
    end
1244277
def count_with_file(filename)
      return if ::ServiceMock.disable_stubs
      yield self if block_given?
      content = File.open(filename, 'rb') { |file| file.read }
      count(content)
    end
1121500
public static int getBondCount(IRingSet set) {
        int count = 0;
        for (IAtomContainer atomContainer : set.atomContainers()) {
            count += atomContainer.getBondCount();
        }
        return count;
    }
975062
def files_in(directories)
      files = []
      Find.find(*directories) do |path|
        unless File.directory?(path) or File.symlink?(path)
          files << File.expand_path(path)
        end
      end
      files.uniq
    end
120420
def tracked_coordinator_count(self, count_ascps=False):
        '''  '''
        with self._lock:
            _count = 0
            if count_ascps:
                for _coordinator in self._tracked_transfer_coordinators:
                    _count += _coordinator.session_count
            else:
                _count = len(self._tracked_transfer_coordinators)
            return _count
883703
def count_values(*values)
      values.inject(Hash.new(0)) { |h, v| h[v] += 1; h }
    end
558881
def count
      users_count = MnoEnterprise::Tenant.get('tenant').users_count
      render json: {count: users_count }
    end
353223
def multiget_count(self, keys, column_parent, predicate, consistency_level):
    
    self._seqid += 1
    d = self._reqs[self._seqid] = defer.Deferred()
    self.send_multiget_count(keys, column_parent, predicate, consistency_level)
    return d
1092035
def files(self):
        
        ios_names = [info.name for info in self._ios_to_add.keys()]
        return set(self.files_to_add + ios_names)
1074281
def count(self):
        
        self.log.info("Running 'count'")
        retvals = {}

        # Numbers of 'tasks'
        num_tasks = self._count_tasks()
        retvals['num_tasks'] = num_tasks

        # Numbers of 'files'
        num_files = self._count_repo_files()
        retvals['num_files'] = num_files

        return retvals