parameters: (inputf, n)
return_statement: return buf
docstring: Read exactly n bytes from the input.
          Raise RuntimeError if the stream ended before
          n bytes were read.
docstring_summary: Read exactly n bytes from the input.
          Raise RuntimeError if the stream ended before
          n bytes were read.
docstring_tokens: Read exactly n bytes from the input . Raise RuntimeError if the stream ended before n bytes were read .
function: def read_n(inputf, n):
      """ Read exactly n bytes from the input.
          Raise RuntimeError if the stream ended before
          n bytes were read.
      """
      buf = b''
      while n > 0:
          data = inputf.read(n)
          if data == '':
              raise RuntimeError('unexpected connection close')
          buf += data
          n -= len(data)
      return buf
function_tokens: def read_n ( inputf , n ) : buf = b'' while n > 0 : data = inputf . read ( n ) if data == '' : raise RuntimeError ( 'unexpected connection close' ) buf += data n -= len ( data ) return buf