code: def serialize_job_ids(self, job_ids):
          
          if len(job_ids) == 0 or self.use_large_ids:
              return job_ids
          elif isinstance(job_ids[0], ObjectId):
              return [x.binary for x in job_ids]
          else:
              return [bytes.fromhex(str(x)) for x in job_ids]
docs: Returns job_ids serialized for storage in Redis