code: def stem(noun: str, gender: str, mimation: bool = True) -> str:
      """
      Return the stem of a noun, given a declined form and its gender
  
      >>> stem("šarrū", 'm')
      'šarr'
      """
  
      stem = ""
  
      if mimation and noun[-1:] == "m":
          # noun = noun[:-1]
          # TODO what should we do here?
          pass
  
      # Take off ending
      if gender == "m":
          if noun[-2:] in list(
              ENDINGS["m"]["singular"].values()
          ) + list(ENDINGS["m"]["dual"].values()):
              stem = noun[:-2]
          elif noun[-1] in list(ENDINGS["m"]["plural"].values()):
              stem = noun[:-1]
          else:
              # we don't recognize the ending, so return the noun.
              stem = noun
      elif gender == "f":
          if (
              noun[-4:]
              in ENDINGS["f"]["plural"]["nominative"]
              + ENDINGS["f"]["plural"]["oblique"]
          ):
              stem = noun[:-4] + "t"
          elif noun[-3:] in list(
              ENDINGS["f"]["singular"].values()
          ) + list(ENDINGS["f"]["dual"].values()):
              stem = noun[:-3] + "t"
          elif noun[-2:] in list(
              ENDINGS["m"]["singular"].values()
          ) + list(ENDINGS["m"]["dual"].values()):
              stem = noun[:-2]
          else:
              # we don't recognize the ending, so return the noun.
              stem = noun
      else:
          stem = noun
      return stem
  
label_desc: Use image node_id 1 for calling a global function with example usage: stem(noun, gender, mimation) and returns: stem