original_docstring: 
          Returns the delay (in seconds) or none on timeout.
          
docstring: Returns the delay (in seconds) or none on timeout.
docstring_tokens: Returns the delay ( in seconds ) or none on timeout .
code: def ping_once(self):
          """
          Returns the delay (in seconds) or none on timeout.
          """
          icmp = socket.getprotobyname("icmp")
          try:
              sock = socket.socket(socket.AF_INET, socket.SOCK_RAW, icmp)
          except socket.error as e:
              if e.errno == 1:
                  # Not superuser, so operation not permitted
                  e.msg +=  "ICMP messages can only be sent from root user processes"
                  raise socket.error(e.msg)
          except Exception as e:
              print ("Exception: %s" %(e))
      
          my_ID = os.getpid() & 0xFFFF
       
          self.send_ping(sock, my_ID)
          delay = self.receive_pong(sock, my_ID, self.timeout)
          sock.close()
          return delay
code_tokens: def ping_once ( self ) : icmp = socket . getprotobyname ( "icmp" ) try : sock = socket . socket ( socket . AF_INET , socket . SOCK_RAW , icmp ) except socket . error as e : if e . errno == 1 : e . msg += "ICMP messages can only be sent from root user processes" raise socket . error ( e . msg ) except Exception as e : print ( "Exception: %s" % ( e ) ) my_ID = os . getpid ( ) & 0xFFFF self . send_ping ( sock , my_ID ) delay = self . receive_pong ( sock , my_ID , self . timeout ) sock . close ( ) return delay
short_docstring: Returns the delay (in seconds) or none on timeout.
short_docstring_tokens: Returns the delay ( in seconds ) or none on timeout .
comment: """
          Returns the delay (in seconds) or none on timeout.
          """$SEP$# Not superuser, so operation not permitted