code: def asn(args):
      
      from jcvi.formats.base import must_open
  
      p = OptionParser(asn.__doc__)
      p.set_outfile()
      opts, args = p.parse_args(args)
  
      if len(args) < 1:
          sys.exit(not p.print_help())
  
      fw = must_open(opts.outfile, "w")
      for asnfile in args:
          fp = open(asnfile)
          ingeneralblock = False
          ingenbankblock = False
          gb, name = None, None
          for row in fp:
              if row.strip() == "":
                  continue
  
              tag = row.split()[0]
  
              if tag == "general":
                  ingeneralblock = True
              if ingeneralblock and tag == "str":
                  if name is None:  # Only allow first assignment
                      name = row.split("\"")[1]
                  ingeneralblock = False
  
              if tag == "genbank":
                  ingenbankblock = True
              if ingenbankblock and tag == "accession":
                  if gb is None:
                      gb = row.split("\"")[1]
                  ingenbankblock = False
  
          assert gb and name
          print("{0}\t{1}".format(gb, name), file=fw)
docs: %prog asn asnfiles
  
      Mainly to get this block, and extract `str` field:
  
          general {
            db "TIGR" ,
            tag
              str "mtg2_12952" } ,
          genbank {
            accession "AC148996" ,