code: def remove_ending(word):
      length = len(word)
      el = 11
      while el > 0:
          if length - el > 1:
              ending = word[length - el :]
              cond = m[el].get(ending)
              if cond:
                  base = word[: length - el]
                  if cond(base):
                      return base
          el -= 1
      return word
  
imports: from collections import defaultdict
label_desc: Use image node_id 30 for calling a global function with example usage: remove_ending(word) and returns: word, base