def METHOD_NAME(self, gid, first_only=False):
    """Retrieves jobs using GID. Set first_only=True to only retrieve first job."""
    uids = self.rds.get(gid)
    if uids:
        uids = uids.decode().split(",")
        if first_only:
            jobs = [json.loads(self.rds.get(uids[0]).decode())]
        else:
            jobs = [json.loads(self.rds.get(uid).decode()) for uid in uids]
    else:
        jobs = []
    return jobs