code: def mask_gendered_words(text, gendered_list, mask_token=MASK_TOKEN):
      """
      Given a string of text, mask out gendered words from a list.
      """
      text = format_text(text, lower=False)
      to_ret = []
      orig_text = text.split(" ")
      lowered_text = text.lower().split(" ")
      for word, word_lower in zip(orig_text, lowered_text):
          if word_lower in gendered_list:
              to_ret.append(mask_token)
          else:
              to_ret.append(word)
  
      return unformat_text(" ".join(to_ret))
  
file_path: ParlAI/parlai/tasks/md_gender/utils.py
imports: import os
  import random
  from collections import defaultdict
  from parlai.tasks.md_gender.build import build
label_desc: Use image node_id 8 for calling a global function with example usage: mask_gendered_words(text, gendered_list, mask_token) and returns: unformat_text