Get positions of monitors (see parent class property).
172284
def monitors(self):
        # type: () -> Monitors
        

        if not self._monitors:
            display = MSS.display
            int_ = int
            xrandr = self.xrandr

            # All monitors
            gwa = XWindowAttributes()
            self.xlib.XGetWindowAttributes(display, self.root, ctypes.byref(gwa))
            self._monitors.append(
                {
                    "left": int_(gwa.x),
                    "top": int_(gwa.y),
                    "width": int_(gwa.width),
                    "height": int_(gwa.height),
                }
            )

            # Each monitors
            mon = xrandr.XRRGetScreenResourcesCurrent(display, self.drawable).contents
            crtcs = mon.crtcs
            for idx in range(mon.ncrtc):
                crtc = xrandr.XRRGetCrtcInfo(display, mon, crtcs[idx]).contents
                if crtc.noutput == 0:
                    xrandr.XRRFreeCrtcInfo(crtc)
                    continue

                self._monitors.append(
                    {
                        "left": int_(crtc.x),
                        "top": int_(crtc.y),
                        "width": int_(crtc.width),
                        "height": int_(crtc.height),
                    }
                )
                xrandr.XRRFreeCrtcInfo(crtc)
            xrandr.XRRFreeScreenResources(mon)

        return self._monitors
595343
def monitor(self):
        """"""
        if self._monitor_api is None:
            self._monitor_api = self.get_monitor_api()
        return self._monitor_api
435798
def _find_monitor(monitors, handle):
    """"""

    found_devs = set()
    found_events = set()

    for conn_string, device in monitors.items():
        for event, handles in device.items():
            if handle in handles:
                found_events.add(event)
                found_devs.add(conn_string)

    return found_devs, found_events
125668
public List<ActivityMonitor> getActivityMonitors(RuntimeContext context) {
        return getActivityMonitors().stream().filter(monitor ->
            monitor.isEnabled(context)
        ).collect(Collectors.toList());
    }
1012602
def getMonitors(self, apikey, monitors='none'):
        """"""
        data= 'api_key=' + apikey + '&format=json'
        if monitors != 'none':
            data += '&monitors=' + monitors
        fetchUrl = self.BASE_URL
        fetchUrl += 'getMonitors'
        try:
            monitors = requests.post(fetchUrl,
                headers=self.headers, data=data, timeout=3)
        except:
            return False
        else:
            if monitors:
                return monitors.json()
            else:
                return False
786119
@Override
  public Collection<Monitor<?>> getRegisteredMonitors() {
    if (updatePending.getAndSet(false)) {
      monitorList.set(UnmodifiableList.copyOf(monitors.values()));
    }
    return monitorList.get();
  }
951822
def prev_position(self, pos):
        """"""
        candidate = None
        if pos is not None:
            prevsib = self.prev_sibling_position(pos)  # is None if first
            if prevsib is not None:
                candidate = self.last_decendant(prevsib)
            else:
                parent = self.parent_position(pos)
                if parent is not None:
                    candidate = parent
        return candidate
1058931
def position(self):
        """"""
        position = ffi.new('int[]', 2)
        lib.SDL_GetWindowPosition(self._ptr, position + 0, position + 1)
        return (position[0], position[1])
940816
private int getTotalSlots(
      TaskTrackerStatus status, TaskType type) {
    Map<Integer, Integer> defaultCpuToMaxSlots = (type == TaskType.MAP) ?
        defaultCpuToMaxMapSlots : defaultCpuToMaxReduceSlots;
    int cpus = status.getResourceStatus().getNumProcessors();
    Integer slots = defaultCpuToMaxSlots.get(cpus);
    if (slots == null) {
      slots = (type == TaskType.MAP) ?
          defaultMaxMapSlots : defaultMaxReduceSlots;
    }
    int taskTrackerSlots = (type == TaskType.MAP) ? status.getMaxMapSlots() :
        status.getMaxReduceSlots();
    return Math.min(slots, taskTrackerSlots);
  }
1168679
def bind_parents( index, shared ):
    """"""
    for v in iterindex( index ):
        v['parents'] = shared.get( v['address'], [] )
1105341
private static List<Resource> getAncestors(Resource currentResource, Resource rootResource) {
    List<Resource> results = new ArrayList<Resource>();

    if (currentResource == null || rootResource == null || StringUtils.equals(currentResource.getPath(), rootResource.getPath())) {
      return results;
    }

    Resource parent = currentResource.getParent();
    while (parent != null) {
      results.add(0, parent);
      if (parent.getPath().equals(rootResource.getPath())) {
        break;
      }
      parent = parent.getParent();
    }
    return results;
  }
186252
def watch_slots(self, flag):
        """"""
        lib.EnvSetDefclassWatchSlots(self._env, int(flag), self._cls)
590228
def get_position(stream=STD_OUTPUT_HANDLE):
    '''  '''
    stream = kernel32.GetStdHandle(stream)
    csbi = CONSOLE_SCREEN_BUFFER_INFO()
    kernel32.GetConsoleScreenBufferInfo(stream, byref(csbi))

    pos = csbi.dwCursorPosition
    # zero based, add ones for compatibility.
    return (pos.X + 1, pos.Y + 1)
627257
def positions(self, reverse=False):
        """"""
        def Posgen(reverse):
            if reverse:
                lastrootsib = self.last_sibling_position(self.root)
                current = self.last_decendant(lastrootsib)
                while current is not None:
                    yield current
                    current = self.prev_position(current)
            else:
                current = self.root
                while current is not None:
                    yield current
                    current = self.next_position(current)
        return Posgen(reverse)
133868
def get_screen_pointers(self):
        
        root_iter = lib.xcb_setup_roots_iterator(self._setup)

        screens = [root_iter.data]
        for i in range(self._setup.roots_len - 1):
            lib.xcb_screen_next(ffi.addressof((root_iter)))
            screens.append(root_iter.data)
        return screens
764647
def get_properties(cls):
        """"""
        property_names = [p for p in dir(cls)
                          if isinstance(getattr(cls, p), property)]
        return property_names
542036
def get_available_positions(self):
        
        available_positions = ["new"]
        layout = self.context.getLayout()
        used_positions = [int(slot["position"]) for slot in layout]
        if used_positions:
            used = [
                pos for pos in range(1, max(used_positions) + 1) if
                pos not in used_positions]
            available_positions.extend(used)
        return available_positions