code: def query_revisions_by_revids(session, revids, **params):
      
      doc = session.get(action='query', prop='revisions',
                        revids=revids, **params)
  
      for page_doc in doc['query'].get('pages', {}).values():
          revisions = page_doc.get('revisions', [])
          if 'revisions' in page_doc:
              del page_doc['revisions']
  
          for revision_doc in revisions:
              revision_doc['page'] = page_doc
              yield revision_doc
docs: Gets a set of revisions by their IDs by repeatedly querying in batches.
      If an ID cannot be found, it is ignored.