code: def _handle_key(key):
      """Handle key codes"""
      code = int(key[key.index("k") + 1 :])
      value = chr(code)
      # letter keys
      if code >= 65 and code <= 90:
          if "shift+" in key:
              key = key.replace("shift+", "")
          else:
              value = value.lower()
      # number keys
      elif code >= 48 and code <= 57:
          if "shift+" in key:
              value = ")!@#$%^&*("[int(value)]
              key = key.replace("shift+", "")
      # function keys
      elif code >= 112 and code <= 123:
          value = "f%s" % (code - 111)
      # number pad keys
      elif code >= 96 and code <= 105:
          value = "%s" % (code - 96)
      # keys with shift alternatives
      elif code in _SHIFT_LUT and "shift+" in key:
          key = key.replace("shift+", "")
          value = _SHIFT_LUT[code]
      elif code in _LUT:
          value = _LUT[code]
      key = key[: key.index("k")] + value
      return key
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import datetime
  import io
  import json
  import os
  import warnings
  import numpy
  import tornado
  from matplotlib.backends import backend_agg
  from matplotlib.backend_bases import _Backend
  from matplotlib import backend_bases
  from matplotlib import _png
label_desc: Use image node_id 1 for calling a global function with example usage: _handle_key(key) and returns: key