<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def device_id_to_slug(did):
 """ 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 """


    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)