parameters: (self)
docstring: Calculate threshold and compare with it
          the pre-defined threshold to detect intrusion.
  
          Args:
              None
  
          Raises:
              None
  
          Returns:
              None
docstring_summary: Calculate threshold and compare with it
          the pre-defined threshold to detect intrusion.
docstring_tokens: Calculate threshold and compare with it the pre - defined threshold to detect intrusion .
function: def calc_intrusion(self):
          """
          Calculate threshold and compare with it
          the pre-defined threshold to detect intrusion.
  
          Args:
              None
  
          Raises:
              None
  
          Returns:
              None
          """
          if self.rts_start_time is not None:
              current_time = time.time()
              delta_time = int(current_time - self.rts_start_time)
  
              try:
                  calc_threshold = int(self.rts_count / delta_time)
              except ZeroDivisionError:
                  calc_threshold = int(self.rts_count)
  
              if calc_threshold > self._THRESHOLD:
                  self.logger.log(
                      "Possible hidden node attack detection detected.",
                      logtype="warning"
                  )
  
          if self.cts_start_time is not None:
              current_time = time.time()
              delta_time = int(current_time - self.cts_start_time)
  
              try:
                  calc_threshold = int(self.cts_count / delta_time)
              except ZeroDivisionError:
                  calc_threshold = int(self.cts_count)
  
              if calc_threshold > self._THRESHOLD:
                  self.logger.log(
                      "Possible hidden node attack detection detected.",
                      logtype="warning"
                  )
function_tokens: def calc_intrusion ( self ) : if self . rts_start_time is not None : current_time = time . time ( ) delta_time = int ( current_time - self . rts_start_time ) try : calc_threshold = int ( self . rts_count / delta_time ) except ZeroDivisionError : calc_threshold = int ( self . rts_count ) if calc_threshold > self . _THRESHOLD : self . logger . log ( "Possible hidden node attack detection detected." , logtype = "warning" ) if self . cts_start_time is not None : current_time = time . time ( ) delta_time = int ( current_time - self . cts_start_time ) try : calc_threshold = int ( self . cts_count / delta_time ) except ZeroDivisionError : calc_threshold = int ( self . cts_count ) if calc_threshold > self . _THRESHOLD : self . logger . log ( "Possible hidden node attack detection detected." , logtype = "warning" )