code: def aggregate_returns(returns, convert_to):
      """
      Aggregates returns by week, month, or year.
  
      Parameters
      ----------
      returns : pd.Series
         Daily returns of the strategy, noncumulative.
          - See full explanation in :func:`~pyfolio.timeseries.cum_returns`.
      convert_to : str
          Can be 'weekly', 'monthly', or 'yearly'.
  
      Returns
      -------
      pd.Series
          Aggregated returns.
      """
  
      return ep.aggregate_returns(returns, convert_to=convert_to)
  
imports: from __future__ import division
  from collections import OrderedDict
  from functools import partial
  import empyrical
  import numpy
  import pandas
  import scipy
  import scipy.stats
  from sklearn import linear_model
  from .deprecate import deprecated
  from .interesting_periods import PERIODS
  from .txn import get_turnover
  from .utils import APPROX_BDAYS_PER_MONTH, APPROX_BDAYS_PER_YEAR
  from .utils import DAILY
label_desc: Use image node_id 18 for calling a global function with example usage: aggregate_returns(returns, convert_to) and returns: ep