Writes dotenv_as_dict to dotenv_path, flattening the values
    :param dotenv_path: .env path
    :param dotenv_as_dict: dict
    :param quote_mode:
    :return:

def flatten_and_write(dotenv_path, dotenv_as_dict, quote_mode='always'):
    """
    Writes dotenv_as_dict to dotenv_path, flattening the values
    :param dotenv_path: .env path
    :param dotenv_as_dict: dict
    :param quote_mode:
    :return:
    """
    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