# Buggy code
def _GetStatus(self):
    """Returns a status dictionary.

    Returns:
      dict [str, object]: status attributes, indexed by name.
    """
    if self._parser_mediator:
        number_of_produced_errors = self._parser_mediator.number_of_produced_errors
        number_of_produced_events = self._parser_mediator.number_of_produced_events
        number_of_produced_sources = (
            self._parser_mediator.number_of_produced_event_sources
        )
    else:
        number_of_produced_errors = 0
        number_of_produced_events = 0
        number_of_produced_sources = 0

    if self._extraction_worker:
        processing_status = self._extraction_worker.processing_status
    else:
        processing_status = self._status

    status = {
        "display_name": self._current_display_name,
        "identifier": self._name,
        "number_of_consumed_errors": 0,
        "number_of_consumed_events": self._number_of_consumed_events,
        "number_of_consumed_sources": self._number_of_consumed_sources,
        "number_of_produced_errors": number_of_produced_errors,
        "number_of_produced_events": number_of_produced_events,
        "number_of_produced_sources": number_of_produced_sources,
        "processing_status": processing_status,
        "task_identifier": self._task_identifier,
    }

    self._status_is_running = status.get("is_running", False)
    return status


# Traceback (ValueError)
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/multi_processing/engine.py", line 688, in _StatusUpdateThreadMain
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/multi_processing/engine.py", line 225, in _CheckStatusWorkerProcess
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/multi_processing/engine.py", line 865, in _UpdateProcessingStatus
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/engine/processing_status.py", line 321, in UpdateWorkerStatus
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/engine/processing_status.py", line 236, in _UpdateProcessStatus
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/engine/processing_status.py", line 166, in UpdateNumberOfEventSources
ValueError: Number of produced sources smaller than previous update.

# Fixed code
def _GetStatus(self):
    """Returns a status dictionary.

    Returns:
      dict [str, object]: status attributes, indexed by name.
    """
    if self._parser_mediator:
        number_of_produced_errors = self._parser_mediator.number_of_produced_errors
        number_of_produced_events = self._parser_mediator.number_of_produced_events
        number_of_produced_sources = (
            self._parser_mediator.number_of_produced_event_sources
        )
    else:
        number_of_produced_errors = None
        number_of_produced_events = None
        number_of_produced_sources = None

    if self._extraction_worker:
        processing_status = self._extraction_worker.processing_status
    else:
        processing_status = self._status

    status = {
        "display_name": self._current_display_name,
        "identifier": self._name,
        "number_of_consumed_errors": None,
        "number_of_consumed_events": self._number_of_consumed_events,
        "number_of_consumed_sources": self._number_of_consumed_sources,
        "number_of_produced_errors": number_of_produced_errors,
        "number_of_produced_events": number_of_produced_events,
        "number_of_produced_sources": number_of_produced_sources,
        "processing_status": processing_status,
        "task_identifier": self._task_identifier,
    }

    self._status_is_running = status.get("is_running", False)
    return status