code: def test_make_legacy_dataset_from_numpy():
      """Test that legacy DiskDataset objects can be constructed."""
      current_dir = os.path.dirname(os.path.abspath(__file__))
      # legacy_dataset is a dataset in the legacy format kept around for testing purposes.
      data_dir = os.path.join(current_dir, "legacy_dataset")
      dataset = dc.data.DiskDataset(data_dir)
      assert dataset.legacy_metadata
      assert len(dataset.metadata_df.columns) == 4
      assert list(dataset.metadata_df.columns) == ["ids", "X", "y", "w"]
  
      # Test constructor reload works for legacy format
      dataset2 = dc.data.DiskDataset(dataset.data_dir)
      assert dataset2.legacy_metadata
      assert len(dataset2.metadata_df.columns) == 4
      assert list(dataset2.metadata_df.columns) == [
          "ids",
          "X",
          "y",
          "w",
      ]
  
imports: import os
  import deepchem
  import numpy
  import tempfile
label_desc: Use image node_id 1 for calling a global function with example usage: test_make_legacy_dataset_from_numpy() without return types