Returns the physical volume mda count.
1961
def mda_count(self):
        
        self.open()
        mda = lvm_pv_get_mda_count(self.handle)
        self.close()
        return mda
754551
public function getUsedVolumeAttribute()
    {

        $content = $this->content;

        if (! is_null($content))
            return $content->sum(function ($item) {

                return $item->type->volume;
            });

        return 0.0;
    }
1298908
def get_backspace_count(self, buffer):
        
        if TriggerMode.ABBREVIATION in self.modes and self.backspace:
            if self._should_trigger_abbreviation(buffer):
                abbr = self._get_trigger_abbreviation(buffer)
                stringBefore, typedAbbr, stringAfter = self._partition_input(buffer, abbr)
                return len(abbr) + len(stringAfter)

        if self.parent is not None:
            return self.parent.get_backspace_count(buffer)

        return 0
1295411
def GetMemSwappedMB(self):
        ''''''
        counter = c_uint()
        ret = vmGuestLib.VMGuestLib_GetMemSwappedMB(self.handle.value, byref(counter))
        if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
        return counter.value
1259215
public function count()
	{
		switch ($this->Mode)
		{
			case self::MODE_ERROR:
				return 0;
				break;
			case self::MODE_SINGLE:
				return 1;
				break;
			case self::MODE_MULTIPLE:
				return count($this->Data);
				break;
		}
		return 0;
	}
481881
def snapshot_allocation(self):
		
		check_cmd = ['lvs', self.volume_path(), '-o', 'snap_percent', '--noheadings']
		output = subprocess.check_output(check_cmd, timeout=self.__class__.__lvm_snapshot_check_cmd_timeout__)
		output = output.decode().strip()
		if len(output) == 0:
			raise RuntimeError('Unable to check general logical volume')
		return float(output.replace(',', '.', 1))
1112313
public long getSampleCount() {
        long total = (_audioInputStream.getFrameLength()
                * getFormat().getFrameSize() * 8)
                / getFormat().getSampleSizeInBits();
        return total / getFormat().getChannels();
    }
182585
def usage():
    '''
    
    '''
    drives = []
    ret = {}
    drive_bitmask = ctypes.windll.kernel32.GetLogicalDrives()
    for letter in UPPERCASE:
        if drive_bitmask & 1:
            drives.append(letter)
        drive_bitmask >>= 1
    for drive in drives:
        try:
            (available_bytes,
             total_bytes,
             total_free_bytes) = win32api.GetDiskFreeSpaceEx(
                 '{0}:\\'.format(drive)
            )
            used = total_bytes - total_free_bytes
            capacity = used / float(total_bytes) * 100
            ret['{0}:\\'.format(drive)] = {
                'filesystem': '{0}:\\'.format(drive),
                '1K-blocks': total_bytes / 1024,
                'used': used / 1024,
                'available': total_free_bytes / 1024,
                'capacity': '{0:.0f}%'.format(capacity),
            }
        except Exception:
            ret['{0}:\\'.format(drive)] = {
                'filesystem': '{0}:\\'.format(drive),
                '1K-blocks': None,
                'used': None,
                'available': None,
                'capacity': None,
            }
    return ret
273203
def volume(self):
        
        m = self._matrix
        return np.dot(np.cross(m[0], m[1]), m[2])
607882
def GetVolumeByIndex(self, volume_index):
    
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    if volume_index < 0 or volume_index >= len(self._volume_identifiers):
      return None

    volume_identifier = self._volume_identifiers[volume_index]
    return self._volumes[volume_identifier]
1361872
def get_speaker_volume(self):
        """"""
        if not self.camera_extended_properties:
            return None

        speaker = self.camera_extended_properties.get('speaker')
        if not speaker:
            return None

        return speaker.get('volume')
1004191
def mode_counts(self):
        '''

        '''
        modes = {self.RUN: 0, self.IDLE: 0, self.TERMINATE: 0}
        for worker_id, mode in self.workers().items():
            modes[mode] += 1
        return modes
1203941
def _get_memmap(self):
        """"""

        with open(self.filename) as fp:

            data_dtype = self._get_data_dtype()
            hdr_size = native_header.itemsize

            return np.memmap(fp, dtype=data_dtype,
                             shape=(self.mda['number_of_lines'],),
                             offset=hdr_size, mode="r")
768281
def get_metadata_count_mat(self):
        '''
        
        '''
        freq_mat = np.zeros(shape=(self.get_num_metadata(), self.get_num_categories()), dtype=int)
        for cat_i in range(self.get_num_categories()):
            mX = (self._mX[self._y == cat_i, :] > 0).astype(int)
            freq_mat[:, cat_i] = mX.sum(axis=0)
        return freq_mat
882827
def physical_cores(self):
        """"""
        try:
            return self._physical_cores_base()
        except Exception as e:
            from rez.utils.logging_ import print_error
            print_error("Error detecting physical core count, defaulting to 1: %s"
                        % str(e))
        return 1
1314568
def volume(self):
        
        sizes = self.compute_cell_sizes(length=False, area=False, volume=True)
        return np.sum(sizes.cell_arrays['Volume'])
611666
public int getBlankCount() {
        int count = mBlankCount;
        if (count < 0) {
            mBlankCount = count = (mPropFilter.isConstant() ? 0 : 1)
                + ((mPrev == null) ? 0 : mPrev.getBlankCount());
        }
        return count;
    }