<jupyter_start><jupyter_text>Read IRSM FORM<jupyter_code>irsmform = xml_parser.get_files('irsmform xml', folder = 'linear TSR logs')
irsmout = xml_parser.get_files('out xml', folder = 'linear TSR logs')
csv = xml_parser.get_files('CMS 10y csv', folder = 'linear TSR logs')


replic_basket = csv_parser.parse_csv(csv)
cal_basket = list(xml_parser.get_calib_basket(irsmform))
settings = xml_parser.get_model_settings(irsmform)
dsc_curve, estim_curve, *sprds = xml_parser.get_rate_curves(irsmform)

mr_curve = xml_parser.get_tsr_params(irsmform).meanRevTSRSwapRate
    
n = settings.SpotIterations
adj_cms_flows = []
dsc_adj_cms_flows = []

for swo in cal_basket:
    pmnt_date = swo.payment_dates[0]
    mr = mr_curve(swo.start_date)
    adj_cms_flow = tsr.cmsflow(swo, dsc_curve, estim_curve, n, mr, pmnt_date).adjCMSrate
    
    adj_cms_flows.append(adj_cms_flow)
    dsc_adj_cms_flows.append(adj_cms_flow * dsc_curve.get_zc(pmnt_date))
    
dsc_adj_cms_flows = array(dsc_adj_cms_flows)
sum(dsc_adj_cms_flows)
dscs  = []
for swo in cal_basket:
    pmnt_date = swo.payment_dates[0]
    dscs.append(dsc_curve.get_dsc(pmnt_date))
    print(pmnt_date)<jupyter_output>21.0191780821918
22.0191780821918
23.0191780821918
24.027397260274
25.027397260274
26.0246575342466
27.0219178082192
28.0246575342466
29.0246575342466
30.0301369863014
31.0301369863014
32.0301369863014
33.027397260274
34.027397260274
35.027397260274
36.0328767123288
37.0328767123288
38.0301369863014
39.0301369863014
40.0328767123288
41.0383561643836
42.0383561643836
43.0356164383562
44.0356164383562
45.0356164383562
46.0356164383562
47.041095890411
48.0438356164384
49.0383561643836
50.0383561643836
{'fraction_non_alphanumeric': 0.09118176364727054, 'fraction_numerical': 0.26874625074985004, 'mean_word_length': 6.413333333333333, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '363396', 'license': 'MIT', 'n_tokens_mistral': 1023, 'n_tokens_neox': 740, 'n_words': 99, 'path': 'notebooks/workspace.ipynb', 'repo_name': 'nkapchenko/TSR', 'size': '1667'}