Retrieves a stat object.

    Returns:
      VFSStat: a stat object.

    Raises:
      BackEndError: when the encoded stream is missing.
549889
def _GetStat(self):
    
    stat_object = vfs_stat.VFSStat()

    # File data stat information.
    stat_object.size = self.path_spec.range_size

    # File entry type stat information.
    stat_object.type = stat_object.TYPE_FILE

    return stat_object
491039
def rest_get_stream(self, url, auth=None, verify=True, cert=None):
        
        res = requests.get(url, auth=auth, stream=True, verify=verify, cert=cert)
        return res.raw, res.status_code
58706
def stats(self):
        
        def redFunc(left_counter, right_counter):
            return left_counter.mergeStats(right_counter)

        return self.mapPartitions(lambda i: [StatCounter(i)]).reduce(redFunc)
1090681
def _GetStat(self):
    
    stat_object = super(ZipFileEntry, self)._GetStat()

    if self._zip_info is not None:
      # File data stat information.
      stat_object.size = getattr(self._zip_info, 'file_size', None)

      # Ownership and permissions stat information.
      if self._external_attributes != 0:
        if self._creator_system == self._CREATOR_SYSTEM_UNIX:
          st_mode = self._external_attributes >> 16
          stat_object.mode = st_mode & 0x0fff

    # Other stat information.
    # zip_info.compress_type
    # zip_info.comment
    # zip_info.extra
    # zip_info.create_version
    # zip_info.extract_version
    # zip_info.flag_bits
    # zip_info.volume
    # zip_info.internal_attr
    # zip_info.compress_size

    return stat_object
185102
def _GetStat(self):
    
    stat_object = super(BDEFileEntry, self)._GetStat()

    stat_object.size = self._bde_volume.get_size()

    return stat_object
333542
def stat(self, follow_symlinks=True):
        
        if follow_symlinks:
            if self._statresult_symlink is None:
                file_object = self._filesystem.resolve(self.path)
                if self._filesystem.is_windows_fs:
                    file_object.st_nlink = 0
                self._statresult_symlink = file_object.stat_result.copy()
            return self._statresult_symlink

        if self._statresult is None:
            file_object = self._filesystem.lresolve(self.path)
            self._inode = file_object.st_ino
            if self._filesystem.is_windows_fs:
                file_object.st_nlink = 0
            self._statresult = file_object.stat_result.copy()
        return self._statresult
1062846
def getProcessStats(self):
        
        info_dict = {}
        try:
            fp = open(cpustatFile, 'r')
            data = fp.read()
            fp.close()
        except:
            raise IOError('Failed reading stats from file: %s' % cpustatFile)
        for line in data.splitlines():
            arr = line.split()
            if len(arr) > 1 and arr[0] in ('ctxt', 'intr', 'softirq',
                                           'processes', 'procs_running', 
                                           'procs_blocked'):
                info_dict[arr[0]] = arr[1]
        return info_dict
701108
def _calc_vcf_stats(in_file):
    
    out_file = "%s-stats.yaml" % utils.splitext_plus(in_file)[0]
    if not utils.file_exists(out_file):
        stats = {"avg_depth": _average_called_depth(in_file)}
        with open(out_file, "w") as out_handle:
            yaml.safe_dump(stats, out_handle, default_flow_style=False, allow_unicode=False)
        return stats
    else:
        with open(out_file) as in_handle:
            stats = yaml.safe_load(in_handle)
        return stats
429163
def stats(self, key=None):
        
        # TODO: Stats with key is not working.
        if key is not None:
            if isinstance(key, text_type):
                key = str_to_bytes(key)
            keylen = len(key)
            packed = struct.pack(
                self.HEADER_STRUCT + '%ds' % keylen,
                self.MAGIC['request'],
                self.COMMANDS['stat']['command'],
                keylen, 0, 0, 0, keylen, 0, 0, key)
        else:
            packed = struct.pack(
                self.HEADER_STRUCT,
                self.MAGIC['request'],
                self.COMMANDS['stat']['command'],
                0, 0, 0, 0, 0, 0, 0)

        self._send(packed)

        value = {}

        while True:
            response = self._get_response()

            status = response[5]
            if status == self.STATUS['server_disconnected']:
                break

            keylen = response[2]
            bodylen = response[6]

            if keylen == 0 and bodylen == 0:
                break

            extra_content = response[-1]
            key = extra_content[:keylen]
            body = extra_content[keylen:bodylen]
            value[key.decode() if isinstance(key, bytes) else key] = body

        return value
58882
def getStats(self):
        
        info_dict = {}
        args = [varnishstatCmd, '-1']
        if self._instance is not None:
            args.extend(['-n', self._instance])
        output = util.exec_command(args)
        if self._descDict is None:
            self._descDict = {}
        for line in output.splitlines():
            mobj = re.match('(\S+)\s+(\d+)\s+(\d+\.\d+|\.)\s+(\S.*\S)\s*$', 
                            line)
            if mobj:
                fname = mobj.group(1).replace('.', '_')
                info_dict[fname] = util.parse_value(mobj.group(2))
                self._descDict[fname] = mobj.group(4)
        return info_dict
187546
def _GetStat(self):
    
    stat_object = super(VShadowFileEntry, self)._GetStat()

    if self._vshadow_store is not None:
      # File data stat information.
      stat_object.size = self._vshadow_store.volume_size

    # Ownership and permissions stat information.

    # File entry type stat information.

    # The root file entry is virtual and should have type directory.
    return stat_object
1339716
public Nfs3FsStatResponse getFsStat(NfsFsStatRequest request) throws IOException {
        Nfs3FsStatResponse response = new Nfs3FsStatResponse();
        _rpcWrapper.callRpcNaked(request, response);
        return response;
    }
967
def getStats(self):
        
        stats = protocol.ReadStats()
        stats.aligned_read_count = self.getNumAlignedReads()
        stats.unaligned_read_count = self.getNumUnalignedReads()
        # TODO base_count requires iterating through all reads
        return stats
685149
def vmstat(stat):
    
    out = subprocess.check_output(["vmstat", "-s"])
    stat = stat.encode("ascii")
    for line in out.split(b"\n"):
        line = line.strip()
        if stat in line:
            return int(line.split(b" ")[0])
    raise ValueError("Can't find {} in 'vmstat' output.".format(stat))
68820
def getFilesystemStats(self, fs):
        
        if self._mapFSpathDev is None:
            self._initFilesystemInfo()
        return self._diskStats.get(self._mapFSpathDev.get(fs))
1257756
def read_stats(self):
        

        self.tx_statistics = TgnObjectsDict()
        for port in self.session.ports.values():
            for stream in port.streams.values():
                self.tx_statistics[stream] = stream.read_stats()

        tpld_statistics = XenaTpldsStats(self.session).read_stats()

        self.statistics = TgnObjectsDict()
        for stream, stream_stats in self.tx_statistics.items():
            self.statistics[stream] = OrderedDict()
            self.statistics[stream]['tx'] = stream_stats
            self.statistics[stream]['rx'] = OrderedDict()
            stream_tpld = stream.get_attribute('ps_tpldid')
            for tpld, tpld_stats in tpld_statistics.items():
                if tpld.id == stream_tpld:
                    self.statistics[stream]['rx'][tpld] = tpld_stats
        return self.statistics
1275730
def lstat(self):
        
        if self._closed:
            self._raise_closed()
        return self._accessor.lstat(self)