class_docstr: Tests initialization and instance methods of the ``Dataset`` class.
docstr: Test that open() can load an existing dataset
  on disk and copy it into memory.
docstr_tok: ["Test","that","open","(",")","can","load","an","existing","dataset","on","disk","and","copy","it","into","memory","."]
code: def test_open_existing_copy(self, tmp_path):
      """Test that open() can load an existing dataset
      on disk and copy it into memory."""
  
      path = Path(tmp_path, "dset.h5")
      existing = Dataset.open(path, "w")
  
      existing.data = "some data"
      existing.close()
  
      dset = Dataset.open(path, "copy")
  
      assert dset.bind.filename != str(path)
      assert dset.data == "some data"
  
      dset.other_data = "other data"
      dset.close()
  
      with pytest.raises(AttributeError):
          _ = Dataset.open(path).other_data
  
imports: from numbers import Number
  from pathlib import Path
  from typing import ClassVar, Dict
  import numpy
  import pytest
  from pennylane.data import AttributeInfo, Dataset, DatasetJSON, DatasetNotWriteableError, DatasetScalar, attribute, field
  from pennylane.data.base.dataset import UNSET, _init_arg
  from pennylane.data.base.hdf5 import open_group
label_desc: Use image node_id 24 for calling the TestDataset obj's underlying member method code with example usage: obj.test_open_existing_copy(tmp_path) without return types