<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init(config, workdir=None, logfile=None, loglevel=logging.INFO, **kwargs):
 """ 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 """


    setup_sdk_logging(logfile, loglevel)
    defaults = lago_config.get_section('init')
    if workdir is None:
        workdir = os.path.abspath('.lago')
    defaults['workdir'] = workdir
    defaults['virt_config'] = config
    defaults.update(kwargs)
    workdir, prefix = cmd.do_init(**defaults)
    return SDK(workdir, prefix)