def METHOD_NAME(experiment):
    # Configure Expyriment
    io.defaults.mouse_track_button_events = False
    control.defaults.initialize_delay = 0
    control.defaults.event_logging = 0
    control.defaults.window_mode = experiment.var.fullscreen != u'yes'
    control.defaults.fast_quit = True
    control.defaults.window_size = experiment.resolution()
    control.defaults.auto_create_subject_id = True
    control.defaults.open_gl = experiment.var.get(u'expyriment_opengl',
                                                  xpyriment.settings[u'expyriment_opengl'][u'default']) == u'yes'
    control.defaults.audiosystem_sample_rate = experiment.var.sound_freq
    control.defaults.audiosystem_bit_depth = \
        experiment.var.sound_sample_size
    control.defaults.audiosystem_channels = experiment.var.sound_channels
    control.defaults.audiosystem_buffer_size = \
        experiment.var.sound_buf_size
    control.defaults.audiosystem_autostart = False
    # Initialize. If Expyriment jumps into interactive mode, it reads from
    # the stdin, and crashes. Thus we explicitly disable the interactive-
    # mode detection. The is_interactive_mode() function is located
    # differently in different versions of expyriment, and hence we monkey
    # patch it twice.
    control._experiment_control.misc.is_interactive_mode = \
        control._experiment_control.is_interactive_mode = \
        lambda: False
    exp = control.initialize()
    experiment.window = exp.screen._surface
    experiment.expyriment = exp
    # TODO: In order to set the window title and to allow mouse responses we
    # need to bypass expyriment for now
    pygame.display.set_caption(u'OpenSesame (Expyriment backend)')
    pygame.event.set_allowed(pygame.MOUSEBUTTONDOWN)
    pygame.event.set_allowed(pygame.MOUSEBUTTONUP)