<s> '''<STR_LIT>''' <EOL> import pandas as pand <EOL> import numpy as np <EOL> def class_fut_ret ( d_data , i_lookforward = <NUM_LIT> , s_rel = None , b_use_open = False ) : <EOL> '''<STR_LIT>''' <EOL> if b_use_open : <EOL> df_val = d_data [ '<STR_LIT>' ] . copy ( ) <EOL> else : <EOL> df_val = d_data [ '<STR_LIT>' ] . copy ( ) <EOL> na_val = df_val . values <EOL> if b_use_open : <EOL> na_val [ : - ( i_lookforward + <NUM_LIT:1> ) , : ] = ( ( na_val [ i_lookforward + <NUM_LIT:1> : , : ] - <EOL> na_val [ <NUM_LIT:1> : - ( i_lookforward ) , : ] ) / <EOL> na_val [ <NUM_LIT:1> : - ( i_lookforward ) , : ] ) <EOL> na_val [ - ( i_lookforward + <NUM_LIT:1> ) : , : ] = np . nan <EOL> else : <EOL> na_val [ : - i_lookforward , : ] = ( ( na_val [ i_lookforward : , : ] - <EOL> na_val [ : - i_lookforward , : ] ) / <EOL> na_val [ : - i_lookforward , : ] ) <EOL> na_val [ - i_lookforward : , : ] = np . nan <EOL> return df_val <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> pass </s>
