docs: def occurrences(coll, value=None, **options):
      """Return the occurrences of the elements in the collection
  
      :param coll: a collection
      :param value: a value in the collection
      :param options: 
          an optional keyword used as a criterion to filter the
          values in the collection
      :returns: the frequency of the values in the collection as a dictionary
  
      >>> occurrences((1, 1, 2, 3))
      {1: 2, 2: 1, 3: 1}
      >>> occurrences((1, 1, 2, 3), 1)
      2
  
      Filter the values of the occurrences that are 
      <, <=, >, >=, == or != than a given number::
  
          >>> occurrences((1, 1, 2, 3), lt=3)
          {1: 2, 2: 1, 3: 1}
          >>> occurrences((1, 1, 2, 3), gt=1)
          {1: 2}
          >>> occurrences((1, 1, 2, 3), ne=1)
          {1: 2}
  
      """
      count = {}
      for element in coll:
          count[element] = count.get(element, 0) + 1
  
      if options:
          count = _filter_occurrences(count, options)
  
      if value:
          count = count.get(value, 0)
      return count