Set the environment for all nodes.
173823
def set_environment(self, environment):
        """"""
        todo = deque([self])
        while todo:
            node = todo.popleft()
            node.environment = environment
            todo.extend(node.iter_child_nodes())
        return self
1000260
def bind(self, environment):
        """"""
        rv = object.__new__(self.__class__)
        rv.__dict__.update(self.__dict__)
        rv.environment = environment
        return rv
934428
def SetEnvironmentVariable(self, environment_variable):
    
    name = environment_variable.name.upper()
    self._environment_variables[name] = environment_variable
372658
function setEnvironment (settings) {
  // Choose between inherited environment and new environment:
  if (typeof settings.options.env !== "object") {
    settings.options.env = process.env;
  }

  // Set environment variables for GET and POST requests
  // if 'inputData' is available:
  if (settings.inputData) {
    settings.options.env = setInputEnvironmentVariables(settings);
  }

  return settings.options.env;
}
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)))
270047
def setenv(self, variable, value):
    '''
    '''
    os.environ[variable] = value
    os.putenv(variable, value)
    bot.debug('%s set to %s' % (variable, value))
1006134
def set_env(self):
        """"""

        if self.cov_source is None:
            os.environ['COV_CORE_SOURCE'] = ''
        else:
            os.environ['COV_CORE_SOURCE'] = UNIQUE_SEP.join(self.cov_source)
        os.environ['COV_CORE_DATA_FILE'] = self.cov_data_file
        os.environ['COV_CORE_CONFIG'] = self.cov_config
1288925
private static void setEnv(Map<String, String> newEnv, boolean overwrite) {

		for (Entry<String, String> entry : newEnv.entrySet()) {
			if (overwrite || System.getProperty(entry.getKey()) != null) {
				System.setProperty(entry.getKey(), entry.getValue());
			}
		}

		if (!overwrite) {
			Iterator<Entry<String, String>> iterator = newEnv.entrySet().iterator();
			while (iterator.hasNext()) {
				Entry<String, String> next = iterator.next();
				if (System.getenv(next.getKey()) != null) {
					iterator.remove();
				}
			}
		}

		try {
			Class<?> processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment");
			Method variableMethod = Class.forName("java.lang.ProcessEnvironment$Variable").getMethod("valueOf", String.class);
			variableMethod.setAccessible(true);
			Method valueMethod = Class.forName("java.lang.ProcessEnvironment$Value").getMethod("valueOf", String.class);
			valueMethod.setAccessible(true);

			Map<Object, Object> newEnvVarVal = new HashMap<Object, Object>();
			for (Map.Entry<String, String> entry : newEnv.entrySet()) {
				Object key = variableMethod.invoke(null, entry.getKey());
				String valueText = entry.getValue();
				Object value = valueText != null ? valueMethod.invoke(null, valueText) : null;
				newEnvVarVal.put(key, value);
			}

			Field theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment");
			theEnvironmentField.setAccessible(true);
			Map<Object, Object> env = (Map<Object, Object>) theEnvironmentField.get(null);
			for (Entry<Object, Object> entry : newEnvVarVal.entrySet()) {
				if (entry.getValue() == null) {
					env.remove(entry.getKey());
				} else {
					env.put(entry.getKey(), entry.getValue());
				}
			}
			Field theCaseInsensitiveEnvironmentField = processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment");
			theCaseInsensitiveEnvironmentField.setAccessible(true);
			Map<Object, Object> cienv = (Map<Object, Object>) theCaseInsensitiveEnvironmentField.get(null);
			cienv.putAll(newEnvVarVal);

		} catch (NoSuchFieldException e) {
			try {
				Class[] classes = Collections.class.getDeclaredClasses();
				Map<String, String> env = System.getenv();
				for (Class cl : classes) {
					if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
						Field field = cl.getDeclaredField("m");
						field.setAccessible(true);
						Object obj = field.get(env);
						Map<String, String> map = (Map<String, String>) obj;
						for (Entry<String, String> entry : newEnv.entrySet()) {
							if (entry.getValue() == null) {
								map.remove(entry.getKey());
							} else {
								map.put(entry.getKey(), entry.getValue());
							}
						}
					}
				}
			} catch (Exception e2) {
				LOGGER.error(e2.getMessage(), e2);
			}
		} catch (Exception e1) {
			LOGGER.error(e1.getMessage(), e1);
		}
	}
74449
def setup_config(command, filename, section, vars):
    """"""
    conf = appconfig('config:' + filename)
    load_environment(conf.global_conf, conf.local_conf)
645706
private function setEnvironment()
    {
        $this->sandbox = config('pagseguro.sandbox', env('PAGSEGURO_SANDBOX', true));
        $this->email = config('pagseguro.email', env('PAGSEGURO_EMAIL', ''));
        $this->token = config('pagseguro.token', env('PAGSEGURO_TOKEN', ''));
        $this->notificationURL = config('pagseguro.notificationURL', env('PAGSEGURO_NOTIFICATION', ''));
    }
1078106
public void setRoot(int context, Object environment)
  {

    m_context = context;
    
    XPathContext xctxt = (XPathContext)environment;
    m_execContext = xctxt;
    m_cdtm = xctxt.getDTM(context);
    
    m_currentContextNode = context; // only if top level?
    
    // Yech, shouldn't have to do this.  -sb
    if(null == m_prefixResolver)
    	m_prefixResolver = xctxt.getNamespaceContext();
        
    m_lastFetched = DTM.NULL;
    m_foundLast = false;
    m_pos = 0;
    m_length = -1;

    if (m_isTopLevel)
      this.m_stackFrame = xctxt.getVarStack().getStackFrame();
      
    // reset();
  }
85332
public void setDomainEnvironment() {
        systemProperties = System.getProperties();
        if (System.getProperty(SET_DOMAIN_ENVIRONMENT) != null) {
            logger.debug("Setting System environment properties to Security Domain values");
            for (int i = 0; i < ENVNAMES.length; i++) {
                setOrClearSystemProperties(ENVNAMES[i], domainProperties);
            }
        }
    }
1114946
def set_global(node: Node, key: str, value: Any):
    """"""
    node.node_globals[key] = value
339871
public void setupEnvironment(Hashtable<String, Object> env, String userDn, String password) {
		env.put(Context.SECURITY_AUTHENTICATION, SIMPLE_AUTHENTICATION);
		env.put(Context.SECURITY_PRINCIPAL, userDn);
		env.put(Context.SECURITY_CREDENTIALS, password);
	}
1285695
public static void initEnvironment() {
		// init logging system if not specified
		if (System.getProperty("org.apache.commons.logging.Log") == null)
			System.setProperty("org.apache.commons.logging.Log", "net.lecousin.framework.log.bridges.ApacheCommonsLogging");
		
		// register protocols
		String protocols = System.getProperty("java.protocol.handler.pkgs");
		if (protocols == null) protocols = "";
		if (!protocols.contains("net.lecousin.framework.protocols")) {
			if (protocols.length() > 0) protocols += "|";
			protocols += "net.lecousin.framework.protocols";
			System.setProperty("java.protocol.handler.pkgs", protocols);
		}
	}
513974
private function setEnvironmentOptions()
    {
        if (empty($this->environment)) {
            return;
        }

        if (is_object($this->client) && property_exists($this->client, 'environment')) {
            $this->client->environment = $this->environment;
        }
        $this->jsOptions['environment'] = $this->environment;
    }
621526
public void setEnvironments(java.util.Collection<EnvironmentDescription> environments) {
        if (environments == null) {
            this.environments = null;
            return;
        }

        this.environments = new com.amazonaws.internal.SdkInternalList<EnvironmentDescription>(environments);
    }