Fetch dimensions based on platform.
334182
private static function fetchDimensions()
    {
        if (DIRECTORY_SEPARATOR === '\\') {
            $dimensions = static::getAnsiCon();
            if (!$dimensions) {
                $dimensions = static::getConsoleMode();
            }
        } else {
            $dimensions = static::getSttyColumns();
        }

        // Default, if above methods fail.
        $dimensions += [80, 50];

        static::$width = $dimensions[0];
        static::$height = $dimensions[1];

        // Reset signal handler flag.
        static::$pcntlNeedsUpdate = false;
    }
85562
def with_dimensions(self, *dimensions):
    """"""
    self.dimensions = tuple(
        self._maybe_make_dimension(dim) for dim in dimensions)
    self._cached = None
    return self
528886
def _iter_dimensions(self):
        """"""
        return (
            Dimension(raw_dimension.dimension_dict, raw_dimension.dimension_type)
            for raw_dimension in self._raw_dimensions
        )
383926
def dimensional_shape(self) -> typing.Optional[typing.Tuple[int, ...]]:
        """"""
        if not self.__data_and_metadata:
            return None
        return self.__data_and_metadata.dimensional_shape
734908
def get_image_dimensions(request):
        
        if request.service_type is ServiceType.WCS or (isinstance(request.size_x, int) and
                                                       isinstance(request.size_y, int)):
            return request.size_x, request.size_y
        if not isinstance(request.size_x, int) and not isinstance(request.size_y, int):
            raise ValueError("At least one of parameters 'width' and 'height' must have an integer value")
        missing_dimension = get_image_dimension(request.bbox, width=request.size_x, height=request.size_y)
        if request.size_x is None:
            return missing_dimension, request.size_y
        if request.size_y is None:
            return request.size_x, missing_dimension
        raise ValueError("Parameters 'width' and 'height' must be integers or None")
1160255
def get_dataset(self, key, info):
        """"""

        angles = self._get_coarse_dataset(key, info)
        if angles is None:
            return

        # Fill gaps at edges of swath
        darr = DataArray(angles, dims=['y', 'x'])
        darr = darr.bfill('x')
        darr = darr.ffill('x')
        angles = darr.data

        res = self.interpolate_angles(angles, key.resolution)

        proj = DataArray(res, dims=['y', 'x'])
        proj.attrs = info.copy()
        proj.attrs['units'] = 'degrees'
        proj.attrs['platform_name'] = self.platform_name
        return proj
596042
def getsize(store, path=None):
    """"""
    path = normalize_storage_path(path)
    if hasattr(store, 'getsize'):
        # pass through
        return store.getsize(path)
    elif isinstance(store, dict):
        # compute from size of values
        if path in store:
            v = store[path]
            size = buffer_size(v)
        else:
            members = listdir(store, path)
            prefix = _path_to_prefix(path)
            size = 0
            for k in members:
                try:
                    v = store[prefix + k]
                except KeyError:
                    pass
                else:
                    try:
                        size += buffer_size(v)
                    except TypeError:
                        return -1
        return size
    else:
        return -1
1327703
def get_bit_width(self, resource):
        """"""
        datatype = resource.datatype

        if "uint" in datatype:
            bit_width = int(datatype.split("uint")[1])
        else:
            raise ValueError("Unsupported datatype: {}".format(datatype))

        return bit_width
92056
def get_grid_spatial_dimensions(self, variable):
        """"""

        data = self.open_dataset(self.service).variables[variable.variable]
        dimensions = list(data.dimensions)
        return data.shape[dimensions.index(variable.x_dimension)], data.shape[dimensions.index(variable.y_dimension)]
631340
def get_array_ndim(self, key):
        """"""
        data = self.model.get_data()
        return data[key].ndim
1036531
private static int computeDimension(ResultPoint topLeft,
                                      ResultPoint topRight,
                                      ResultPoint bottomLeft,
                                      float moduleSize) throws NotFoundException {
    int tltrCentersDimension = MathUtils.round(ResultPoint.distance(topLeft, topRight) / moduleSize);
    int tlblCentersDimension = MathUtils.round(ResultPoint.distance(topLeft, bottomLeft) / moduleSize);
    int dimension = ((tltrCentersDimension + tlblCentersDimension) / 2) + 7;
    switch (dimension & 0x03) { // mod 4
      case 0:
        dimension++;
        break;
        // 1? do nothing
      case 2:
        dimension--;
        break;
      case 3:
        throw NotFoundException.getNotFoundInstance();
    }
    return dimension;
  }
488534
@SuppressWarnings("resource")
    public String getDimensions() {

        try {
            BufferedImage img = Simapi.read(IOUtils.toByteArray(new FileInputStream(m_variationPath)));
            return "" + img.getWidth() + " x " + img.getHeight() + "px";
        } catch (IOException e) {
            return "";
        }
    }
712082
def get_size(self):
        """"""
        attr = self._get_console_info()
        cols = attr['window']['right'] - attr['window']['left'] + 1
        lines = attr['window']['bottom'] - attr['window']['top'] + 1
        return cols, lines
840656
def _valid_dimensions(self, dimensions):
        """"""
        if dimensions is None:
            dimensions = self.kdims
        elif not isinstance(dimensions, list):
            dimensions = [dimensions]

        valid_dimensions = []
        for dim in dimensions:
            if isinstance(dim, Dimension): dim = dim.name
            if dim not in self.kdims:
                raise Exception("Supplied dimensions %s not found." % dim)
            valid_dimensions.append(dim)
        return valid_dimensions
680027
protected function getDimensionsForUnixLike(): ?array
	{
		// Attempt to get dimensions from environment

		if(($width = getenv('COLUMNS')) !== false && ($height = getenv('LINES')) !== false)
		{
			return ['width' => (int) $width, 'height' => (int) $height];
		}

		// Attempt to get dimensions from stty

		exec('stty size', $output, $status);

		if($status === 0 && preg_match('/^([0-9]+) ([0-9]+)$/', current($output), $matches))
		{
			return ['width' => (int) $matches[2], 'height' => (int) $matches[1]];
		}

		// All attempts failed so we'll just return null

		return null;
	}
1367391
def ndims(self):
        """"""
        if self._dims is None:
            return None
        else:
            if self._ndims is None:
                self._ndims = len(self._dims)
            return self._ndims
527583
def _dimensions(self):
        
        return tuple(d for d in self._all_dimensions if d.dimension_type != DT.MR_CAT)