def is_valid_device_id(device_id):
valid = valid_device_id.match(device_id)<EOL>if not valid:<EOL><INDENT>logging.error("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>", device_id)<EOL><DEDENT>return valid<EOL>
Check if device identifier is valid.

    A valid device identifier contains only ascii word characters or dashes.

    :param device_id: Device identifier
    :returns: Valid or not.