code: def synthetic_dataset(request, tmpdir_factory):
      def _synthetic_dataset_no_cache():
          path = tmpdir_factory.mktemp("data").strpath
          url = "file://" + path
          data = create_test_dataset(url, range(_ROWS_COUNT))
          dataset = SyntheticDataset(url=url, path=path, data=data)
          return dataset
  
      return maybe_cached_dataset(
          request.config,
          "synthetic_dataset",
          _synthetic_dataset_no_cache,
      )
  
imports: import logging
  import os
  import pickle
  import tempfile
  from base64 import b64encode, b64decode
  from collections import namedtuple
  import pytest
  import six
  from petastorm.spark import spark_dataset_converter, SparkDatasetConverter
  from petastorm.tests.test_common import create_test_dataset, create_test_scalar_dataset, create_many_columns_non_petastorm_dataset
  from pyspark.sql import SparkSession
label_desc: Use image node_id 4 for calling a global function with example usage: synthetic_dataset(request, tmpdir_factory) and returns: maybe_cached_dataset, dataset