def METHOD_NAME(self, store_events):
    if self.tokenized_event_source == "pregenerated":
        with open(self.event_path, "rb") as file_obj:
            store_sample = pickle.load(file_obj)
            if store_events and (
                "PYTEST_XDIST_WORKER" not in os.environ
                or os.environ.get("PYTEST_XDIST_WORKER") == "gw0"
            ):
                try:
                    tokenized_events = store_sample.get("tokenized_events")
                    self.store_events(tokenized_events)
                except Exception as e:
                    pytest.exit(str(e))
            return store_sample
    if "PYTEST_XDIST_WORKER" in os.environ:
        file_path = os.environ.get("PYTEST_XDIST_TESTRUNUID") + "_events"
        with FileLock(str(file_path) + ".lock"):
            if os.path.exists(file_path):
                with open(file_path, "rb") as file_obj:
                    store_sample = pickle.load(file_obj)
            else:
                sample_generator = SampleGenerator(
                    self.addon_path, self.config_path
                )
                tokenized_events = list(sample_generator.METHOD_NAME())
                store_sample = {
                    "conf_name": SampleGenerator.conf_name,
                    "tokenized_events": tokenized_events,
                }
                if store_events:
                    self.store_events(tokenized_events)
                with open(file_path, "wb") as file_obj:
                    pickle.dump(store_sample, file_obj)
    else:
        sample_generator = SampleGenerator(self.addon_path, self.config_path)
        tokenized_events = list(sample_generator.METHOD_NAME())
        store_sample = {
            "conf_name": SampleGenerator.conf_name,
            "tokenized_events": tokenized_events,
        }
        if store_events:
            self.store_events(tokenized_events)
    if self.tokenized_event_source == "store_new" and not self.event_stored:
        with open(self.event_path, "wb") as file_obj:
            pickle.dump(store_sample, file_obj)
        self.event_stored = True
    return store_sample