"""Compute guard: allocated cluster jobs or explicitly enabled local reproduction.""" import os,socket def ensure_compute(): if os.environ.get('DISH_ALLOW_LOCAL_RENDER')=='1':return if 'debug' not in socket.gethostname().lower() and os.environ.get('KUBERNETES_SERVICE_HOST'):return raise RuntimeError('Use an allocated CPU job; on your own reproduction machine explicitly set DISH_ALLOW_LOCAL_RENDER=1')