code: def test_regenerate_metadata(synthetic_dataset, tmpdir):
      a_moved_path = tmpdir.join("moved").strpath
      copytree(synthetic_dataset.path, a_moved_path)
  
      # Make sure we can read dataset before
      _check_reader(a_moved_path)
  
      # Delete both metadata files
      dataset = pq.ParquetDataset(a_moved_path)
      os.remove(dataset.common_metadata_path)
  
      # Regenerate all metadata including unischema information
      petastorm_generate_metadata._main(
          [
              "--dataset_url",
              "file://{}".format(a_moved_path),
              "--unischema_class",
              "petastorm.tests.test_common.TestSchema",
          ]
      )
  
      # Reader should now work again (row group selector will not since we removed all metadata)
      _check_reader(a_moved_path)
  
file_path: petastorm/petastorm/tests/test_generate_metadata.py
imports: import os
  from collections import namedtuple
  from shutil import copytree
  import pyarrow.parquet
  import pytest
  from petastorm import make_reader
  from petastorm.etl import petastorm_generate_metadata
  from petastorm.selectors import SingleIndexSelector
  from petastorm.tests.test_common import create_test_dataset, TestSchema
label_desc: Use image node_id 3 for calling a global function with example usage: test_regenerate_metadata(synthetic_dataset, tmpdir) without return types