Serialize and write self to environ[self._envvar].

        Parameters
        ----------
        environ : dict-like
            Dict-like object (e.g. os.environ) into which to write ``self``.
518136
def to_environ(self, environ, skip=()):
        
        environ[ensure_unicode(type(self).__name__)] = (
            ensure_unicode(self.to_base64(skip=skip))
        )
408584
def add_environment(self, environ):
        
        if isinstance(environ, dict):
            self._environment.update(environ)
1320328
def _set_environment(self, environ):
        """"""
        if environ:
            q_environ = self._process.processEnvironment()
            for k, v in environ.items():
                q_environ.insert(k, v)
            self._process.setProcessEnvironment(q_environ)
774463
def prepare_env(cls):
        
        os.environ['PATH'] = cls.get_env_path()
        return os.path.basename(Finder.python())
966797
def _get_updated_environment(self, env_dict=None):
        

        if env_dict is None:
            env_dict = {'S': self}

        env = globals().copy()
        env.update(env_dict)

        return env
439748
def env(self, **kw):
        '''
        
        '''
        self._original_env = kw
        if self._env is None:
            self._env = dict(os.environ)
        self._env.update({k: unicode(v) for k, v in kw.iteritems()})
        return self
182798
def _setup_process_environment(self, env):
        
        environ = self._process.processEnvironment()
        if env is None:
            env = {}
        for k, v in os.environ.items():
            environ.insert(k, v)
        for k, v in env.items():
            environ.insert(k, v)
        if sys.platform != 'win32':
            environ.insert('TERM', 'xterm')
            environ.insert('LINES', '24')
            environ.insert('COLUMNS', '450')
        environ.insert('PYTHONUNBUFFERED', '1')
        environ.insert('QT_LOGGING_TO_CONSOLE', '1')
        return environ
544519
def env(self):
        
        from copy import copy

        env = copy(self.doc.env)

        assert env is not None, 'Got a null execution context'

        env.update(self._envvar_env)

        env.update(self.all_props)

        return env
1372965
def _setup_environ(self):
        
        _pam_env_watcher.check()
        _etc_env_watcher.check()
        env = dict(self.extra_env or {})
        if self.env:
            env.update(self.env)
        self._env = TemporaryEnvironment(env)
824551
def create_environment(self, environment):
        

        uri = 'api/v3/environment/'

        data = dict()
        data['environments'] = list()
        data['environments'].append(environment)

        return super(ApiEnvironment, self).post(uri, data)
1102759
def create_environment_dict(overrides):
    
    result = os.environ.copy()
    result.update(overrides or {})
    return result
1230345
def initialize_env(env_file=None, fail_silently=True, load_globally=True):
    
    data = {}
    data.update(os.environ)
    if env_file:
        data.update(read_file_values(env_file, fail_silently))
    
    if load_globally:
        os.environ.update(data)
    
    return Environment(env_dict=data)
198583
def inject_proxy_environment(self, environment):
        '''
        
        '''
        if not self:
            return environment

        proxy_env = format_environment(self.get_environment())
        if not environment:
            return proxy_env
        # It is important to prepend our variables, because we want the
        # variables defined in "environment" to take precedence.
        return proxy_env + environment
774281
def flatten_and_write(dotenv_path, dotenv_as_dict, quote_mode='always'):
    
    with open(dotenv_path, 'w') as f:
        for k, v in dotenv_as_dict.items():
            str_format = _get_format(v, quote_mode)
            f.write(str_format.format(key=k, value=v))
    return True
676496
def __convert_env(env, encoding):
    """"""
    d = dict(os.environ, **(oget(env, {})))

    # workaround for Windows+Python3 environment
    if not SHOULD_NOT_ENCODE_ARGS:
        return dict((k.encode(encoding), v.encode(encoding)) for k, v in d.items())
    else:
        return d
1272038
def load_environment_config():
    
    mapper = {
        'interface': 'CAN_INTERFACE',
        'channel': 'CAN_CHANNEL',
        'bitrate': 'CAN_BITRATE',
    }
    return dict(
        (key, os.environ.get(val))
        for key, val in mapper.items()
        if val in os.environ
    )
453296
def serialize_for_env(v)
      case v
      when String
        v
      when NilClass
        nil
      when Array
        JSON.dump(v)
      else
        fail ArgumentError, "Can't represent a #{v.class} in the environment"
      end
    end