code: def simple_returns(prices):
      """
      Compute simple returns from a timeseries of prices.
  
      Parameters
      ----------
      prices : pd.Series, pd.DataFrame or np.ndarray
          Prices of assets in wide-format, with assets as columns,
          and indexed by datetimes.
  
      Returns
      -------
      returns : array-like
          Returns of assets in wide-format, with assets as columns,
          and index coerced to be tz-aware.
      """
      if isinstance(prices, (pd.DataFrame, pd.Series)):
          out = prices.pct_change().iloc[1:]
      else:
          # Assume np.ndarray
          out = np.diff(prices, axis=0)
          np.divide(out, prices[:-1], out=out)
  
      return out
  
imports: from __future__ import division
  import math
  import pandas
  import numpy
  from math import pow
  from scipy import stats, optimize
  from six import iteritems
  from sys import float_info
  from .utils import nanmean, nanstd, nanmin, up, down, roll, rolling_window
  from .periods import ANNUALIZATION_FACTORS, APPROX_BDAYS_PER_YEAR
  from .periods import DAILY, WEEKLY, MONTHLY, QUARTERLY, YEARLY
label_desc: Use image node_id 6 for calling a global function with example usage: simple_returns(prices) and returns: out