parameters: (n)
docstring: Return n random bytes.
docstring_summary: Return n random bytes.
docstring_tokens: Return n random bytes .
function: def randombytes(n):
      """Return n random bytes."""
      # Use /dev/urandom if it is available.  Fall back to random module
      # if not.  It might be worthwhile to extend this function to use
      # other platform-specific mechanisms for getting random bytes.
      if os.path.exists("/dev/urandom"):
          f = open("/dev/urandom")
          s = f.read(n)
          f.close()
          return s
      else:
          L = [chr(random.randrange(0, 256)) for i in range(n)]
          return "".join(L)
function_tokens: def randombytes ( n ) : # Use /dev/urandom if it is available.  Fall back to random module # if not.  It might be worthwhile to extend this function to use # other platform-specific mechanisms for getting random bytes. if os . path . exists ( "/dev/urandom" ) : f = open ( "/dev/urandom" ) s = f . read ( n ) f . close ( ) return s else : L = [ chr ( random . randrange ( 0 , 256 ) ) for i in range ( n ) ] return "" . join ( L )