code: def get_images_list(
      category,
      num_images_desired=100,
      categories_pageids_request_limit=100,
      images_pageids_request_limit=50,
  ):
      """
  
      :param category:
      :param num_images_desired: Max number of images desired for return.
      :param categories_pageids_request_limit:
      :param images_pageids_request_limit:
      :return:
      """
      pages_searched = 0
      image_urls = []
  
      pageids, cmcontinue = _get_pageids_for_category(
          category, categories_pageids_request_limit
      )
      logging.debug(
          "Retrieved %d pageids from initial request." % len(pageids)
      )
  
      for chunk in _chunk_page_ids(
          pageids, chunk_size=images_pageids_request_limit
      ):
          pages_searched += len(chunk)
          image_urls.extend(_get_image_urls_for_pageids(chunk))
          logging.debug(
              "Found a total of %d image urls." % len(image_urls)
          )
  
      if len(image_urls) > num_images_desired:
          logging.info(
              "Traversed %d pages and returned the desired count of "
              "%d image urls." % (pages_searched, len(image_urls))
          )
          return image_urls[0:num_images_desired]
  
      while cmcontinue and len(image_urls) < num_images_desired:
          pageids, cmcontinue = _get_pageids_for_category(
              category, categories_pageids_request_limit, cmcontinue
          )
          for chunk in _chunk_page_ids(
              pageids, chunk_size=images_pageids_request_limit
          ):
              pages_searched += len(chunk)
              image_urls.extend(_get_image_urls_for_pageids(chunk))
              if len(image_urls) >= num_images_desired:
                  logging.info(
                      "Traversed %d pages and returned the desired count of "
                      "%d image urls."
                      % (pages_searched, len(image_urls))
                  )
                  return image_urls[0:num_images_desired]
  
      if len(image_urls) < num_images_desired:
          logging.info(
              "Unable to get the desired number of urls. Traversed %d page "
              "ids but only able to return %d URLs"
              % (pages_searched, len(image_urls))
          )
  
      return image_urls
  
file_path: facets/facets_atlasmaker/utils/wikipedia_sourcelist_generator.py
imports: import csv
  import os
  from absl import app
  from absl import flags
  from absl import logging
  import requests
label_desc: Use image node_id 4 for calling a global function with example usage: get_images_list(category, num_images_desired, categories_pageids_request_limit, images_pageids_request_limit) and returns: image_urls, image_urls, image_urls