def find_common_type(types):
if len(types) == <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>first = types[<NUM_LIT:0>]<EOL>if all(is_dtype_equal(first, t) for t in types[<NUM_LIT:1>:]):<EOL><INDENT>return first<EOL><DEDENT>if any(isinstance(t, (PandasExtensionDtype, ExtensionDtype))<EOL>for t in types):<EOL><INDENT>return np.object<EOL><DEDENT>if all(is_datetime64_dtype(t) for t in types):<EOL><INDENT>return np.dtype('<STR_LIT>')<EOL><DEDENT>if all(is_timedelta64_dtype(t) for t in types):<EOL><INDENT>return np.dtype('<STR_LIT>')<EOL><DEDENT>has_bools = any(is_bool_dtype(t) for t in types)<EOL>if has_bools:<EOL><INDENT>for t in types:<EOL><INDENT>if is_integer_dtype(t) or is_float_dtype(t) or is_complex_dtype(t):<EOL><INDENT>return np.object<EOL><DEDENT><DEDENT><DEDENT>return np.find_common_type(types, [])<EOL>
Find a common data type among the given dtypes.

Parameters
----------
types : list of dtypes

Returns
-------
pandas extension or numpy dtype

See Also
--------
numpy.find_common_type