def get_builds(self, offset: int=None, limit: int=None) -> List['Build']: """ Returns a list of all builds. :param offset: The starting index of the requested build :param limit: The number of builds requested """ num_builds = BuildStore.size() start, end = get_paginated_indices(offset, limit, num_builds) return BuildStore.get_range(start, end)
def get_atoms(self, offset: int=None, limit: int=None) -> List['Atom']: """ Returns a list of atoms for this subjob :param offset: The starting index of the requested build :param limit: The number of builds requested :rtype: list[app.master.atom.Atom] """ num_atoms = len(self._atoms) start, end = get_paginated_indices(offset, limit, num_atoms) return self._atoms[start:end]
def get_atoms(self, offset: int = None, limit: int = None) -> List['Atom']: """ Returns a list of atoms for this subjob :param offset: The starting index of the requested build :param limit: The number of builds requested :rtype: list[app.master.atom.Atom] """ num_atoms = len(self._atoms) start, end = get_paginated_indices(offset, limit, num_atoms) return self._atoms[start:end]
def get_subjobs(self, offset: int=None, limit: int=None) -> List['Subjob']: """ Returns a list of subjobs for this build :param offset: The starting index of the requested build :param limit: The number of builds requested """ num_subjobs = len(self._all_subjobs_by_id) start, end = get_paginated_indices(offset, limit, num_subjobs) requested_subjobs = islice(self._all_subjobs_by_id, start, end) return [self._all_subjobs_by_id[key] for key in requested_subjobs]