code: def create_uinput_device(mapping):
      
      if mapping not in _mappings:
          raise DeviceError("Unknown device mapping: {0}".format(mapping))
  
      try:
          mapping = _mappings[mapping]
          device = UInputDevice(mapping)
      except UInputError as err:
          raise DeviceError(err)
  
      return device
docs: Creates a uinput device.