Get the path to the ugali data directory from the environment

def get_ugali_dir():
    """Get the path to the ugali data directory from the environment"""

    dirname = os.getenv('UGALIDIR')

    # Get the HOME directory
    if not dirname:
        dirname=os.path.join(os.getenv('HOME'),'.ugali')

    if not os.path.exists(dirname):
        from ugali.utils.logger import logger
        msg = "Creating UGALIDIR:\n%s"%dirname
        logger.warning(msg)

    return mkdir(dirname)