code: def pairs(args):
      
      p = OptionParser(pairs.__doc__)
      p.set_pairs()
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      bedfile, = args
  
      basename = bedfile.split(".")[0]
      insertsfile = ".".join((basename, "inserts"))
      bedfile = sort([bedfile, "--accn"])
  
      fp = open(bedfile)
      data = [BedLine(row) for i, row in enumerate(fp) if i < opts.nrows]
  
      ascii = not opts.pdf
      return bedfile, report_pairs(data, opts.cutoff, opts.mateorientation,
             pairsfile=opts.pairsfile, insertsfile=insertsfile,
             rclip=opts.rclip, ascii=ascii, bins=opts.bins,
             distmode=opts.distmode)
docs: See __doc__ for OptionParser.set_pairs().