Gets set of rotational speed of the disks
551188
def drive_rotational_speed_rpm(self):
        """"""
        drv_rot_speed_rpm = set()
        for member in self.get_members():
            drv_rot_speed_rpm.update(member.drive_rotational_speed_rpm)
        return drv_rot_speed_rpm
1163487
def on_for_distance(self, speed, distance_mm, brake=True, block=True):
        
        rotations = distance_mm / self.wheel.circumference_mm
        log.debug("%s: on_for_rotations distance_mm %s, rotations %s, speed %s" % (self, distance_mm, rotations, speed))

        MoveTank.on_for_rotations(self, speed, speed, rotations, brake, block)
48368
def pivot(self, speed, durationS=-1.0):
        
        if speed < 0:
            self.left_fwd(min(abs(speed), 255))
            self.right_rev(min(abs(speed), 255))
        else:
            self.left_rev(min(abs(speed), 255))
            self.right_fwd(min(abs(speed), 255))
        if durationS > 0:
            self.board.sleep(durationS)
            self.left_stop()
            self.right_stop()
1230113
def volumes(self):
    """"""
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    return iter(self._volumes.values())
664509
function() {
      var timings = {};
      var requests = win.performance.getEntriesByType("resource");
      for (var i = 0; i < requests.length; i++)
        timings[requests[i].name] = requests[i].responseEnd;
      for (var j = 0; j < rects.length; j++) {
        if (!('tm' in rects[j]))
          rects[j].tm = timings[rects[j].url] !== undefined ? timings[rects[j].url] : 0;
      }
    }
1102078
def get_volumes(self):
        """"""

        volumes = []
        for disk in self.disks:
            volumes.extend(disk.get_volumes())
        return volumes
120777
def get_rotation_and_scale(header, skew_threshold=0.001):
    """"""
    ((xrot, yrot),
     (cdelt1, cdelt2)) = get_xy_rotation_and_scale(header)

    if math.fabs(xrot) - math.fabs(yrot) > skew_threshold:
        raise ValueError("Skew detected: xrot=%.4f yrot=%.4f" % (
            xrot, yrot))
    rot = yrot

    lonpole = float(header.get('LONPOLE', 180.0))
    if lonpole != 180.0:
        rot += 180.0 - lonpole

    return (rot, cdelt1, cdelt2)
1172839
def _get_acceleration(self, data):
        ''''''
        if (data[7:8] == 0x7FFF or
                data[9:10] == 0x7FFF or
                data[11:12] == 0x7FFF):
            return (None, None, None)

        acc_x = twos_complement((data[7] << 8) + data[8], 16)
        acc_y = twos_complement((data[9] << 8) + data[10], 16)
        acc_z = twos_complement((data[11] << 8) + data[12], 16)
        return (acc_x, acc_y, acc_z)
664833
def _get_fs(self):
        '''
        
        '''

        data = dict()
        for dev, dev_data in salt.utils.fsutils._blkid().items():
            dev = self._get_disk_size(dev)
            device = dev.pop('device')
            dev['type'] = dev_data['type']
            data[device] = dev

        return data
164001
def get_disk_statistics(self):
        
        result = {}

        if os.access('/proc/diskstats', os.R_OK):
            self.proc_diskstats = True
            fp = open('/proc/diskstats')

            try:
                for line in fp:
                    try:
                        columns = line.split()
                        # On early linux v2.6 versions, partitions have only 4
                        # output fields not 11. From linux 2.6.25 partitions
                        # have the full stats set.
                        if len(columns) < 14:
                            continue
                        major = int(columns[0])
                        minor = int(columns[1])
                        device = columns[2]

                        if ((device.startswith('ram') or
                             device.startswith('loop'))):
                            continue

                        result[(major, minor)] = {
                            'device': device,
                            'reads': float(columns[3]),
                            'reads_merged': float(columns[4]),
                            'reads_sectors': float(columns[5]),
                            'reads_milliseconds': float(columns[6]),
                            'writes': float(columns[7]),
                            'writes_merged': float(columns[8]),
                            'writes_sectors': float(columns[9]),
                            'writes_milliseconds': float(columns[10]),
                            'io_in_progress': float(columns[11]),
                            'io_milliseconds': float(columns[12]),
                            'io_milliseconds_weighted': float(columns[13])
                        }
                    except ValueError:
                        continue
            finally:
                fp.close()
        else:
            self.proc_diskstats = False
            if not psutil:
                self.log.error('Unable to import psutil')
                return None

            disks = psutil.disk_io_counters(True)
            sector_size = int(self.config['sector_size'])
            for disk in disks:
                result[(0, len(result))] = {
                    'device': disk,
                    'reads': disks[disk].read_count,
                    'reads_sectors': disks[disk].read_bytes / sector_size,
                    'reads_milliseconds': disks[disk].read_time,
                    'writes': disks[disk].write_count,
                    'writes_sectors': disks[disk].write_bytes / sector_size,
                    'writes_milliseconds': disks[disk].write_time,
                    'io_milliseconds':
                        disks[disk].read_time + disks[disk].write_time,
                    'io_milliseconds_weighted':
                        disks[disk].read_time + disks[disk].write_time
                }

        return result
1272834
def diskdata():
    """"""
    p = os.popen("/bin/df -l -P")
    ddata = {}
    tsize = 0
    for line in p.readlines():
        d = line.split()
        if ("/dev/sd" in d[0] or "/dev/hd" in d[0] or "/dev/mapper" in d[0]):
            tsize = tsize + int(d[1])
    ddata["Disk_GB"] = int(tsize)/1000000
    p.close()
    return ddata
956723
def rw_active(self):
        """"""
        result = False
        for disk in self.disks:
            result = disk.rw_active() or result
        return result
654885
def Disks(self):
		

		if not self.disks:  self.disks = clc.v2.Disks(server=self,disks_lst=self.data['details']['disks'],session=self.session)

		return(self.disks)
755259
def get_disks(self):
        
        disks = [disk for disk in self.xml.iter('disk')]
        disk_objs = []
        for disk in disks:
            source = disk.find('source')
            if source is None:
                continue
            path = source.attrib['file']
            diskobj = self.domain.connect().storageVolLookupByPath(path)
            disk_objs.append(diskobj)
        return [Volume(d, StoragePool(d.storagePoolLookupByVolume())) for d in disk_objs]
1368137
function getPerformanceTimingData() {
        var PerformanceObj = {
            'redirecting': performance.timing.fetchStart - performance.timing.navigationStart,
            'dnsconnect': performance.timing.requestStart - performance.timing.fetchStart,
            'request': performance.timing.responseStart - performance.timing.requestStart,
            'response': performance.timing.responseEnd - performance.timing.responseStart,
            'domprocessing': performance.timing.domComplete - performance.timing.responseEnd,
            'load': performance.timing.loadEventEnd - performance.timing.loadEventStart
        };

        /**
         * Obtaining the transferred kb of resources inluding estimated document size.
         */
        if (window.performance && window.performance.getEntriesByType) {
            var resource;
            var resources = window.performance.getEntriesByType('resource');
            var documentSize = unescape(encodeURIComponent(document.documentElement.innerHTML)).length / 4.2;
            var byteTotal = 0;
            for (var i = 0; i < resources.length; i++) {
                resource = resources[i];
                byteTotal = byteTotal + resource.transferSize;
            }
            PerformanceObj.transferbytes = byteTotal + Math.round(documentSize);
            PerformanceObj.transferrequests = resources.length + 1;
        }

        return PerformanceObj;
    }
1060714
def disk2ram(self):
        """"""
        values = self.series
        self.deactivate_disk()
        self.ramflag = True
        self.__set_array(values)
        self.update_fastaccess()
765273
public function getHD()
    {

        // Time?
        if (!empty($this->settings['timer'])) {
            $t = new Timer('Drives');
        }

        // Get partitions
        $partitions = [];
        $partitions_contents = Common::getContents('/proc/partitions');
        if (@preg_match_all('/(\d+)\s+([a-z]{3})(\d+)$/m', $partitions_contents, $partitions_match, PREG_SET_ORDER) > 0) {
            // Go through each match
            foreach ($partitions_match as $partition) {
                $partitions[$partition[2]][] = array(
                    'size' => $partition[1] * 1024,
                    'number' => $partition[3],
                );
            }
        }

        // Store drives here
        $drives = [];

        // Get actual drives
        foreach ((array) @glob('/sys/block/*/device/model', GLOB_NOSORT) as $path) {

            // Parts of the path
            $parts = explode('/', $path);

            // Attempt getting read/write stats
            if (preg_match('/^(\d+)\s+\d+\s+\d+\s+\d+\s+(\d+)/', Common::getContents(dirname(dirname($path)).'/stat'), $statMatches) !== 1) {
                // Didn't get it
                $reads = false;
                $writes = false;
            } else {
                // Got it, save it
                list(, $reads, $writes) = $statMatches;
            }

            // Append this drive on
            $drives[] = array(
                'name' => Common::getContents($path, 'Unknown').(Common::getContents(dirname(dirname($path)).'/queue/rotational') == 0 ? ' (SSD)' : ''),
                'vendor' => Common::getContents(dirname($path).'/vendor', 'Unknown'),
                'device' => '/dev/'.$parts[3],
                'reads' => $reads,
                'writes' => $writes,
                'size' => Common::getContents(dirname(dirname($path)).'/size', 0) * 512,
                'partitions' => array_key_exists($parts[3], $partitions) && is_array($partitions[$parts[3]]) ? $partitions[$parts[3]] : false,
            );
        }

        // Return drives
        return $drives;
    }