@classmethod
def initialize(cls, application_id: str, application_version: str, upload_enabled: bool, configuration: Optional[Configuration]=None, data_dir: Optional[Path]=None):
    '\n        Initialize the Glean SDK.\n\n        This should only be initialized once by the application, and not by\n        libraries using the Glean SDK. A message is logged to error and no\n        changes are made to the state if initialize is called a more than\n        once.\n\n        Args:\n            application_id (str): The application id to use when sending pings.\n            application_version (str): The version of the application sending\n                Glean data.\n            upload_enabled (bool): Controls whether telemetry is enabled. If\n                disabled, all persisted metrics, events and queued pings\n                (except first_run_date) are cleared.\n            configuration (glean.config.Configuration): (optional) An object with\n                global settings.\n            data_dir (pathlib.Path): (optional) The path to the Glean data\n                directory. If not provided, uses a temporary directory.\n        '
    if cls.is_initialized():
        return
    if (configuration is None):
        configuration = Configuration()
    if (data_dir is None):
        data_dir = Path(tempfile.TemporaryDirectory().name)
        cls._destroy_data_dir = True
    else:
        cls._destroy_data_dir = False
    cls._data_dir = data_dir
    cls._configuration = configuration
    cls._application_id = application_id
    cls._application_version = application_version
    cls._upload_enabled = upload_enabled
    cfg = _ffi.make_config(cls._data_dir, application_id, cls._upload_enabled, configuration.max_events)
    cls._initialized = (_ffi.lib.glean_initialize(cfg) != 0)
    if (not cls._initialized):
        return
    for ping in cls._ping_type_queue:
        cls.register_ping_type(ping)
    cls._initialize_core_metrics()

    @Dispatcher.launch_at_front
    def submit_pending_events():
        if _ffi.lib.glean_on_ready_to_submit_pings():
            PingUploadWorker.process()
    Dispatcher.flush_queued_initial_tasks()
    if (cls._upload_enabled is False):

        @Dispatcher.launch
        def check_pending_deletion_request():
            DeletionPingUploadWorker.process()
Initialize the Glean SDK.

This should only be initialized once by the application, and not by
libraries using the Glean SDK. A message is logged to error and no
changes are made to the state if initialize is called a more than
once.

Args:
    application_id (str): The application id to use when sending pings.
    application_version (str): The version of the application sending
        Glean data.
    upload_enabled (bool): Controls whether telemetry is enabled. If
        disabled, all persisted metrics, events and queued pings
        (except first_run_date) are cleared.
    configuration (glean.config.Configuration): (optional) An object with
        global settings.
    data_dir (pathlib.Path): (optional) The path to the Glean data
        directory. If not provided, uses a temporary directory.
@classmethod
def initialize(cls, application_id: str, application_version: str, upload_enabled: bool, configuration: Optional[Configuration]=None, data_dir: Optional[Path]=None):
    '\n        Initialize the Glean SDK.\n\n        This should only be initialized once by the application, and not by\n        libraries using the Glean SDK. A message is logged to error and no\n        changes are made to the state if initialize is called a more than\n        once.\n\n        Args:\n            application_id (str): The application id to use when sending pings.\n            application_version (str): The version of the application sending\n                Glean data.\n            upload_enabled (bool): Controls whether telemetry is enabled. If\n                disabled, all persisted metrics, events and queued pings\n                (except first_run_date) are cleared.\n            configuration (glean.config.Configuration): (optional) An object with\n                global settings.\n            data_dir (pathlib.Path): (optional) The path to the Glean data\n                directory. If not provided, uses a temporary directory.\n        '
    if cls.is_initialized():
        return
    if (configuration is None):
        configuration = Configuration()
    if (data_dir is None):
        data_dir = Path(tempfile.TemporaryDirectory().name)
        cls._destroy_data_dir = True
    else:
        cls._destroy_data_dir = False
    cls._data_dir = data_dir
    cls._configuration = configuration
    cls._application_id = application_id
    cls._application_version = application_version
    cls._upload_enabled = upload_enabled
    cfg = _ffi.make_config(cls._data_dir, application_id, cls._upload_enabled, configuration.max_events)
    cls._initialized = (_ffi.lib.glean_initialize(cfg) != 0)
    if (not cls._initialized):
        return
    for ping in cls._ping_type_queue:
        cls.register_ping_type(ping)
    cls._initialize_core_metrics()

    @Dispatcher.launch_at_front
    def submit_pending_events():
        if _ffi.lib.glean_on_ready_to_submit_pings():
            PingUploadWorker.process()
    Dispatcher.flush_queued_initial_tasks()
    if (cls._upload_enabled is False):

        @Dispatcher.launch
        def check_pending_deletion_request():
            DeletionPingUploadWorker.process()