code: def test_reduce_precision_correctly_reduces_precision(
      X, dtype, x_type
  ):
      X = X.astype(dtype)
      if x_type == csr_matrix:
          X = x_type(X)
  
      X_reduced, precision = reduce_precision(X)
  
      # Check the reduced precision is correctly returned
      assert X_reduced.dtype == precision
  
      # Check that it was reduce to the correct precision
      expected: Dict[type, type] = {
          np.float32: np.float32,
          np.float64: np.float32,
          np.dtype("float32"): np.float32,
          np.dtype("float64"): np.float32,
      }
      if hasattr(np, "float96"):
          expected[np.float96] = np.float64
  
      if hasattr(np, "float128"):
          expected[np.float128] = np.float64
  
      assert precision == expected[dtype]
  
      # Check that X's shape was not modified in any way
      assert X.shape == X_reduced.shape
  
      # Check that the return type is the one as we passed in
      assert type(X) == type(X_reduced)
  
imports: from typing import Any, Dict, List, Union
  import warnings
  from itertools import chain
  import numpy
  import pandas
  import sklearn.datasets
  from scipy.sparse import csr_matrix, spmatrix
  from autosklearn.constants import BINARY_CLASSIFICATION, CLASSIFICATION_TASKS, MULTICLASS_CLASSIFICATION, MULTILABEL_CLASSIFICATION, MULTIOUTPUT_REGRESSION, REGRESSION, REGRESSION_TASKS
  from autosklearn.util.data import default_dataset_compression_arg, reduce_dataset_size_if_too_large, reduce_precision, reduction_mapping, subsample, supported_precision_reductions, validate_dataset_compression_arg
  import pytest
label_desc: Use image node_id 13 for calling a global function with example usage: test_reduce_precision_correctly_reduces_precision(X, dtype, x_type) without return types