code: def lang_to_langcode(lang):
      if lang in lang2lcode:
          lcode = lang2lcode[lang]
      elif lang.lower() in langlower2lcode:
          lcode = langlower2lcode[lang.lower()]
      elif lang in lcode2lang:
          lcode = lang
      elif lang.lower() in lcode2lang:
          lcode = lang.lower()
      else:
          raise ValueError("Unable to find language code for %s" % lang)
      return lcode
  
imports: import re
label_desc: Use image node_id 3 for calling a global function with example usage: lang_to_langcode(lang) and returns: lcode