code: def _set_name(self):
          
          try:
              self._name = pretty(self.machine_name)
              self._serial = self.serial_number
          except AttributeError:
              self._name = None
              self._serial = None
docs: Set device name.