code: def get_onsets(text, vowels="aeiou", threshold=0.0002):
      """
      Source: Resonances in Middle High German: New Methodologies in Prosody,
      2017, C. L. Hench
  
      :param text: str list: text to be analysed
      :param vowels: str: valid vowels constituting the syllable
      :param threshold: minimum frequency count for valid onset, C. Hench noted that the algorithm produces the best result for an untagged wordset of MHG, when retaining onsets which appear in at least 0.02% of the words
  
      Let's test it on the opening lines of Nibelungenlied
  
      >>> text = ['uns', 'ist', 'in', 'alten', 'mæren', 'wunders', 'vil', 'geseit', 'von', 'helden', 'lobebæren', 'von', 'grôzer', 'arebeit', 'von', 'fröuden', 'hôchgezîten', 'von', 'weinen', 'und', 'von', 'klagen', 'von', 'küener', 'recken', 'strîten', 'muget', 'ir', 'nu', 'wunder', 'hœren', 'sagen']
      >>> vowels = "aeiouæœôîöü"
      >>> get_onsets(text, vowels=vowels)
      ['lt', 'm', 'r', 'w', 'nd', 'v', 'g', 's', 'h', 'ld', 'l', 'b', 'gr', 'z', 'fr', 'd', 'chg', 't', 'n', 'kl', 'k', 'ck', 'str']
  
      Of course, this is an insignificant sample, but we could try and see
      how modifying the threshold affects the returned onset:
  
      >>> get_onsets(text, threshold = 0.05, vowels=vowels)
      ['m', 'r', 'w', 'nd', 'v', 'g', 's', 'h', 'b', 'z', 't', 'n']
  
      """
      onset_dict = defaultdict(lambda: 0)
      n = len(text)
  
      for word in text:
          onset = ""
          candidates = []
  
          for phoneme in word:
              if phoneme not in vowels:
                  onset += phoneme
  
              else:
                  if onset != "":
                      candidates.append(onset)
                      onset = ""
  
          for c in candidates:
              onset_dict[c] += 1
  
      return [
          onset for onset, i in onset_dict.items() if i / n > threshold
      ]
  
imports: import logging
  import unicodedata
  from collections import defaultdict
  from typing import List, Union
  import cltk.phonology.ang.syllabifier
  import cltk.phonology.enm.syllabifier
  import cltk.phonology.gmh.syllabifier
  import cltk.phonology.non.syllabifier
  import cltk.phonology.non.utils
  from cltk.core.exceptions import CLTKException
label_desc: Use image node_id 1 for calling a global function with example usage: get_onsets(text, vowels, threshold) and returns: unknown