def _auto_user(self, python):
        if python == sys.executable:
            user_site = site.ENABLE_USER_SITE
            lib_dir = sysconfig.get_path('purelib')
        else:
            out = self._run_python(code=
                ("import sysconfig, site; "
                 "print(site.ENABLE_USER_SITE); "
                 "print(sysconfig.get_path('purelib'))"))
            user_site, lib_dir = out.split('\n', 1)
            user_site = (user_site.strip() == 'True')
            lib_dir = lib_dir.strip()

        if not user_site:
            # No user site packages - probably a virtualenv
            log.debug('User site packages not available - env install')
            return False

        log.debug('Checking access to %s', lib_dir)
        return not test_writable_dir(lib_dir)
Create a subnet.
dataset/ETHPy150Open takluyver/flit/flit/install.py/Installer._auto_user--crossover with--dataset/ETHPy150Open openstack/compass-core/compass/db/api/network.py/add_subnet