code: def get_category_members_from_lang_links(lang_links, lang, cat_name):
      """
      Args:
          lang_links (Dict[str, :class:`wikipediaapi.WikipediaPage`])
          lang (str)
          cat_name (str)
  
      Returns:
          List[str]
      """
      # import wikipediaapi
  
      try:
          cat_page = lang_links[lang]
      except KeyError:
          logging.warning(
              "no %s pages available for %s", cat_name, lang
          )
          return []
      cat_members = list(
          {
              title
              for title, page in cat_page.categorymembers.items()
              # if page.ns == 0  # wikipediaapi.Namespace.MAIN
          }
      )
      random.shuffle(cat_members)
      logging.info("fetched %s %s titles", len(cat_members), cat_name)
      return cat_members
  
file_path: textacy/scripts/fetch_wiki_lang_snippets.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import datetime
  import io
  import logging
  import os
  import random
  import re
  import sys
  import time
  import warnings
  import wikipedia
  from cld2 import detect
  from tqdm import tqdm
label_desc: Use image node_id 4 for calling a global function with example usage: get_category_members_from_lang_links(lang_links, lang, cat_name) and returns: cat_members, list