def METHOD_NAME(flask_apm_client):
    from celery import Celery
    flask_app = flask_apm_client.app
    celery = Celery(flask_app.import_name, backend=None, broker=None)
    celery.conf.update(CELERY_ALWAYS_EAGER=True)
    TaskBase = celery.Task
    class ContextTask(TaskBase):
        abstract = True
        def __call__(self, *args, **kwargs):
            with flask_app.app_context():
                return TaskBase.__call__(self, *args, **kwargs)
    celery.Task = ContextTask
    celery.flask_apm_client = flask_apm_client
    return celery