human
Complete the below
@pytest.fixture()
def write_config_file(tmpdir):

    ''''Returns a function that writes a config file.'
    '''
 ... Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.
    def _write(config, data, scope):
        config_yaml = tmpdir.join(scope, (config + '.yaml'))
        config_yaml.ensure()
        with config_yaml.open('w') as f:
            yaml.dump(data, f)
    return _write