code: def get_daily_return_series_from_positions(
      positions, init_asset_value
  ):
      """Parameters
      generate daily return series from  position view
      positions: positions generated by strategy
      init_asset_value : init asset value
      return: pd.Series of daily return , return_series[date] = daily return rate
      """
      value_dict = get_position_list_value(positions)
      value_series = pd.Series(value_dict)
      value_series = value_series.sort_index()  # check date
      return_series = value_series.pct_change()
      return_series[value_series.index[0]] = (
          value_series[value_series.index[0]] / init_asset_value - 1
      )  # update daily return for the first date
      return return_series
  
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  import pandas
  from scipy.stats import spearmanr, pearsonr
  from ..data import D
  from collections import OrderedDict
label_desc: Use image node_id 4 for calling a global function with example usage: get_daily_return_series_from_positions(positions, init_asset_value) and returns: return_series