Extract all monitors across class hierarchy.
436546
static void addMonitors(List<Monitor<?>> monitors, String id, TagList tags, Object obj) {
    addMonitorFields(monitors, id, tags, obj);
    addAnnotatedFields(monitors, id, tags, obj);
  }
27902
def get_inheritors(cls):
    """"""
    subclasses = set()
    work = [cls]
    while work:
        parent = work.pop()
        for child in parent.__subclasses__():
            if child not in subclasses:
                subclasses.add(child)
                work.append(child)
    return subclasses
892982
def inspect
      c = []
      children.each do |w|
        c << w.inspect
      end
      s = super + " #{self.class}=<window_class:#{window_class} pid:#{pid} thread_id:#{thread_id} title:\"#{title}\" children=<" + c.join("\n") + ">>"
    end
100897
def _get_parent_classes_transparent(cls, slot, page, instance=None):
        
        parent_classes = super(CascadePluginBase, cls).get_parent_classes(slot, page, instance)
        if parent_classes is None:
            if cls.get_require_parent(slot, page) is False:
                return
            parent_classes = []

        # add all plugins marked as 'transparent', since they all are potential parents
        parent_classes = set(parent_classes)
        parent_classes.update(TransparentContainer.get_plugins())
        return list(parent_classes)
283835
static ClassInfoList getAllImplementedInterfaceClasses(final Collection<ClassInfo> classes,
            final ScanSpec scanSpec) {
        return new ClassInfoList(ClassInfo.filterClassInfo(classes, scanSpec, /* strictWhitelist = */ true,
                ClassType.IMPLEMENTED_INTERFACE), /* sortByName = */ true);
    }
927247
def all_subclasses(cls):
    """"""
    for subcls in cls.__subclasses__():
        yield subcls
        for subsubcls in all_subclasses(subcls):
            yield subsubcls
767458
def _getMonitorInfo(self):
        
        monitors = []
        CCHDEVICENAME = 32
        def _MonitorEnumProcCallback(hMonitor, hdcMonitor, lprcMonitor, dwData):
            class MONITORINFOEX(ctypes.Structure):
                _fields_ = [("cbSize", ctypes.wintypes.DWORD),
                            ("rcMonitor", ctypes.wintypes.RECT),
                            ("rcWork", ctypes.wintypes.RECT),
                            ("dwFlags", ctypes.wintypes.DWORD),
                            ("szDevice", ctypes.wintypes.WCHAR*CCHDEVICENAME)]
            lpmi = MONITORINFOEX()
            lpmi.cbSize = ctypes.sizeof(MONITORINFOEX)
            self._user32.GetMonitorInfoW(hMonitor, ctypes.byref(lpmi))
            #hdc = self._gdi32.CreateDCA(ctypes.c_char_p(lpmi.szDevice), 0, 0, 0)
            monitors.append({
                "hmon": hMonitor,
                #"hdc":  hdc,
                "rect": (lprcMonitor.contents.left,
                         lprcMonitor.contents.top,
                         lprcMonitor.contents.right,
                         lprcMonitor.contents.bottom),
                "name": lpmi.szDevice
                })
            return True
        MonitorEnumProc = ctypes.WINFUNCTYPE(
            ctypes.c_bool,
            ctypes.c_ulong,
            ctypes.c_ulong,
            ctypes.POINTER(ctypes.wintypes.RECT),
            ctypes.c_int)
        callback = MonitorEnumProc(_MonitorEnumProcCallback)
        if self._user32.EnumDisplayMonitors(0, 0, callback, 0) == 0:
            raise WindowsError("Unable to enumerate monitors")
        # Clever magic to make the screen with origin of (0,0) [the primary monitor]
        # the first in the list
        # Sort by device ID - 0 is primary, 1 is next, etc.
        monitors.sort(key=lambda x: (not (x["rect"][0] == 0 and x["rect"][1] == 0), x["name"]))

        return monitors
1351519
public Collection<Monitor> list(List<String> queryParams)
    {
        return HTTP.GET("/v3/monitors", null, queryParams, MONITORS).get();
    }
3967
public List<AdapterMonitor> getAdapterMonitors(RuntimeContext context) {
        return getAdapterMonitors().stream().filter(monitor ->
            monitor.isEnabled(context)
        ).collect(Collectors.toList());
    }
842149
def detach_all_classes(self):
        
        classes = list(self._observers.keys())
        for cls in classes:
            self.detach_class(cls)
592416
public static final Index indexAllClasses(final List<File> classFiles) {
        final Indexer indexer = new Indexer();
        indexAllClasses(indexer, classFiles);
        return indexer.complete();
    }
129137
def all(cls, include_deactivated=False):
        
        if include_deactivated:
            resources = yield cls.view.get(include_docs=True)
        else:
            resources = yield cls.active_view.get(include_docs=True)

        result = []

        for resource in resources['rows']:
            parent = cls.parent_resource(**resource['doc'])
            result.append(cls(parent=parent, **resource['value']))

        raise Return(result)
676108
def get_reader_classes(parent=Reader):
    """"""
    children = parent.__subclasses__()
    descendants = children[:]
    for child in children:
        grandchildren = get_reader_classes(child)
        if grandchildren:
            descendants.remove(child)
            descendants.extend(grandchildren)
    return descendants
502705
static void addMonitorFields(
      List<Monitor<?>> monitors, String id, TagList tags, Object obj) {
    try {
      final SortedTagList.Builder builder = SortedTagList.builder();
      builder.withTag("class", className(obj.getClass()));
      if (tags != null) {
        builder.withTags(tags);
      }
      if (id != null) {
        builder.withTag("id", id);
      }
      final TagList classTags = builder.build();

      final Set<Field> fields = Reflection.getAllFields(obj.getClass());
      for (Field field : fields) {
        if (isMonitorType(field.getType())) {
          field.setAccessible(true);
          final Monitor<?> m = (Monitor<?>) field.get(obj);
          if (m == null) {
            throw new NullPointerException("field " + field.getName()
                + " in class " + field.getDeclaringClass().getName()
                + " is null, all monitor fields must be"
                + " initialized before registering");
          }
          monitors.add(wrap(classTags, m));
        }
      }
    } catch (Exception e) {
      throw Throwables.propagate(e);
    }
  }
944439
def get_check_threads(self):
        """"""
        for t in self.threads:
            name = t.getName()
            if name.startswith("CheckThread-"):
                yield name
644942
def find_window_classes() -> List[str]:
    
    return [
        path.parts[-1] for path in Path(__file__).parent.iterdir()
        if path.is_dir() and not path.parts[-1].startswith('__')
    ]
836591
def get_lookups(cls):
        """"""
        class_lookups = [parent.__dict__.get('class_lookups', {}) for parent in inspect.getmro(cls)]
        return cls.merge_dicts(class_lookups)