def _populate_env(value):
    cwd = os.getcwd()
    # in here we may place some 'special' placeholders
    # that get replaced by blockade itself
    builtins = {
        # usually $PWD is set by the shell anyway but
        # blockade is often used in terms of sudo that sometimes
        # removes various environment variables
        'PWD': cwd,
        'CWD': cwd
        }

    def get_env_value(match):
        key = match.group(1)
        env = os.environ.get(key) or builtins.get(key)
        if not env:
            raise BlockadeConfigError((key) % "there is no environment variable '$%s'")
        return env
    return re.sub(r"\${([a-zA-Z][-_a-zA-Z0-9]*)}", get_env_value, value)
dataset/ETHPy150Open dcm-oss/blockade/blockade/config.py/_populate_env/swapped operands of `%`