code: def batch_entrez(list_of_terms, db="nuccore", retmax=1, rettype="fasta",
                   batchsize=1, email=myEmail):
      
  
      for term in list_of_terms:
  
          logging.debug("Search term %s" % term)
          success = False
          ids = None
          if not term:
              continue
  
          while not success:
              try:
                  search_handle = Entrez.esearch(db=db, retmax=retmax, term=term)
                  rec = Entrez.read(search_handle)
                  success = True
                  ids = rec["IdList"]
              except (HTTPError, URLError,
                      RuntimeError, KeyError) as e:
                  logging.error(e)
                  logging.debug("wait 5 seconds to reconnect...")
                  time.sleep(5)
  
          if not ids:
              logging.error("term {0} not found".format(term))
              continue
  
          assert ids
          nids = len(ids)
          if nids > 1:
              logging.debug("A total of {0} results found.".format(nids))
  
          if batchsize != 1:
              logging.debug("Use a batch size of {0}.".format(batchsize))
  
          ids = list(grouper(ids, batchsize))
  
          for id in ids:
              id = [x for x in id if x]
              size = len(id)
              id = ",".join(id)
  
              success = False
              while not success:
                  try:
                      fetch_handle = Entrez.efetch(db=db, id=id, rettype=rettype,
                                                   email=email)
                      success = True
                  except (HTTPError, URLError,
                          RuntimeError) as e:
                      logging.error(e)
                      logging.debug("wait 5 seconds to reconnect...")
                      time.sleep(5)
  
              yield id, size, term, fetch_handle
docs: Retrieve multiple rather than a single record