code: def device_action(device):
      
      assert isinstance(device, PhoneDevice)
      number = mask_phone_number(format_phone_number(device.number))
      if device.method == 'sms':
          return ugettext('Send text message to %s') % number
      elif device.method == 'call':
          return ugettext('Call number %s') % number
      raise NotImplementedError('Unknown method: %s' % device.method)
docs: Generates an actionable text for a :class:`~two_factor.models.PhoneDevice`.
  
      Examples:
  
      * Send text message to `+31 * ******58`
      * Call number `+31 * ******58`