code: def cum_returns_final(returns, starting_value=0):
      """
      Compute total returns from simple returns.
  
      Parameters
      ----------
      returns : pd.Series or np.ndarray
          Returns of the strategy as a percentage, noncumulative.
           - Time series with decimal returns.
           - Example:
              2015-07-16    -0.012143
              2015-07-17    0.045350
              2015-07-20    0.030957
              2015-07-21    0.004902.
      starting_value : float, optional
         The starting returns.
  
      Returns
      -------
      float
  
      """
  
      if len(returns) == 0:
          return np.nan
  
      return cum_returns(
          np.asanyarray(returns), starting_value=starting_value
      )[-1]
  
imports: from __future__ import division
  from functools import wraps
  import pandas
  import numpy
  from scipy import stats
  from six import iteritems
  from empyrical.utils import nanmean, nanstd, nanmin
label_desc: Use image node_id 4 for calling a global function with example usage: cum_returns_final(returns, starting_value) and returns: cum_returns, np