Lawfare Group → Knowledge Institute → Lawfare Academy

Reproduce the worked examples

Copy the complete code below into a UTF-8 file named verify.py and run python verify.py with Python 3. It uses only the standard library and performs exact or rational synthetic calculations. It does not access a network or learner records. Assertions fail if the expected synthetic results change.

These checks verify the stated arithmetic and query behavior, not independent academic acceptance or production migration safety.

"""Synthetic leadership/change laboratory. Arithmetic is not causal or ethical validation."""
from fractions import Fraction as F
import json
checks={}
def check(n,a,b):
 assert a==b,(n,a,b)
 checks[n]=str(a)
check('participant hours',20*(2+1),60)
check('changed participant hours',25*3,75)
check('gross hours',F(1000*3,60),50)
check('net hours',50-15,35)
check('training time recovery',F(60,35),F(12,7))
check('changed recovery',F(60,25),F(12,5))
check('baseline error rate',F(24,400),F(6,100))
check('pilot error rate',F(18,600),F(3,100))
check('absolute change',F(18,600)-F(24,400),F(-3,100))
check('relative reduction',(F(24,400)-F(18,600))/F(24,400),F(1,2))
check('comparison change',F(9,300)-F(12,300),F(-1,100))
check('descriptive difference in changes',F(-3,100)-F(-1,100),F(-2,100))
check('monthly net resource value',50*30-15*30-300,750)
check('startup resource value',60*30+1200,3000)
check('simple value recovery months',F(3000,750),4)
check('changed net value',50*30-25*30-300,450)
check('changed value recovery months',F(3000,450),F(20,3))
p=1-F(98,100)**20
assert abs(float(p)-0.3323920282449058)<1e-12
checks['stipulated independent repeated failure probability']=str(float(p))
register=['stipulated fact','estimate','target','expansion gate','observed outcome','causal claim','authority']
assert len(set(register))==7
print(json.dumps(dict(passed=True,checks=checks,claimTypes=register,limits='Synthetic calculations do not establish real readiness, actual cash savings, causal effects, leadership quality, legal authority or acceptable risk. Independent subject review and learner testing remain pending.'),indent=2))

Related chapters