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.
"""Original ethics evidence laboratory. Exact synthetic arithmetic and structure only.
No test certifies a moral judgment, factual estimate, legal rule or real organization.
Python3 standard library; no network, production access or learner records.
"""
from fractions import Fraction as F
import json
checks={}
def check(name,a,b):
assert a==b,(name,a,b)
checks[name]=str(a)
check('original disruption hours',10*3,30)
check('redesigned disruption hours',10*1,10)
check('disruption reduction',30-10,20)
check('original measured net benefit',8000+2000-6000,4000)
check('redesigned measured net benefit',7000+1500-2000,6500)
check('measured improvement',6500-4000,2500)
check('first callback rate',F(2,20),F(1,10))
check('second callback rate',F(4,80),F(1,20))
scores={'A':[80,90,70],'B':[90,70,80]};weights=[F(1,2),F(3,10),F(1,5)]
assert sum(weights)==1
check('supplier A original score',sum(w*s for w,s in zip(weights,scores['A'])),81)
check('supplier B original score',sum(w*s for w,s in zip(weights,scores['B'])),82)
newweights=[F(3,5),F(1,5),F(1,5)]
assert sum(newweights)==1
check('supplier A changed score',sum(w*s for w,s in zip(newweights,scores['A'])),80)
check('supplier B changed score',sum(w*s for w,s in zip(newweights,scores['B'])),84)
check('intensity reduction fraction',(2-F(3,2))/2,F(1,4))
oldtotal=2*1000;newtotal=F(3,2)*1600
check('old total synthetic impact',oldtotal,2000)
check('new total synthetic impact',newtotal,2400)
check('total increase fraction',F(newtotal-oldtotal,oldtotal),F(1,5))
check('unchanged volume new total',F(3,2)*1000,1500)
check('reuse threshold uses',F(30,1)/(2-F(1,2)),20)
check('reuse20 impact',30+F(1,2)*20,40)
check('disposable20 impact',2*20,40)
check('reuse21 impact',30+F(1,2)*21,F(81,2))
check('disposable21 impact',2*21,42)
assert 30+F(1,2)*21<2*21
check('first complaint rate',F(12,1000),F(3,250))
check('second complaint rate',F(8,500),F(2,125))
check('complaint count decrease fraction',F(12-8,12),F(1,3))
assert F(8,500)>F(12,1000)
register=[
{'claim':'Weekend response excluded','type':'stipulated fact','scope':'fictional offer'},
{'claim':'Disclosure might lose a sale','type':'forecast','scope':'unverified'},
{'claim':'Actual sales legality','type':'legal question','scope':'Florida default; applicable federal authority separate'},
{'claim':'Customer should receive decision-relevant information','type':'ethical reason','scope':'requires argument'},
{'claim':'Independent remedy effectiveness','type':'implementation outcome','scope':'not yet verified'}]
assert len({x['type'] for x in register})==5 and all(x['scope'] for x in register)
print(json.dumps(dict(passed=True,checks=checks,syntheticEvidenceRegister=register,limits='Weights, valuations, harm boundaries and ethical conclusions are not validated by arithmetic. Independent subject review and learner testing remain pending.'),indent=2))
Related chapters
- Build an ethical argument from facts, duties and serious objections
- Map stakeholder burdens and redesign the apparent tradeoff
- Build fair procedures for performance, loyalty and reporting concerns
- Manage conflicts through independent judgment and accountable decisions
- Evaluate environmental claims with consistent boundaries and honest evidence
- Build a speak-up and remedy system that incentives do not defeat
- Ethics clinic: defend the reasons, distribution, evidence and remedy