def init(config, workdir=None, logfile=None, loglevel=logging.INFO, **kwargs):
setup_sdk_logging(logfile, loglevel)<EOL>defaults = lago_config.get_section('<STR_LIT>')<EOL>if workdir is None:<EOL><INDENT>workdir = os.path.abspath('<STR_LIT>')<EOL><DEDENT>defaults['<STR_LIT>'] = workdir<EOL>defaults['<STR_LIT>'] = config<EOL>defaults.update(kwargs)<EOL>workdir, prefix = cmd.do_init(**defaults)<EOL>return SDK(workdir, prefix)<EOL>
Initialize the Lago environment

Args:
    config(str): Path to LagoInitFile
    workdir(str): Path to initalize the workdir, defaults to "$PWD/.lago"
    **kwargs(dict): Pass arguments to :func:`~lago.cmd.do_init`
    logfile(str): A path to setup a log file.
    loglevel(int): :mod:`logging` log level.

Returns:
    :class:`~lago.sdk.SDK`: Initialized Lago enviornment

Raises:
   :exc:`~lago.utils.LagoException`: If initialization failed