code: def conditional_value_at_risk(returns, cutoff=0.05):
      """
      Conditional value at risk (CVaR) of a returns stream.
  
      CVaR measures the expected single-day returns of an asset on that asset's
      worst performing days, where "worst-performing" is defined as falling below
      ``cutoff`` as a percentile of all daily returns.
  
      Parameters
      ----------
      returns : pandas.Series or 1-D numpy.array
          Non-cumulative daily returns.
      cutoff : float, optional
          Decimal representing the percentage cutoff for the bottom percentile of
          returns. Defaults to 0.05.
  
      Returns
      -------
      CVaR : float
          The CVaR value.
      """
      # PERF: Instead of using the 'value_at_risk' function to find the cutoff
      # value, which requires a call to numpy.percentile, determine the cutoff
      # index manually and partition out the lowest returns values. The value at
      # the cutoff index should be included in the partition.
      cutoff_index = int((len(returns) - 1) * cutoff)
      return np.mean(
          np.partition(returns, cutoff_index)[: cutoff_index + 1]
      )
  
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 54 for calling a global function with example usage: conditional_value_at_risk(returns, cutoff) and returns: np