# Exercise scaffold. Reference implementation is in a separate directory."""GP2: reproducible synthetic experiment and retry-safe local recorded effects.The crashworker CLI deliberately exits only its own process with status 23."""fromcontextlibimportcontextmanagerfrompathlibimportPathimportargparseimporthashlibimportjsonimportmathimportosimportreimportsqlite3from.importdata,ml,ethicsFEATURES=['x0','x1']ARTIFACT_KEYS={'schema','features','mean','scale','weights','bias','threshold'}defcanonical(value):raiseNotImplementedError('Implement this contract from the book.')deffingerprint(value):raiseNotImplementedError('Implement this contract from the book.')deffinite_number(value,limit=1000000.0):raiseNotImplementedError('Implement this contract from the book.')defvalidate_artifact(artifact):raiseNotImplementedError('Implement this contract from the book.')def_unique_object(pairs):raiseNotImplementedError('Implement this contract from the book.')defload_artifact(path):raiseNotImplementedError('Implement this contract from the book.')defexperiment(seed=21):raiseNotImplementedError('Implement this contract from the book.')defconnect_store(path,role):raiseNotImplementedError('Implement this contract from the book.')@contextmanagerdeftransaction(connection):raiseNotImplementedError('Implement this contract from the book.')defpayload_for(job_id,features,model_digest):raiseNotImplementedError('Implement this contract from the book.')defsubmit(connection,job_id,features,model_digest):raiseNotImplementedError('Implement this contract from the book.')defconsume(connection,payload,artifact):raiseNotImplementedError('Implement this contract from the book.')defworker(producer_path,consumer_path,artifact,crash_after_consumer=False):raiseNotImplementedError('Implement this contract from the book.')defmain():raiseNotImplementedError('Implement this contract from the book.')