code: def _pick_keywords(db):
      
      for key, val in tqdm(db.iteritems(), total=len(db)):
          # skip counter of the last downloaded document
          if key == "last_id":
              continue
  
          # this is optimization to speed up skipping of the unwanted elements
          # by the factor of ~20
          piece = val[:500] if len(val) > 500 else val
          if '<fixfield id="001">ph' not in piece.lower():
              continue
  
          parsed = MARCXMLRecord(val)
  
          code = parsed.get("001")
          if not code:
              continue
  
          # record was disabled
          if parsed["682i"]:
              continue
  
          if code.lower().startswith("ph"):
              yield KeywordInfo.from_marc(
                  sysno=int(key.split("_")[-1]),  # item_xxx -> int(xxx)
                  marc=parsed,
              )
docs: Go thru downloaded data stored in `db` and filter keywords, which are
      parsed and then yielded.
  
      Shows nice progress bar.
  
      Args:
          db (obj): Opened database connection.
  
      Yields:
          obj: :class:`KeywordInfo` instances for yeach keyword.