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.
from fractions import Fraction as F
import json
checks=[]
def check(name,actual,expected):
assert actual==expected,(name,actual,expected)
checks.append(dict(case=name,actual=str(actual),expected=str(expected)))
check('Revenue growth in separate visual case',F(100000-80000,80000),F(1,4))
check('Profit growth in separate visual case',F(9000-8000,8000),F(1,8))
check('First margin',F(8000,80000),F(1,10))
check('Second margin',F(9000,100000),F(9,100))
check('Scope-adjusted revenue',100000-20000,80000)
check('Scope-adjusted profit',9000-1000,8000)
check('Campaign at half incremental share',10000*F(1,2)*F(2,5)-1500,F(500))
check('Campaign at thirty percent incremental share',10000*F(3,10)*F(2,5)-1500,F(-300))
check('New transfer at twenty percent incremental share',10000*F(1,5)*F(2,5)-1500,F(-700))
check('Cash before equipment',4000+6000+1000-8000,3000)
check('Cash after equipment',4000+6000+1000-8000-5000,-2000)
check('Cash after additional existing receivable collection',4000+6000+1000-8000-5000+3000,1000)
check('Independent collection leaves profit unchanged',6000,6000)
check('Necessary review plus vendor cost',6000+2000,8000)
check('Rollout first margin',F(100,10000),F(1,100))
check('Rollout second margin',F(200,20000),F(1,100))
check('Rollout profit absolute change',200-100,100)
check('Rollout profit relative change',F(200-100,100),F(1))
print(json.dumps(dict(passed=True,scope='Synthetic numerical mechanisms only; not observed speaking, comprehension, causal proof or learner competence',checks=checks)))