Update occurrences.py

Added docstring