parameters: (f)
docstring: r"""
      >>> import StringIO
      >>> read_string1(StringIO.StringIO("\x00"))
      ''
      >>> read_string1(StringIO.StringIO("\x03abcdef"))
      'abc'
docstring_summary: r"""
      >>> import StringIO
      >>> read_string1(StringIO.StringIO("\x00"))
      ''
      >>> read_string1(StringIO.StringIO("\x03abcdef"))
      'abc'
docstring_tokens: r >>> import StringIO >>> read_string1 ( StringIO . StringIO ( \ x00 )) >>> read_string1 ( StringIO . StringIO ( \ x03abcdef )) abc
function: def read_string1(f):
      r"""
      >>> import StringIO
      >>> read_string1(StringIO.StringIO("\x00"))
      ''
      >>> read_string1(StringIO.StringIO("\x03abcdef"))
      'abc'
      """
  
      n = read_uint1(f)
      assert n >= 0
      data = f.read(n)
      if len(data) == n:
          return data
      raise ValueError("expected %d bytes in a string1, but only %d remain" %
                       (n, len(data)))
function_tokens: def read_string1 ( f ) : n = read_uint1 ( f ) assert n >= 0 data = f . read ( n ) if len ( data ) == n : return data raise ValueError ( "expected %d bytes in a string1, but only %d remain" % ( n , len ( data ) ) )