code: def device_id_to_slug(did):
      
  
      try:
          device_slug = IOTileDeviceSlug(did, allow_64bits=False)
      except ValueError:
          raise ArgumentError("Unable to recognize {} as a device id".format(did))
  
      return str(device_slug)
docs: Converts a device id into a correct device slug.
  
      Args:
          did (long) : A device id
          did (string) : A device slug in the form of XXXX, XXXX-XXXX-XXXX, d--XXXX, d--XXXX-XXXX-XXXX-XXXX
      Returns:
          str: The device slug in the d--XXXX-XXXX-XXXX-XXXX format
      Raises:
          ArgumentError: if the ID is not in the [1, 16**12] range, or if not a valid string