contains Any
Checks whether any of the given keys matches a leaf on the CompositeKey tree or a single PublicKey.
Note that this function checks against leaves, which cannot be of type CompositeKey. Due to that, if any of the otherKeys is a CompositeKey, this function will not find a match.