def METHOD_NAME(project, asset, task):
    ''' Sets context for pyblish (must be done before pyblish is launched)
    :param project: Name of `Project` where instance should be published
    :type project: str
    :param asset: Name of `Asset` where instance should be published
    :type asset: str
    '''
    os.environ["AVALON_PROJECT"] = project
    legacy_io.Session["AVALON_PROJECT"] = project
    os.environ["AVALON_ASSET"] = asset
    legacy_io.Session["AVALON_ASSET"] = asset
    if not task:
        task = ''
    os.environ["AVALON_TASK"] = task
    legacy_io.Session["AVALON_TASK"] = task
    legacy_io.Session["current_dir"] = os.path.normpath(os.getcwd())
    os.environ["AVALON_APP"] = HOST_NAME
    legacy_io.Session["AVALON_APP"] = HOST_NAME