def distutils_scheme(dist_name, user=False, home=None, root=None,<EOL>isolated=False, prefix=None):<EOL>
from distutils.dist import Distribution<EOL>scheme = {}<EOL>if isolated:<EOL><INDENT>extra_dist_args = {"<STR_LIT>": ["<STR_LIT>"]}<EOL><DEDENT>else:<EOL><INDENT>extra_dist_args = {}<EOL><DEDENT>dist_args = {'<STR_LIT:name>': dist_name}  <EOL>dist_args.update(extra_dist_args)<EOL>d = Distribution(dist_args)<EOL>d.parse_config_files()<EOL>i = d.get_command_obj('<STR_LIT>', create=True)  <EOL>assert i is not None<EOL>assert not (user and prefix), "<STR_LIT>".format(user, prefix)<EOL>i.user = user or i.user<EOL>if user:<EOL><INDENT>i.prefix = "<STR_LIT>"<EOL><DEDENT>i.prefix = prefix or i.prefix<EOL>i.home = home or i.home<EOL>i.root = root or i.root<EOL>i.finalize_options()<EOL>for key in SCHEME_KEYS:<EOL><INDENT>scheme[key] = getattr(i, '<STR_LIT>' + key)<EOL><DEDENT>if '<STR_LIT>' in d.get_option_dict('<STR_LIT>'):  <EOL><INDENT>scheme.update(dict(purelib=i.install_lib, platlib=i.install_lib))<EOL><DEDENT>if running_under_virtualenv():<EOL><INDENT>scheme['<STR_LIT>'] = os.path.join(<EOL>sys.prefix,<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>' + sys.version[:<NUM_LIT:3>],<EOL>dist_name,<EOL>)<EOL>if root is not None:<EOL><INDENT>path_no_drive = os.path.splitdrive(<EOL>os.path.abspath(scheme["<STR_LIT>"]))[<NUM_LIT:1>]<EOL>scheme["<STR_LIT>"] = os.path.join(<EOL>root,<EOL>path_no_drive[<NUM_LIT:1>:],<EOL>)<EOL><DEDENT><DEDENT>return scheme<EOL>
Return a distutils install scheme