def __init__(self):
super().__init__()<EOL>self.headless_frames = getattr(settings, '<STR_LIT>', <NUM_LIT:0>)<EOL>self.headless_duration = getattr(settings, '<STR_LIT>', <NUM_LIT:0>)<EOL>if not self.headless_frames and not self.headless_duration:<EOL><INDENT>raise ImproperlyConfigured("<STR_LIT>")<EOL><DEDENT>self._close = False<EOL>self.ctx = moderngl.create_standalone_context(require=self.gl_version.code)<EOL>context.WINDOW = self<EOL>self.fbo = self.ctx.framebuffer(<EOL>color_attachments=self.ctx.texture(self.size, <NUM_LIT:4>),<EOL>depth_attachment=self.ctx.depth_texture(self.size),<EOL>)<EOL>self.set_default_viewport()<EOL>self.fbo.use()<EOL>
Creates a standalone ``moderngl.Context``.
The headless window currently have no event input from keyboard or mouse.

Using this window require either ``settings`` values to be present:

* ``HEADLESS_FRAMES``: How many frames should be rendered before closing the window
* ``HEADLESS_DURATION``: How many seconds rendering should last before the window closes