code: def reset(self):
          
          print '%s call reset' % self.port
          try:
              if self._is_net:
                  self.__sendCommand(WPANCTL_CMD + 'leave')
              else:
                  self._sendline(WPANCTL_CMD + 'leave')
  
              self.__sendCommand(WPANCTL_CMD + 'dataset erase')
              time.sleep(2)
              if not self._is_net:
                  self._read()
          except Exception, e:
              ModuleHelper.WriteIntoDebugLogger('reset() Error: ' + str(e))
docs: factory reset