code: def device_slug_to_id(slug):
      
  
      if not isinstance(slug, str):
          raise ArgumentError("Invalid device slug that is not a string", slug=slug)
  
      try:
          device_slug = IOTileDeviceSlug(slug, allow_64bits=False)
      except ValueError:
          raise ArgumentError("Unable to recognize {} as a device id".format(slug))
  
      return device_slug.get_id()
docs: Convert a d-- device slug to an integer.
  
      Args:
          slug (str): A slug in the format d--XXXX-XXXX-XXXX-XXXX
  
      Returns:
          int: The device id as an integer
  
      Raises:
          ArgumentError: if there is a malformed slug