from collections import Counter def run(load,check): reg=load('C297_DATA.json')['regular_register'];cum=[e for e in load('C266_ENDPOINTS.json') if e['source_role']=='Flood'];rows=[];hits=[] check('three cumulative fields',Counter(x['profile'] for x in cum)=={'MT_ON':8,'LXX_OFF':8,'SP_OFF':8}) for c in cum: for r in reg: residual=(12696-c['source_BC_base']-1406)-(8464-r['BC_Nisan']-6) row={'profile':c['profile'],'index':c['source_index'],'C':c['source_BC_base'],'regular':r,'gap':8464-r['BC_Nisan']-6,'residual':residual};rows.append(row) if residual==0:hits.append(row) counts=Counter(h['profile'] for h in hits) check('profile coverage',counts=={'MT_ON':4,'LXX_OFF':4}) check('all six regular records covered',{(h['regular']['gear'],h['regular']['role']) for h in hits}=={(r['gear'],r['role']) for r in reg}) check('two co-located overlap rows',sorted(C for C in {h['C'] for h in hits} if sum(h['C']==C for h in hits)==2)==[5289,5290]) check('six unique coordinate comparisons',len({(h['C'],h['regular']['BC_Nisan']) for h in hits})==6) check('LXX fills G1',{h['index'] for h in hits if h['profile']=='LXX_OFF' and h['regular']['gear']==1}=={2,3}) return {'all144_comparisons':rows,'matches':hits,'profile_counts':dict(counts),'unique_regular_records':6,'unique_coordinate_comparisons':6,'labeled_comparisons':len(hits),'shared_source_coordinates':[5289,5290],'SP_no_match_under_these_fixed_anchors':True}