def METHOD_NAME():
    logger.info(f"Running OpenLineage dbt wrapper version {__version__}")
    logger.info("This wrapper will send OpenLineage events at the end of dbt execution.")
    args = sys.argv[1:]
    target = parse_single_arg(args, ['-t', '--target'])
    project_dir = parse_single_arg(args, ['--project-dir'], default='./')
    profile_name = parse_single_arg(args, ['--profile'])
    # We can get this if we have been orchestrated by an external system like airflow
    parent_id = os.getenv("OPENLINEAGE_PARENT_ID")
    parent_run_metadata = None
    job_namespace = os.environ.get(
        'OPENLINEAGE_NAMESPACE',
        'dbt'
    )
    client = OpenLineageClient()
    if parent_id:
        parent_namespace, parent_job_name, parent_run_id = parent_id.split('/')
        parent_run_metadata = ParentRunMetadata(
            run_id=parent_run_id,
            job_name=parent_job_name,
            job_namespace=parent_namespace
        )
    processor = DbtLocalArtifactProcessor(
        producer=PRODUCER,
        target=target,
        job_namespace=job_namespace,
        project_dir=project_dir,
        profile_name=profile_name,
        logger=logger
    )
    # Always emit "wrapping event" around dbt run. This indicates start of dbt execution, since
    # both the start and complete events for dbt models won't get emitted until end of execution.
    start_event = dbt_run_event_start(
        job_name=f"dbt-run-{processor.project_name}",
        job_namespace=job_namespace,
        parent_run_metadata=parent_run_metadata
    )
    dbt_run_metadata = ParentRunMetadata(
        run_id=start_event.run.runId,
        job_name=start_event.job.name,
        job_namespace=start_event.job.namespace
    )
    # Failed start event emit should not stop dbt command from running.
    try:
        client.emit(start_event)
    except Exception as e:
        logger.warning("OpenLineage client failed to emit start event. Exception: %s", e)
    # Set parent run metadata to use it as parent run facet
    processor.dbt_run_metadata = dbt_run_metadata
    pre_run_time = time.time()
    # Execute dbt in external process
    process = subprocess.Popen(
        ["dbt"] + sys.argv[1:],
        stdout=sys.stdout,
        stderr=sys.stderr
    )
    return_code = process.wait()
    # If run_result has modification time before dbt command
    # or does not exist, do not emit dbt events.
    try:
        if os.stat(processor.run_result_path).st_mtime < pre_run_time:
            logger.info(f"OpenLineage events not emitted: run_result file "
                        f"({processor.run_result_path}) was not modified by dbt")
            return
    except FileNotFoundError:
        logger.info(f"OpenLineage events not emitted:"
                    f"did not find run_result file ({processor.run_result_path})")
        return
    try:
        events = processor.parse().events()
    except UnsupportedDbtCommand as e:
        # log exception message
        logger.info(e)
        events = []
    if return_code == 0:
        last_event = dbt_run_event_end(
            run_id=dbt_run_metadata.run_id,
            job_namespace=dbt_run_metadata.job_namespace,
            job_name=dbt_run_metadata.job_name,
            parent_run_metadata=parent_run_metadata
        )
    else:
        last_event = dbt_run_event_failed(
            run_id=dbt_run_metadata.run_id,
            job_namespace=dbt_run_metadata.job_namespace,
            job_name=dbt_run_metadata.job_name,
            parent_run_metadata=parent_run_metadata
        )
    for event in tqdm(
        events + [last_event],
        desc="Emitting OpenLineage events",
        initial=1,
        total=len(events) + 2,
    ):
        client.emit(event)
    logger.info(f"Emitted {len(events) + 2} openlineage events")