Retrieves the stat object.

    Returns:
      VFSStat: stat object.
198131
def _GetStat(self):
    
    stat_object = super(TSKFileEntry, self)._GetStat()

    # File data stat information.
    stat_object.size = getattr(self._tsk_file.info.meta, 'size', None)

    # Date and time stat information.
    stat_time, stat_time_nano = self._TSKFileTimeCopyToStatTimeTuple(
        self._tsk_file, 'bkup')
    if stat_time is not None:
      stat_object.bkup = stat_time
      stat_object.bkup_nano = stat_time_nano

    stat_time, stat_time_nano = self._TSKFileTimeCopyToStatTimeTuple(
        self._tsk_file, 'dtime')
    if stat_time is not None:
      stat_object.dtime = stat_time
      stat_object.dtime_nano = stat_time_nano

    # Ownership and permissions stat information.
    mode = getattr(self._tsk_file.info.meta, 'mode', None)
    if mode is not None:
      # We need to cast mode to an int since it is of type
      # pytsk3.TSK_FS_META_MODE_ENUM.
      stat_object.mode = int(mode)

    stat_object.uid = getattr(self._tsk_file.info.meta, 'uid', None)
    stat_object.gid = getattr(self._tsk_file.info.meta, 'gid', None)

    # File entry type stat information.

    # Other stat information.
    stat_object.ino = getattr(self._tsk_file.info.meta, 'addr', None)
    # stat_object.dev = stat_info.st_dev
    # stat_object.nlink = getattr(self._tsk_file.info.meta, 'nlink', None)
    # stat_object.fs_type = 'Unknown'

    flags = getattr(self._tsk_file.info.meta, 'flags', 0)

    # The flags are an instance of pytsk3.TSK_FS_META_FLAG_ENUM.
    stat_object.is_allocated = bool(int(flags) & pytsk3.TSK_FS_META_FLAG_ALLOC)

    return stat_object
1337520
def _GetStat(self):
    
    stat_object = super(FakeFileEntry, self)._GetStat()

    location = getattr(self.path_spec, 'location', None)
    if location:
      file_data = self._file_system.GetDataByPath(location)

      if file_data is not None:
        stat_object.size = len(file_data)

    return stat_object
1037883
def get(self):
        
        return WorkerStatisticsContext(
            self._version,
            workspace_sid=self._solution['workspace_sid'],
            worker_sid=self._solution['worker_sid'],
        )
275783
def statistics(self):
        
        if self._statistics is None:
            self._statistics = TaskQueueStatisticsList(
                self._version,
                workspace_sid=self._solution['workspace_sid'],
                task_queue_sid=self._solution['sid'],
            )
        return self._statistics
277739
def get_stats(self, stat_name):
        

        return [self.get_stat(r, stat_name) for r in self.statistics.keys()]
766687
def get_mailbox_stats(self):
        
        resp = self.request_single('GetMailboxStats')
        ret = {}
        for k, v in resp.items():
            ret[k] = int(v)

        return ret
429862
def get_status(self):
        

        status = yield from self._hypervisor.send('vm get_status "{name}"'.format(name=self._name))
        if len(status) == 0:
            raise DynamipsError("Can't get vm {name} status".format(name=self._name))
        return self._status[int(status[0])]
1114124
def stats(self):
        
        import ns1.rest.stats
        return ns1.rest.stats.Stats(self.config)
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
366650
async def getStats(self):
        
        for ssrc, stream in self.__remote_streams.items():
            self.__stats.add(RTCInboundRtpStreamStats(
                # RTCStats
                timestamp=clock.current_datetime(),
                type='inbound-rtp',
                id='inbound-rtp_' + str(id(self)),
                # RTCStreamStats
                ssrc=ssrc,
                kind=self.__kind,
                transportId=self.transport._stats_id,
                # RTCReceivedRtpStreamStats
                packetsReceived=stream.packets_received,
                packetsLost=stream.packets_lost,
                jitter=stream.jitter,
                # RTPInboundRtpStreamStats
            ))
        self.__stats.update(self.transport._get_stats())

        return self.__stats
680243
def _GetStat(self):
    
    stat_object = super(LVMFileEntry, self)._GetStat()

    if self._vslvm_logical_volume is not None:
      stat_object.size = self._vslvm_logical_volume.size

    return stat_object
173025
def get_flat_stats(self):
        
        flat_stats = OrderedDict()
        for obj, port_stats in self.statistics.items():
            flat_obj_stats = OrderedDict()
            for group_name, group_values in port_stats.items():
                for stat_name, stat_value in group_values.items():
                    full_stat_name = group_name + '_' + stat_name
                    flat_obj_stats[full_stat_name] = stat_value
            flat_stats[obj.name] = flat_obj_stats
        return flat_stats
1050729
def get_stats(self):
        
        sent = ctypes.c_uint32()
        recv = ctypes.c_uint32()
        send_errors = ctypes.c_uint32()
        recv_errors = ctypes.c_uint32()
        result = self.library.Par_GetStats(self.pointer, ctypes.byref(sent),
                                   ctypes.byref(recv),
                                   ctypes.byref(send_errors),
                                   ctypes.byref(recv_errors))
        check_error(result, "partner")
        return sent, recv, send_errors, recv_errors
692391
def get_statistics(self):
        
        stats = {
            "creation_time": self._creation_time_in_seconds,
            "evictions": self._evictions,
            "expirations": self._expirations,
            "misses": self._misses,
            "hits": self._hits,
            "invalidations": self._invalidations,
            "invalidation_requests": self._invalidation_requests,
            "owned_entry_count": self.__len__(),
            "owned_entry_memory_cost": getsizeof(self),
        }

        return stats
306315
def _GetStat(self):
    
    stat_object = super(GzipFileEntry, self)._GetStat()

    if self._gzip_file:
      stat_object.size = self._gzip_file.uncompressed_data_size

    # Other stat information.
    # gzip_file.comment
    # gzip_file.operating_system
    # gzip_file.original_filename

    return stat_object
530473
def stats(self):
        
        # TODO - this would be nicer if we formatted the stats
        return self._client.get('{}/stats'.format(Instance.api_endpoint), model=self)
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