def from_pandas_contextual(df):
    """ Convert contextual ``pandas.DataFrame`` to list of tuples.

    Args:
        df (DataFrame):
            anomalies, passed as ``pandas.DataFrame``
            containing two columns: start and stop.

    Returns:
        list:
            tuple (start, end) timestamp.

    Raises:
        KeyError:
            If the received ``pandas.DataFrame`` does not contain the required columns.
    """
    require = ['start', 'end']
    columns = df.columns.tolist()

    if all(x in columns for x in require):
        if 'severity' in columns:
            return list(df[require + ['severity']].itertuples(index=False))
        return list(df[require].itertuples(index=False))

    raise KeyError('{} not found in columns: {}.'.format(require, columns))