code: def _empyrical_compat_perf_attrib_result(index, columns, data):
      if ep.__version__ < "0.5.2":
          # Newer columns were added in empyrical v0.5.2. These exist in older
          # and newer empyrical:
          columns = [
              "risk_factor1",
              "risk_factor2",
              "common_returns",
              "specific_returns",
              "total_returns",
          ]
          data = {k: v for k, v in data.items() if k in columns}
  
      return pd.DataFrame(index=index, columns=columns, data=data)
  
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 1 for calling a global function with example usage: _empyrical_compat_perf_attrib_result(index, columns, data) and returns: pd