def __init__(self, filename: str, mode: str = '<STR_LIT>', *, validate: bool = True, spec_version: str = "<STR_LIT>") -> None:
if not os.path.exists(filename):<EOL><INDENT>raise IOError(f"<STR_LIT>")<EOL><DEDENT>if mode != '<STR_LIT>' and mode != '<STR_LIT:r>':<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>self.filename = filename  <EOL>if validate:<EOL><INDENT>lv = loompy.LoomValidator(version=spec_version)<EOL>if not lv.validate(filename):<EOL><INDENT>raise ValueError("<STR_LIT:\n>".join(lv.errors) + f"<STR_LIT>")<EOL><DEDENT><DEDENT>self._file = h5py.File(filename, mode)<EOL>self._closed = False<EOL>if "<STR_LIT>" in self._file:<EOL><INDENT>self.shape = self._file["<STR_LIT>"].shape  <EOL><DEDENT>else:<EOL><INDENT>self.shape = (<NUM_LIT:0>, <NUM_LIT:0>)<EOL><DEDENT>self.layers = loompy.LayerManager(self)<EOL>self.view = loompy.ViewManager(self)  <EOL>self.ra = loompy.AttributeManager(self, axis=<NUM_LIT:0>)  <EOL>self.ca = loompy.AttributeManager(self, axis=<NUM_LIT:1>)  <EOL>self.attrs = loompy.FileAttributeManager(self._file)  <EOL>self.row_graphs = loompy.GraphManager(self, axis=<NUM_LIT:0>)  <EOL>self.col_graphs = loompy.GraphManager(self, axis=<NUM_LIT:1>)  <EOL>self.layer = self.layers<EOL>self.row_attrs = self.ra<EOL>self.col_attrs = self.ca<EOL>
Establish a connection to a Loom file.

Args:
        filename:			Name of the .loom file to open
        mode:				read/write mode, accepts 'r+' (read/write) or
                                                'r' (read-only), defaults to 'r+' without arguments,
                                                and to 'r' with incorrect arguments
        validate:			Validate that the file conforms with the Loom specification
Returns:
        Nothing.