code: def normalize_middle_english(
      text: str,
      to_lower: bool = True,
      alpha_conv: bool = True,
      punct: bool = True,
  ) -> str:
      """Normalizes Middle English text string and returns normalized string.
  
      :param text: str text to be normalized
      :param to_lower: bool convert text to lower text
      :param alpha_conv: bool convert text to canonical form æ -> ae, þ -> th, ð -> th, ȝ -> y if at beginning,
       gh otherwise
      :param punct: remove punctuation
  
      >>> normalize_middle_english('Whan Phebus in the CraBbe had neRe hys cours ronne', to_lower = True)
      'whan phebus in the crabbe had nere hys cours ronne'
      >>> normalize_middle_english('I pray ȝow þat ȝe woll', alpha_conv = True)
      'i pray yow that ye woll'
      >>> normalize_middle_english("furst, to begynne:...", punct = True)
      'furst to begynne'
      """
  
      if to_lower:
          text = text.lower()
      if alpha_conv:
          text = (
              text.replace("æ", "ae")
              .replace("þ", "th")
              .replace("ð", "th")
          )
          text = re.sub(r"(?<!\w)(?=\w)ȝ", "y", text)
          text = text.replace("ȝ", "gh")
      if punct:
          text = re.sub(r"[\.\";\,\:\[\]\(\)!&?‘]", "", text)
      return text
  
label_desc: Use image node_id 1 for calling a global function with example usage: normalize_middle_english(text, to_lower, alpha_conv, punct) and returns: text