code: def test_torch_dataloader_advanced_params(
      mock_torch_make_batch_reader, spark_test_ctx
  ):
      SHARD_COUNT = 3
      df = spark_test_ctx.spark.range(100).repartition(SHARD_COUNT)
      conv = make_spark_converter(df)
  
      mock_torch_make_batch_reader.return_value = make_batch_reader(
          conv.cache_dir_url
      )
  
      with conv.make_torch_dataloader(
          reader_pool_type="dummy", cur_shard=1, shard_count=SHARD_COUNT
      ) as _:
          pass
      peta_args = mock_torch_make_batch_reader.call_args[1]
      assert (
          peta_args["reader_pool_type"] == "dummy"
          and peta_args["cur_shard"] == 1
          and peta_args["shard_count"] == SHARD_COUNT
          and peta_args["num_epochs"] is None
          and peta_args["workers_count"] == 4
      )
  
      # Test default value overridden arguments.
      with conv.make_torch_dataloader(
          num_epochs=1, workers_count=2
      ) as _:
          pass
      peta_args = mock_torch_make_batch_reader.call_args[1]
      assert (
          peta_args["num_epochs"] == 1
          and peta_args["workers_count"] == 2
      )
  
imports: import os
  import subprocess
  import sys
  import tempfile
  import threading
  import time
  from distutils.version import LooseVersion
  import numpy
  import pyspark
  import pytest
  import py4j
  import tensorflow.compat.v1
  from pyspark.sql.functions import pandas_udf
  from pyspark.sql.types import ArrayType, BinaryType, BooleanType, ByteType, DoubleType, FloatType, IntegerType, LongType, ShortType, StringType, StructField, StructType
  from six.moves.urllib.parse import urlparse
  from petastorm import make_batch_reader
  from petastorm.fs_utils import FilesystemResolver
  from petastorm.spark import SparkDatasetConverter, make_spark_converter, spark_dataset_converter
  from petastorm.spark.spark_dataset_converter import _check_dataset_file_median_size, _check_parent_cache_dir_url, _check_rank_and_size_consistent_with_horovod, _check_url, _get_horovod_rank_and_size, _get_spark_session, _make_sub_dir_url, register_delete_dir_handler, _wait_file_available, _normalize_databricks_dbfs_url
  from unittest import mock
  from petastorm.tests.test_tf_utils import create_tf_graph
label_desc: Use image node_id 25 for calling a global function with example usage: test_torch_dataloader_advanced_params(mock_torch_make_batch_reader, spark_test_ctx) without return types