parameters: (self)
docstring: Tries to build the device's name based on its type and protocol name but falls back on a default name if that doesn't work.
docstring_summary: Tries to build the device's name based on its type and protocol name but falls back on a default name if that doesn't work.
docstring_tokens: Tries to build the device s name based on its type and protocol name but falls back on a default name if that doesn t work .
function: def _set_name(self):
          """Tries to build the device's name based on its type and protocol name but falls back on a default name if that doesn't work."""
  
          try:
              name = ('%s serial %s' % (self._protocol.name, self.device_type)).title()
          except Exception:
              name = 'Unknown Serial Device'
          self.device_name = name
function_tokens: def _set_name ( self ) : try : name = ( '%s serial %s' % ( self . _protocol . name , self . device_type ) ) . title ( ) except Exception : name = 'Unknown Serial Device' self . device_name = name