<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _valid_other_type(x, types):
 """ Do all elements of x have a type from types? """

    return all(any(isinstance(el, t) for t in types) for el in np.ravel(x))