@register.filter<EOL>def device_action(device):
assert isinstance(device, PhoneDevice)<EOL>number = mask_phone_number(format_phone_number(device.number))<EOL>if device.method == '<STR_LIT>':<EOL><INDENT>return ugettext('<STR_LIT>') % number<EOL><DEDENT>elif device.method == '<STR_LIT>':<EOL><INDENT>return ugettext('<STR_LIT>') % number<EOL><DEDENT>raise NotImplementedError('<STR_LIT>' % device.method)<EOL>
Generates an actionable text for a :class:`~two_factor.models.PhoneDevice`.

Examples:

* Send text message to `+31 * ******58`
* Call number `+31 * ******58`