def convert_to_env_data(mgr, env_paths, validator_func, activate_func,<EOL>name_template, display_name_template, name_prefix):
env_data = {}<EOL>for venv_dir in env_paths:<EOL><INDENT>venv_name = os.path.split(os.path.abspath(venv_dir))[<NUM_LIT:1>]<EOL>kernel_name = name_template.format(name_prefix + venv_name)<EOL>kernel_name = kernel_name.lower()<EOL>if kernel_name in env_data:<EOL><INDENT>mgr.log.debug(<EOL>"<STR_LIT>",<EOL>kernel_name, venv_dir)<EOL>continue<EOL><DEDENT>argv, language, resource_dir = validator_func(venv_dir)<EOL>if not argv:<EOL><INDENT>continue<EOL><DEDENT>display_name = display_name_template.format(kernel_name)<EOL>kspec_dict = {"<STR_LIT>": argv, "<STR_LIT>": language,<EOL>"<STR_LIT>": display_name,<EOL>"<STR_LIT>": resource_dir<EOL>}<EOL>def loader(env_dir=venv_dir, activate_func=activate_func, mgr=mgr):<EOL><INDENT>mgr.log.debug("<STR_LIT>" % env_dir)<EOL>res = activate_func(mgr, env_dir)<EOL>return res<EOL><DEDENT>kspec = EnvironmentLoadingKernelSpec(loader, **kspec_dict)<EOL>env_data.update({kernel_name: (resource_dir, kspec)})<EOL><DEDENT>return env_data<EOL>
Converts a list of paths to environments to env_data.

    env_data is a structure {name -> (ressourcedir, kernel spec)}