def new(filename: str, *, file_attrs: Optional[Dict[str, str]] = None) -> LoomConnection:
if filename.startswith("<STR_LIT>"):<EOL><INDENT>filename = os.path.expanduser(filename)<EOL><DEDENT>if file_attrs is None:<EOL><INDENT>file_attrs = {}<EOL><DEDENT>f = h5py.File(name=filename, mode='<STR_LIT:w>')<EOL>f.create_group('<STR_LIT>')<EOL>f.create_group('<STR_LIT>')<EOL>f.create_group('<STR_LIT>')<EOL>f.create_group('<STR_LIT>')<EOL>f.create_group('<STR_LIT>')<EOL>f.flush()<EOL>f.close()<EOL>ds = connect(filename, validate=False)<EOL>for vals in file_attrs:<EOL><INDENT>ds.attrs[vals] = file_attrs[vals]<EOL><DEDENT>currentTime = time.localtime(time.time())<EOL>ds.attrs['<STR_LIT>'] = timestamp()<EOL>ds.attrs["<STR_LIT>"] = loompy.loom_spec_version<EOL>return ds<EOL>
Create an empty Loom file, and return it as a context manager.