docs: def year_origin_filter(year_predicate=None, origin_predicate=None):
      """\
      Returns a predicate for cable identifiers where `year_predicate` and
      `origin_predicate` must hold true.
  
      If `year_predicate` and `origin_predicate` is ``None`` the returned
      predicate holds always true.
  
  
      `year_predicate`
          A predicate which returns ``True`` or ``False`` for a cable
          year.
      ``origin_predicate`
          A predicate which returns ``True`` or ``False`` for a given
          cable origin
      """
  
      def accept(cable_id, predicate):
          year, origin = _YEAR_ORIGIN_PATTERN.match(
              canonicalize_id(cable_id)).groups()
          return predicate(year, origin)
  
      if year_predicate and origin_predicate:
          return partial(accept, predicate=lambda y, o: year_predicate(y) \
                                                        and origin_predicate(o))
      elif year_predicate:
          return partial(accept, predicate=lambda y, o: year_predicate(y))
      elif origin_predicate:
          return partial(accept, predicate=lambda y, o: origin_predicate(o))
      return lambda cable_id: True