def _find_common_type(types):
 if (len(types) == 0):
  raise ValueError('no types given')
 first = types[0]
 if all((is_dtype_equal(first, t) for t in types[1:])):
  return first
 if any((isinstance(t, ExtensionDtype) for t in types)):
  return np.object
 if all((is_datetime64_dtype(t) for t in types)):
  return np.dtype('datetime64[ns]')
 if all((is_timedelta64_dtype(t) for t in types)):
  return np.dtype('timedelta64[ns]')
 return np.find_common_type(types, [])

def _find_common_type ( types ) : if ( len ( types ) == 0 ) : raise ValueError ( 'no types given' ) first = types [ 0 ] if all ( ( is_dtype_equal ( first , t ) for t in types [ 1 : ] ) ) : return first if any ( ( isinstance ( t , ExtensionDtype ) for t in types ) ) : return np . object if all ( ( is_datetime64_dtype ( t ) for t in types ) ) : return np . dtype ( 'datetime64[ns]' ) if all ( ( is_timedelta64_dtype ( t ) for t in types ) ) : return np . dtype ( 'timedelta64[ns]' ) return np . find_common_type ( types , [ ] )
find a common data type among the given dtypes .