code: def _get_batch_representative(items, key):
      
      if isinstance(items, dict):
          return items, items
      else:
          vals = set([])
          out = []
          for data in items:
              if key in data:
                  vals.add(data[key])
                  out.append(data)
          if len(vals) != 1:
              raise ValueError("Incorrect values for %s: %s" % (key, list(vals)))
          return out[0], items
docs: Retrieve a representative data item from a batch.
  
      Handles standard bcbio cases (a single data item) and CWL cases with
      batches that have a consistent variant file.