code: def test_high_turnover_warning(self):
      (
          returns,
          positions,
          factor_returns,
          factor_loadings,
      ) = generate_toy_risk_model_output()
  
      # Mock the positions data to turn over the whole portfolio from
      # one asset to another every day (cycling every 3 days).
      positions.iloc[::3, :] = [100.0, 0.0, 0.0, 0.0]
      positions.iloc[1::3, :] = [0.0, 100.0, 0.0, 0.0]
      positions.iloc[2::3, :] = [0.0, 0.0, 100.0, 0.0]
  
      transactions = mock_transactions_from_positions(positions)
  
      with warnings.catch_warnings(record=True) as w:
          warnings.simplefilter("always", UserWarning)
  
          perf_attrib(
              returns,
              positions,
              factor_returns,
              factor_loadings,
              transactions=transactions,
          )
  
      self.assertEqual(len(w), 1)
      self.assertIn(
          "This algorithm has relatively high turnover of its positions.",
          str(w[-1].message),
      )
  
file_path: pyfolio/pyfolio/tests/test_perf_attrib.py
imports: import numpy
  import pandas
  import unittest
  import warnings
  import empyrical
  from pyfolio.perf_attrib import perf_attrib, create_perf_attrib_stats, _cumulative_returns_less_costs
label_desc: Use image node_id 4 for calling the PerfAttribTestCase obj's underlying member method code with example usage: obj.test_high_turnover_warning() without return types