def cal(self, opttype, strike, exp1, exp2):
assert pd.Timestamp(exp1) < pd.Timestamp(exp2)<EOL>_row1 = _relevant_rows(self.data, (strike, exp1, opttype,),<EOL>"<STR_LIT>".format(exp1, strike, opttype))<EOL>_row2 = _relevant_rows(self.data, (strike, exp2, opttype,),<EOL>"<STR_LIT>".format(exp2, strike, opttype))<EOL>_price1 = _getprice(_row1)<EOL>_price2 = _getprice(_row2)<EOL>_eq = _row1.loc[:, '<STR_LIT>'].values[<NUM_LIT:0>]<EOL>_qt = _row1.loc[:, '<STR_LIT>'].values[<NUM_LIT:0>]<EOL>_index = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>_vals = np.array([_price1, _price2, _price2 - _price1, _eq, _qt])<EOL>return pd.DataFrame(_vals, index=_index, columns=['<STR_LIT>'])<EOL>
Metrics for evaluating a calendar spread.

Parameters
------------
opttype : str ('call' or 'put')
    Type of option on which to collect data.
strike : numeric
    Strike price.
exp1 : date or date str (e.g. '2015-01-01')
    Earlier expiration date.
exp2 : date or date str (e.g. '2015-01-01')
    Later expiration date.

Returns
------------
metrics : DataFrame
    Metrics for evaluating spread.