def METHOD_NAME(self):
    def _initialize_progress_bar(num_tasks):
        """When an event of compilation starts, this function will be called, and
        will initialize the progress bar.
        Args:
            num_tasks: Number of compilation tasks the progress bar will track
        """
        self.start(num_tasks)
    self.subscribe("terra.parallel.start", _initialize_progress_bar)
    def _update_progress_bar(progress):
        """When an event of compilation completes, this function will be called, and
        will update the progress bar indication.
        Args:
            progress: Number of tasks completed
        """
        self.update(progress)
    self.subscribe("terra.parallel.done", _update_progress_bar)
    def _finish_progress_bar():
        """When an event of compilation finishes (meaning that there's no more circuits to
        compile), this function will be called, unsubscribing from all events and
        finishing the progress bar."""
        self.unsubscribe("terra.parallel.start", _initialize_progress_bar)
        self.unsubscribe("terra.parallel.done", _update_progress_bar)
        self.unsubscribe("terra.parallel.finish", _finish_progress_bar)
        self.finished()
    self.subscribe("terra.parallel.finish", _finish_progress_bar)