code: def _bedpes_from_cnv_caller(data, work_dir):
      
      supported = set(["cnvkit"])
      cns_file = None
      for sv in data.get("sv", []):
          if sv["variantcaller"] in supported and "cns" in sv and "lumpy_usecnv" in dd.get_tools_on(data):
              cns_file = sv["cns"]
              break
      if not cns_file:
          return None, None
      else:
          out_base = os.path.join(work_dir, utils.splitext_plus(os.path.basename(cns_file))[0])
          out_dels = out_base + "-dels.bedpe"
          out_dups = out_base + "-dups.bedpe"
          if not os.path.exists(out_dels) or not os.path.exists(out_dups):
              with file_transaction(data, out_dels, out_dups) as (tx_out_dels, tx_out_dups):
                  try:
                      cnvanator_path = config_utils.get_program("cnvanator_to_bedpes.py", data)
                  except config_utils.CmdNotFound:
                      return None, None
                  cmd = [cnvanator_path, "-c", cns_file, "--cnvkit",
                          "--del_o=%s" % tx_out_dels, "--dup_o=%s" % tx_out_dups,
                          "-b", "250"]  # XXX Uses default piece size for CNVkit. Right approach?
                  do.run(cmd, "Prepare CNVkit as input for lumpy", data)
          return out_dels, out_dups
docs: Retrieve BEDPEs deletion and duplications from CNV callers.
  
      Currently integrates with CNVkit.