not_empty_intersect

cocohelper.utils.utils.not_empty_intersect(a, b)[source]

Return intersection of a and b if both a and b are not empty sets. If one of those is an empty set, it returns the non-empty set. If both are empty set, returns an empty set

Parameters:
  • a (set) – A python set.

  • b (set) – Another python set.

Returns:

Intersection of a and b if both a and b are not empty, otherwise the non-empty set.

Return type:

set