parameters: (N, randfunc)
return_statement: return value
docstring: getRandomNumber(N:int, randfunc:callable):long
      Return an N-bit random number.
docstring_summary: getRandomNumber(N:int, randfunc:callable):long
      Return an N-bit random number.
docstring_tokens: getRandomNumber ( N : int randfunc : callable ) : long Return an N - bit random number .
function: def getRandomNumber(N, randfunc):
      """getRandomNumber(N:int, randfunc:callable):long
      Return an N-bit random number."""
  
      S = randfunc(N/8)
      odd_bits = N % 8
      if odd_bits != 0:
          char = ord(randfunc(1)) >> (8-odd_bits)
          S = chr(char) + S
      value = bytes_to_long(S)
      value |= 2L ** (N-1)                # Ensure high bit is set
      assert size(value) >= N
      return value
function_tokens: def getRandomNumber ( N , randfunc ) : S = randfunc ( N / 8 ) odd_bits = N % 8 if odd_bits != 0 : char = ord ( randfunc ( 1 ) ) >> ( 8 - odd_bits ) S = chr ( char ) + S value = bytes_to_long ( S ) value |= 2L ** ( N - 1 ) # Ensure high bit is set assert size ( value ) >= N return value