code: def addDuplicateAnalyses(self, src_slot, dest_slot=None):
          
          # Duplicate analyses can only be added if the state of the ws is open
          # unless we are adding a retest
          if api.get_workflow_status_of(self) != "open":
              return []
  
          slot_from = to_int(src_slot, 0)
          if slot_from < 1:
              return []
  
          slot_to = to_int(dest_slot, 0)
          if slot_to < 0:
              return []
  
          if not slot_to:
              # Find the suitable slot to add these duplicates
              slot_to = self.get_suitable_slot_for_duplicate(slot_from)
              return self.addDuplicateAnalyses(src_slot, slot_to)
  
          processed = map(lambda an: api.get_uid(an.getAnalysis()),
                          self.get_analyses_at(slot_to))
          src_analyses = list()
          for analysis in self.get_analyses_at(slot_from):
              if api.get_uid(analysis) in processed:
                  if api.get_workflow_status_of(analysis) != "retracted":
                      continue
              src_analyses.append(analysis)
          ref_gid = None
          duplicates = list()
          for analysis in src_analyses:
              duplicate = self.add_duplicate_analysis(analysis, slot_to, ref_gid)
              if not duplicate:
                  continue
              # All duplicates from the same slot must have the same group id
              ref_gid = ref_gid or duplicate.getReferenceAnalysesGroupID()
              duplicates.append(duplicate)
          return duplicates
docs: Creates and add duplicate analyes from the src_slot to the dest_slot
          If no destination slot is defined, the most suitable slot will be used,
          typically a new slot at the end of the worksheet will be added.
          :param src_slot: slot that contains the analyses to duplicate
          :param dest_slot: slot where the duplicate analyses must be stored
          :return: the list of duplicate analyses added