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.

"""Bay Workshop synthetic calculation checks; no empirical or learner data."""
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('base serial capacity',min(120,90,100),90)
check('upstream-only change',min(140,90,100),90)
check('assembly improvement changes constraint',min(120,110,100),100)
check('inspection disruption',min(120,90,80),80)
check('periodA on-time',F(180,200),F(9,10))
check('periodB on-time',F(270,300),F(9,10))
check('periodA late count',200-180,20)
check('periodB late count',300-270,30)
check('effective hours',10*40*F(75,100),300)
check('planning gap',330-300,30)
check('changed effective hours',10*40*F(70,100),280)
check('changed planning gap',330-280,50)
check('static budget',100*60,6000)
check('actual-volume allowance',110*60,6600)
check('static cost variance',6600-6000,600)
check('simple flexible variance',6600-110*60,0)
check('original approvals',12*4,48)
check('revised approvals',12*1,12)
check('removed approvals',48-12,36)
check('approval-count reduction',F(48-12,48),F(3,4))
check('accepted-to-start ratio',F(90,120),F(3,4))
check('training participant-hours',10*2,20)
check('meeting participant-hours',8*F(30,60),4)
check('revised meeting participant-hours',6*F(20,60),2)
print(json.dumps(dict(passed=True,checks=checks,limits='Synthetic arithmetic does not establish empirical bottlenecks, causal effects, employee motivation, competence, lawful authority or effective controls. Whole-course acceptance also requires complete teaching, source verification, optional transfer practice and cumulative reasoning. Independent subject review and learner testing remain pending.'),indent=2))

Related chapters