from operator import contains


def contains_federated_types(type_signature):
  """Returns whether or not `type_signature` contains a federated type."""
  return contains(type_signature, lambda t: t.is_federated())