Create a new environment
979946
function (state, cli) {

    var name = cli['<name>'];

    var chains = Object.keys(state.state.pointers);

    if(chains.indexOf(name) > -1) {
      console.log(`Error: Chain ${name} is already known, please choose another name.`);
      process.exit();
    }

    newChain({name}, state, (err, chaindata) => {
      if(typeof chaindata === 'string') return true;
      state.state.pointers[chaindata.name] = chaindata.chainenv;
      state.state.head = chaindata.name;
      state.saveState(true);
    });
  }
642707
def create(python, env_dir, system, prompt, bare, virtualenv_py=None):
    
    if not python or python == sys.executable:
        _create_with_this(
            env_dir=env_dir, system=system, prompt=prompt,
            bare=bare, virtualenv_py=virtualenv_py,
        )
    else:
        _create_with_python(
            python=python,
            env_dir=env_dir, system=system, prompt=prompt,
            bare=bare, virtualenv_py=virtualenv_py,
        )
113393
public function makeFromEnvironment()
    {
        $env = new EnvUtils();

        // Check that we have all variables we need
        if (!$env->hasBearerKey()) {
            throw new Exception(
                'TUTUM_AUTH is not set. Unable to create from environment'
            );
        }

        $client = new Client('', '');
        $client->setBearerKey($env->getBearerKey());

        return $client;
    }
366487
def create(self):
        """"""
        self.logger.log(logging.DEBUG, 'os.mkdir %s', self.name)
        os.mkdir(self.name)
934961
def save_new_environment(name, datadir, srcdir, ckan_version,
        deploy_target=None, always_prod=False):
    
    with open(datadir + '/.version', 'w') as f:
        f.write('2')

    cp = ConfigParser.SafeConfigParser()

    cp.read(srcdir + '/.datacats-environment')

    if not cp.has_section('datacats'):
        cp.add_section('datacats')
    cp.set('datacats', 'name', name)
    cp.set('datacats', 'ckan_version', ckan_version)

    if deploy_target:
        if not cp.has_section('deploy'):
            cp.add_section('deploy')
        cp.set('deploy', 'target', deploy_target)

    if always_prod:
        cp.set('datacats', 'always_prod', 'true')

    with open(srcdir + '/.datacats-environment', 'w') as config:
        cp.write(config)

    save_srcdir_location(datadir, srcdir)
694064
def create!(archive, stack, cnames, settings=[])
      params = {
        application_name: archive.app_name,
        version_label: archive.version,
        environment_name: self.name,
        solution_stack_name: stack,
        option_settings: settings
      }
      cnames.each do |c|
        if dns_available(c)
          params[:cname_prefix] = c
          break
        else
          puts "CNAME #{c} is unavailable."
        end
      end
      @beanstalk.create_environment(params)
    end
408584
def add_environment(self, environ):
        
        if isinstance(environ, dict):
            self._environment.update(environ)
758531
def create_api_environment_vip(self):
        """"""
        return ApiEnvironmentVip(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
351358
def create_new(projectname):
    """"""
    git_url = "https://github.com/moluwole/Bast_skeleton"
    path = os.path.abspath('.') + "/" + projectname
    if not os.path.exists(path):
        os.makedirs(path)

    click.echo(Fore.GREEN + '    ___  ___   __________')
    click.echo(Fore.GREEN + '  / _ )/ _ | / __/_  __/')
    click.echo(Fore.GREEN + ' / _  / __ |_\ \  / /')
    click.echo(Fore.GREEN + '/____/_/ |_/___/ /_/')

    click.echo(Fore.GREEN + "Creating Project at %s.... " % path)
    click.echo(Fore.GREEN + "Pulling Project Skeleton from Repo")
    try:
        Repo.clone_from(git_url, path)

        click.echo(Fore.GREEN + "Setting up project")

        shutil.rmtree(path + "/.git")

        if not os.path.exists('/.env'):
            shutil.copy(path + '/.env.example', path + '/.env')

        env_file = path + "/.env"
        if not os.path.isfile(env_file):
            shutil.copy('.env.example', '.env')
        call(['panther', 'generate:key', path])

        click.echo(Fore.GREEN + "New Bast Project created at  %s " % path)
    except Exception as e:
        click.echo(Fore.RED + "An error occurred creating a new project. Try Again.\n Reason: {}".format(e))
1031390
def _setup_environment(self):
        """"""
        # Save the original working directory so that reload can launch
        # the new process with the same arguments as the original
        self._orig_workdir = os.getcwd()

        if self.chrootdir is not None:
            try:
                # Change the root directory
                os.chdir(self.chrootdir)
                os.chroot(self.chrootdir)
            except Exception as ex:
                raise DaemonError('Unable to change root directory '
                                  '({error})'.format(error=str(ex)))

        # Prevent the process from generating a core dump
        self._prevent_core_dump()

        try:
            # Switch directories
            os.chdir(self.workdir)
        except Exception as ex:
            raise DaemonError('Unable to change working directory '
                              '({error})'.format(error=str(ex)))

        # Create the directory for the pid file if necessary
        self._setup_piddir()

        try:
            # Set file creation mask
            os.umask(self.umask)
        except Exception as ex:
            raise DaemonError('Unable to change file creation mask '
                              '({error})'.format(error=str(ex)))

        try:
            # Switch users
            os.setgid(self.gid)
            os.setuid(self.uid)
        except Exception as ex:
            raise DaemonError('Unable to setuid or setgid '
                              '({error})'.format(error=str(ex)))
1276495
def generate(env):
    """"""
    path, _cc, version = get_xlc(env)
    if path and _cc:
        _cc = os.path.join(path, _cc)

    if 'CC' not in env:
        env['CC'] = _cc

    cc.generate(env)

    if version:
        env['CCVERSION'] = version
258640
def _create(self):
        """"""

        self._raise_if_none()
        if not self._exists:
            mkdir_p(self.path)
            self._exists = True
107435
def create_equipamento_ambiente(self):
        """"""
        return EquipamentoAmbiente(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
435960
def create_ambiente_logico(self):
        """"""
        return AmbienteLogico(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
771917
def save(self):
        
        task.save_new_environment(self.name, self.datadir, self.target,
            self.ckan_version, self.deploy_target, self.always_prod)
645694
function Environment(options) {
  if (!(this instanceof Environment)) {
    return new Environment(options);
  }

  // defaults
  options = lodash.defaults(options || {}, {
    setup: true,
  });

  this.env = jjv();
  this.env.defaultOptions.checkRequired = true;
  this.env.defaultOptions.useDefault = true;
  this.env.defaultOptions.useCoerce = false;
  this._jjve = jjve(this.env);

  if (options.setup) this.setup();
}
930457
def create_environment(home_dir, site_packages=True, clear=False,
                       unzip_setuptools=False, use_distribute=False):
    
    home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)

    py_executable = os.path.abspath(install_python(
        home_dir, lib_dir, inc_dir, bin_dir,
        site_packages=site_packages, clear=clear))

    install_distutils(lib_dir, home_dir)

    if use_distribute or os.environ.get('VIRTUALENV_USE_DISTRIBUTE'):
        install_distribute(py_executable, unzip=unzip_setuptools)
    else:
        install_setuptools(py_executable, unzip=unzip_setuptools)

    install_pip(py_executable)

    install_activate(home_dir, bin_dir)