code: def value_at_risk(returns, period=None, sigma=2.0):
      """
      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.
      """
      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
  
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 22 for calling a global function with example usage: value_at_risk(returns, period, sigma) and returns: value_at_risk