code: def value_at_risk(returns, period=None, sigma=2.0):
      
      if period is not None:
          returns_agg = ep.aggregate_returns(returns, period)
      else:
          returns_agg = returns.copy()
  
      value_at_risk = returns_agg.mean() - sigma * returns_agg.std()
      return value_at_risk
docs: Get value at risk (VaR).
  
      Parameters
      ----------
      returns : pd.Series
          Daily returns of the strategy, noncumulative.
           - See full explanation in tears.create_full_tear_sheet.
      period : str, optional
          Period over which to calculate VaR. Set to 'weekly',
          'monthly', or 'yearly', otherwise defaults to period of
          returns (typically daily).
      sigma : float, optional
          Standard deviations of VaR, default 2.