def __init__(self, filename=None, mode=None, fileobj=None, version = None, file_headers = {}):
if fileobj is None:<EOL><INDENT>fileobj = __builtin__.open(filename, mode or "<STR_LIT:rb>")<EOL><DEDENT>self.fileobj = fileobj<EOL>if version != None and int(version) not in (<NUM_LIT:1>, <NUM_LIT:2>):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>self.version = version<EOL>self.file_headers = file_headers<EOL>self.header_written = False<EOL>self.header_read = False<EOL>
Initialises a file like object that can be used to read or
write Arc files. Works for both version 1 or version 2.

This can be called similar to the builtin `file` constructor. 

It can also just be given a fileobj which is a file like
object that it will use directly for its work.

The file_headers should contain the following fields used to
create the header for the file. The exact fields used depends
on whether v1 or v2 files are being created. If a read is
done, the headers will be autopopulated from the first record.

   * ip_address - IP address of the machine doing the Archiving
   * date - Date of archival
   * org - Organisation that's doing the Archiving. 

The version parameter tries to work intuitively as follows

    * If version is set to 'n' (where n is 1 or 2), the
      library configures itself to read and write version n
      ARC files.

          * When we try to write a record, it will generate
            and write a version n record.

          * When we try to read a record, it will attempt to
            parse it as a version n record and will error out
            if the format is different.

    * If the version is unspecified, the library will
      configures itself as follows

          * When we try to write a record, it will generate
            and write a version 2 record.

          * When we try to read a record, it will read out one
            record and try to guess the version from it (for
            the first read).