code: def generate_item_instances(cls, items, mediawiki_api_url='https://www.wikidata.org/w/api.php', login=None,
                                  user_agent=config['USER_AGENT_DEFAULT']):
          
          assert type(items) == list
  
          url = mediawiki_api_url
          params = {
              'action': 'wbgetentities',
              'ids': '|'.join(items),
              'format': 'json'
          }
          headers = {
              'User-Agent': user_agent
          }
  
          if login:
              reply = login.get_session().get(url, params=params, headers=headers)
          else:
              reply = requests.get(url, params=params)
  
          item_instances = []
          for qid, v in reply.json()['entities'].items():
              ii = cls(wd_item_id=qid, item_data=v)
              ii.mediawiki_api_url = mediawiki_api_url
              item_instances.append((qid, ii))
  
          return item_instances
docs: A method which allows for retrieval of a list of Wikidata items or properties. The method generates a list of
          tuples where the first value in the tuple is the QID or property ID, whereas the second is the new instance of
          WDItemEngine containing all the data of the item. This is most useful for mass retrieval of WD items.
          :param items: A list of QIDs or property IDs
          :type items: list
          :param mediawiki_api_url: The MediaWiki url which should be used
          :type mediawiki_api_url: str
          :param login: An object of type WDLogin, which holds the credentials/session cookies required for >50 item bulk
              retrieval of items.
          :type login: wdi_login.WDLogin
          :return: A list of tuples, first value in the tuple is the QID or property ID string, second value is the
              instance of WDItemEngine with the corresponding item data.