code: def test_lof_input_dtype_preservation(
      global_dtype, algorithm, contamination, novelty
  ):
      """Check that the fitted attributes are stored using the data type of X."""
      X = iris.data.astype(global_dtype, copy=False)
  
      iso = neighbors.LocalOutlierFactor(
          n_neighbors=5,
          algorithm=algorithm,
          contamination=contamination,
          novelty=novelty,
      )
      iso.fit(X)
  
      assert iso.negative_outlier_factor_.dtype == global_dtype
  
      for method in ("score_samples", "decision_function"):
          if hasattr(iso, method):
              y_pred = getattr(iso, method)(X)
              assert y_pred.dtype == global_dtype
  
imports: import re
  from math import sqrt
  import numpy
  import pytest
  from sklearn import metrics, neighbors
  from sklearn.datasets import load_iris
  from sklearn.metrics import roc_auc_score
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_allclose, assert_array_equal
  from sklearn.utils.estimator_checks import check_outlier_corruption, parametrize_with_checks
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 14 for calling a global function with example usage: test_lof_input_dtype_preservation(global_dtype, algorithm, contamination, novelty) without return types