code: def device(value):
      
  
      browser = None
      for regex, name in BROWSERS:
          if regex.search(value):
              browser = name
              break
  
      device = None
      for regex, name in DEVICES:
          if regex.search(value):
              device = name
              break
  
      if browser and device:
          return _('%(browser)s on %(device)s') % {
              'browser': browser,
              'device': device
          }
  
      if browser:
          return browser
  
      if device:
          return device
  
      return None
docs: Transform a User Agent into human readable text.
  
      Example output:
  
      * Safari on iPhone
      * Chrome on Windows 8.1
      * Safari on OS X
      * Firefox
      * Linux
      * None