Get the desktop size.
766732
def _get_desktop_size():
  """"""
  if platform.system() == "Linux":
    try:
      xrandr_query = subprocess.check_output(["xrandr", "--query"])
      sizes = re.findall(r"\bconnected primary (\d+)x(\d+)", str(xrandr_query))
      if sizes[0]:
        return point.Point(int(sizes[0][0]), int(sizes[0][1]))
    except:  # pylint: disable=bare-except
      logging.error("Failed to get the resolution from xrandr.")

  # Most general, but doesn't understand multiple monitors.
  display_info = pygame.display.Info()
  return point.Point(display_info.current_w, display_info.current_h)
579518
def _get_dim_size(start, stop, step):
    """"""
    assert step != 0
    if step > 0:
        assert start < stop
        dim_size = (stop - start - 1) // step + 1
    else:
        assert stop < start
        dim_size = (start - stop - 1) // (-step) + 1
    return dim_size
1322050
def get_memory_size(self):
        """"""
        n = sys.getsizeof(self)
        n += sys.getsizeof(self.padding)
        n += total_size(self.start_addr)
        n += total_size(self._buf)
        n += sys.getsizeof(self._offset)
        return n
193349
private static Point getScreenSize(Context context, Point p) {
        if (p == null) {
            p = new Point();
        }
        WindowManager windowManager = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        Display display = windowManager.getDefaultDisplay();
        display.getSize(p);
        return p;
    }
683840
synchronized Dimension getPreferredSize() {
        return new Dimension(getFontWidth() * virtualTerminal.getTerminalSize().getColumns(),
                getFontHeight() * virtualTerminal.getTerminalSize().getRows());
    }
496359
def get_minimum_size(self, data):
        """"""
        width = 0
        min_height = 0
        for element in self.elements:
            size = element.get_minimum_size(data)
            min_height = max(min_height, size.y)
            width += size.x
        width += (len(self.elements)-1)*self.margin
        return datatypes.Point(width, min_height)
997644
def get_number_of_desktops(self):
        
        ndesktops = ctypes.c_long(0)
        _libxdo.xdo_get_number_of_desktops(self._xdo, ctypes.byref(ndesktops))
        return ndesktops.value
749490
def window_size(self):
        
        value = self.http.get('/window/size').value
        w = roundint(value['width'])
        h = roundint(value['height'])
        return namedtuple('Size', ['width', 'height'])(w, h)
125059
def MediaBoxSize(self):
        """"""
        CheckParent(self)

        val = _fitz.Page_MediaBoxSize(self)

        val = Point(val)
        if not bool(val):
            r = self.rect
            val = Point(r.width, r.height)


        return val
1287461
def get_desktop_env():
    """"""
    desktop = os.environ.get("XDG_CURRENT_DESKTOP")
    if desktop:
        return desktop

    desktop = os.environ.get("DESKTOP_SESSION")
    if desktop:
        return desktop

    desktop = os.environ.get("GNOME_DESKTOP_SESSION_ID")
    if desktop:
        return "GNOME"

    desktop = os.environ.get("MATE_DESKTOP_SESSION_ID")
    if desktop:
        return "MATE"

    desktop = os.environ.get("SWAYSOCK")
    if desktop:
        return "SWAY"

    desktop = os.environ.get("DESKTOP_STARTUP_ID")
    if desktop and "awesome" in desktop:
        return "AWESOME"

    return None
438091
def get_combined_size(tiles):
    """"""
    # TODO: Refactor calculating layout to avoid repetition.
    columns, rows = calc_columns_rows(len(tiles))
    tile_size = tiles[0].image.size
    return (tile_size[0] * columns, tile_size[1] * rows)
592766
def get_size(self, boundary):
        """"""
        if self.filesize is not None:
            valuesize = self.filesize
        else:
            valuesize = len(self.value)

        return len(self.encode_hdr(boundary)) + 2 + valuesize
991846
function getIconSize(props) {
  const { spacing } = props.theme;
  const { icon } = props.style;

  if (icon && icon.width) {
    return icon.width;
  }
  if (props.size) {
    return props.size;
  }

  return spacing.iconSize;
}
454746
def __get_size_and_entry_point(self):
        ""
        process = self.get_process()
        if process:
            try:
                handle = process.get_handle( win32.PROCESS_VM_READ |
                                             win32.PROCESS_QUERY_INFORMATION )
                base   = self.get_base()
                mi     = win32.GetModuleInformation(handle, base)
                self.SizeOfImage = mi.SizeOfImage
                self.EntryPoint  = mi.EntryPoint
            except WindowsError:
                e = sys.exc_info()[1]
                warnings.warn(
                    "Cannot get size and entry point of module %s, reason: %s"\
                    % (self.get_name(), e.strerror), RuntimeWarning)
319520
def size(self):
        """"""
        if self._size and not self._pil_image:
            return self._size
        else:
            return self.pil_image.size
786058
def getsize(path, recurse=False):
    """"""
    if not op.isdir(path):
        return op.getsize(path)
    size = 0
    for r,_,fs in os.walk(path):
        for f in fs:
            size += getsize(op.join(r,f))
        if not recurse:
            break
    return size
1346314
def set_desired_size(self, width, height):
        """"""
        self._desired_size = (width, height)
        if not self._imgwin_set:
            self.set_window_size(width, height)