jacinle.config.environ#
Classes
A global environment object. |
Functions
|
Get a value of a environment provided a key. |
|
Check whether a key is in current env object. |
|
|
|
Set an environment value by key-value pair. |
|
|
|
Class Environ
- class Environ[source]#
Bases:
object
A global environment object.
- __new__(**kwargs)#
- get(default=None)[source]#
Get a value of a environment provided a key. You can provide a default value, but this value will not affect the env object.
- Parameters:
key – the key. Dict of dict can (should) be imploded by
.
.default – the default value.
- Returns:
The value if the env contains the given key, otherwise the default value provided.
- set(value=None, do_inc=False, do_replace=True, inc_default=0)[source]#
Set an environment value by key-value pair.
- Parameters:
- Returns:
self
Functions
- get_env()#
Get a value of a environment provided a key. You can provide a default value, but this value will not affect the env object.
- Parameters:
key – the key. Dict of dict can (should) be imploded by
.
.default – the default value.
- Returns:
The value if the env contains the given key, otherwise the default value provided.
- has_env(key)#
Check whether a key is in current env object.
- load_env()#
- set_env(do_inc=False, do_replace=True, inc_default=0)#
Set an environment value by key-value pair.
- Parameters:
- Returns:
self
- update_env(env_spec)#