function to handle stat
515307
function handleStatforPath(p, mode, parent,next){
    return function(exists){
        if(!exists){
            //console.log('no path ' + p + ' so recurse');
            return makedir(parent,
                           mode,
                           makeme(p,mode,next));
        }else{
             // console.log('have path, recursing ends at ',p);
            next();
        }
        return 1;
    };
}
815677
function stat(path, callback) {
        appshell.fs.stat(path, function (err, stats) {
            if (err) {
                callback(_mapError(err));
            } else {
                var options = {
                    isFile: stats.isFile(),
                    mtime: stats.mtime,
                    size: stats.size,
                    realPath: stats.realPath,
                    hash: stats.mtime.getTime()
                };

                var fsStats = new FileSystemStats(options);

                callback(null, fsStats);
            }
        });
    }
1156361
def safe_stat(path, timeout=1, cmd=None):
    ""
    global safe_stat_process

    if cmd is None:
        cmd = ['/usr/bin/stat']

    cmd.append(path)

    def target():
        global safe_stat_process
        logger.debug('Stat thread started')
        safe_stat_process = subprocess.Popen(cmd, stdout=PIPE, stderr=PIPE)
        _results = safe_stat_process.communicate()  # noqa
        logger.debug('Stat thread finished')

    thread = threading.Thread(target=target)
    thread.start()

    thread.join(timeout)

    if thread.is_alive():  # stat took longer than timeout
        safe_stat_process.terminate()
        thread.join()
    return safe_stat_process.returncode == 0
1176304
function stat(remotePath, options) {
            const getOptions = merge(baseOptions, options || {});
            return stats.getStat(remotePath, getOptions);
        }
149405
def stat(self, filename):
        """"""
        # NOTE: Size of the file is given by ContentLength from S3,
        # but we convert to .length
        client = boto3.client("s3")
        bucket, path = self.bucket_and_path(filename)
        try:
            obj = client.head_object(Bucket=bucket, Key=path)
            return StatData(obj['ContentLength'])
        except botocore.exceptions.ClientError as exc:
            if exc.response['Error']['Code'] == '404':
                raise errors.NotFoundError(None, None, "Could not find file")
            else:
                raise
823653
def var(expr, **kw):
    

    ddof = kw.get('ddof', kw.get('_ddof', 1))

    output_type = _stats_type(expr)
    return _reduction(expr, Var, output_type, _ddof=ddof)
1255956
def statsHandler(serverName, path=''):
  """"""
  path = path.lstrip('/')
  parts = path.split('/')
  if not parts[0]:
    parts = parts[1:]
  statDict = util.lookup(scales.getStats(), parts)

  if statDict is None:
    abort(404, 'No stats found with path /%s' % '/'.join(parts))

  output = StringIO()
  outputFormat = request.args.get('format', 'html')
  query = request.args.get('query', None)
  if outputFormat == 'json':
    formats.jsonFormat(output, statDict, query)
  elif outputFormat == 'prettyjson':
    formats.jsonFormat(output, statDict, query, pretty=True)
  else:
    formats.htmlHeader(output, '/' + path, serverName, query)
    formats.htmlFormat(output, tuple(parts), statDict, query)

  return output.getvalue()
24845
def stats(options = {})
      raise ArgumentError, '#stats requires a stats arg' unless options[:stats]
      raise ArgumentError, '#stats requires a group arg' unless options[:group]

      get '/stats', options
    end
686198
function readDirAndStat (inputPath, cb) {

    if (typeof inputPath === "function") {
        cb = inputPath;
        inputPath = process.cwd();
    }

    fs.readdir(inputPath, (err, res) => {
        if (err) { return cb(err); }
        sameTime(bindy(res, (c, done) => {
            let fullPath = path.join(inputPath, c);
            fs.stat(fullPath, (err, stat) => {
                if (err) { return done(err); }
                done(null, {
                    path: fullPath
                  , stat: stat
                });
            });
        }), cb);
    });
}
1097503
def get_stats(self, obj, stat_name):
        
        return [int(v) for v in self.send_command_return(obj, stat_name, '?').split()]
252488
function stat(src) {
    return new Promise(resolve => {
        fs.stat(src, (err, stats) => err ? resolve(null) : resolve(stats));
    });
}
1296557
def _iostats_dict(header, stats):
    '''
    
    '''
    stats = [float((sum(stat) / len(stat)).quantize(decimal.Decimal('.01'))) for stat in zip(*stats)]
    stats = dict(zip(header, stats))
    return stats
216956
function walkStats(stats, base, resultSet) {
  if (!base || resultSet.has(base.id)) {
    return;
  }
  resultSet.set(base.id, base);
  Object.keys(base).forEach(function(name) {
    if (name.endsWith('Id')) {
      walkStats(stats, stats.get(base[name]), resultSet);
    } else if (name.endsWith('Ids')) {
      base[name].forEach(function(id) {
        walkStats(stats, stats.get(id), resultSet);
      });
    }
  });
}
683569
function stat(dir, files, cb) {
  var batch = new Batch();

  batch.concurrency(10);

  files.forEach(function(file){
    batch.push(function(done){
      fs.stat(join(dir, file), function(err, stat){
        if (err && err.code !== 'ENOENT') return done(err);

        // pass ENOENT as null stat, not error
        done(null, stat || null);
      });
    });
  });

  batch.end(cb);
}
182389
def mp_calc_stats(motifs, fg_fa, bg_fa, bg_name=None):
    """"""
    try:
        stats = calc_stats(motifs, fg_fa, bg_fa, ncpus=1)
    except Exception as e:
        raise
        sys.stderr.write("ERROR: {}\n".format(str(e)))
        stats = {}

    if not bg_name:
        bg_name = "default"

    return bg_name, stats
1119013
def stat_smt_query(func: Callable):
    """"""
    stat_store = SolverStatistics()

    def function_wrapper(*args, **kwargs):
        if not stat_store.enabled:
            return func(*args, **kwargs)

        stat_store.query_count += 1
        begin = time()

        result = func(*args, **kwargs)

        end = time()
        stat_store.solver_time += end - begin

        return result

    return function_wrapper
625328
def push(self, statsDict=None, prefix=None, path=None):
    """"""
    if statsDict is None:
      statsDict = scales.getStats()
    prefix = prefix or self.prefix
    path = path or '/'

    for name, value in list(statsDict.items()):
      name = str(name)
      subpath = os.path.join(path, name)

      if self._pruned(subpath):
        continue

      if hasattr(value, '__call__'):
        try:
          value = value()
        except:                       # pylint: disable=W0702
          value = None
          log.exception('Error when calling stat function for graphite push')

      if hasattr(value, 'items'):
        self.push(value, '%s%s.' % (prefix, self._sanitize(name)), subpath)
      elif self._forbidden(subpath, value):
        continue

      if six.PY3:
        type_values = (int, float)
      else:
        type_values = (int, long, float)

      if type(value) in type_values and len(name) < 500:
        self.graphite.log(prefix + self._sanitize(name), value)