code: def test_copy_some_fields_with_repartition_cli(
      tmpdir, synthetic_dataset
  ):
      target_path = os.path.join(tmpdir.strpath, "copied_data")
      target_url = "file://" + target_path
      _main(
          [
              synthetic_dataset.url,
              target_url,
              "--field-regex",
              r"\bid\b",
              "--partition-count",
              "1",
          ]
      )
  
      # Check reparititioning
      assert 1 == len(glob.glob(os.path.join(target_path, "part-*")))
  
      # Check we the regex filter worked
      with make_reader(target_url, num_epochs=1) as reader:
          assert list(reader.schema.fields.keys()) == ["id"]
  
file_path: petastorm/petastorm/tests/test_copy_dataset.py
imports: import glob
  import os
  import numpy
  import pytest
  from pyspark.sql import SparkSession
  from pyspark.sql.utils import AnalysisException
  from petastorm.reader import make_reader
  from petastorm.tools.copy_dataset import _main, copy_dataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_copy_some_fields_with_repartition_cli(tmpdir, synthetic_dataset) without return types