'Return N bytes from the RNG.'

def read(self, N=(-1)):

    if self.closed:
        raise ValueError('I/O    operation    on    closed    file')
    if (not isinstance(N, (long, int))):
        raise TypeError('an    integer    is    required')
    if (N < 0):
        raise ValueError('cannot    read    to    end    of    infinite    stream')
    elif (N == 0):
        return ''
    data = self._read(N)
    if (len(data) != N):
        raise AssertionError(('%s    produced    truncated    output    (requested    %d,    got    %d)' % (self.name, N, len(data))))
    return data
