parameters: (self, n, _log=_log, int=int, _maxwidth=1L<<BPF,
                     _Method=_MethodType, _BuiltinMethod=_BuiltinMethodType)
return_statement: return int(self.random() * n)
docstring: Return a random int in the range [0,n)
  
          Handles the case where n has more bits than returned
          by a single call to the underlying generator.
docstring_summary: Return a random int in the range [0,n)
docstring_tokens: Return a random int in the range [ 0 n )
function: def _randbelow(self, n, _log=_log, int=int, _maxwidth=1L<<BPF,
                     _Method=_MethodType, _BuiltinMethod=_BuiltinMethodType):
          """Return a random int in the range [0,n)
  
          Handles the case where n has more bits than returned
          by a single call to the underlying generator.
          """
  
          try:
              getrandbits = self.getrandbits
          except AttributeError:
              pass
          else:
              # Only call self.getrandbits if the original random() builtin method
              # has not been overridden or if a new getrandbits() was supplied.
              # This assures that the two methods correspond.
              if type(self.random) is _BuiltinMethod or type(getrandbits) is _Method:
                  k = int(1.00001 + _log(n-1, 2.0))   # 2**k > n-1 > 2**(k-2)
                  r = getrandbits(k)
                  while r >= n:
                      r = getrandbits(k)
                  return r
          if n >= _maxwidth:
              _warn("Underlying random() generator does not supply \n"
                  "enough bits to choose from a population range this large")
          return int(self.random() * n)
function_tokens: def _randbelow ( self , n , _log = _log , int = int , _maxwidth = 1L << BPF , _Method = _MethodType , _BuiltinMethod = _BuiltinMethodType ) : try : getrandbits = self . getrandbits except AttributeError : pass else : # Only call self.getrandbits if the original random() builtin method # has not been overridden or if a new getrandbits() was supplied. # This assures that the two methods correspond. if type ( self . random ) is _BuiltinMethod or type ( getrandbits ) is _Method : k = int ( 1.00001 + _log ( n - 1 , 2.0 ) ) # 2**k > n-1 > 2**(k-2) r = getrandbits ( k ) while r >= n : r = getrandbits ( k ) return r if n >= _maxwidth : _warn ( "Underlying random() generator does not supply \n" "enough bits to choose from a population range this large" ) return int ( self . random ( ) * n )