def _get_job_status(self):
    """Parse condor_q to get number idle, held, etc, jobs"""
    # The autoscaler.py script from Google uses
    # 'condor_q -totals -format "%d " Jobs -format "%d " Idle -format "%d " Held'
    # But in both condor versions I've tried, -totals does not mix well with -format,
    # and the ClassAd attributes ("Jobs", "Idle", "Held") are not available,
    # as listed by:
    #  - condor_q -l
    #  - Appendix "Job ClassAd Attributes" of the condor-manual (online).
    #  Condor version 8.6 (higher than 8.4 used by GCP tutorial)
    #  enables labelling jobs with -batch-name, and thus multiple jobs
    #  can be submitted and run (queried for progress, rm'd, downloaded) simultaneously.
    #  One alternative is to query job status with
    #  condor_q -constraint 'JobStatus == 5',
    #  but I prefer to parse the -totals output instead.

    batch = f"""-constraint 'JobBatchName == "{self.xps_path.name}"'"""
    qsum = self.remote_cmd(f"""condor_q {batch}""").split()
    status = dict(jobs="jobs;", completed="completed,", removed="removed,",
                  idle="idle,", running="running,", held="held,", suspended="suspended")
    # Another way to get total num. of jobs:
    # int(self.remote_cmd(
    #     f"""cd {self.xps_path.name}; ls -1 | grep -o '[0-9]*' | wc -l"""))
    # Another way to parse qsum:
    # int(re.search("""(\d+) idle""",condor_q).group(1))
    return {k: int(qsum[qsum.index(v)-1]) for k, v in status.items()}