def _coerce_loc_index(divisions, o):
 if (divisions and isinstance(divisions[0], datetime)):
  return pd.Timestamp(o)
 if (divisions and isinstance(divisions[0], np.datetime64)):
  return np.datetime64(o).astype(divisions[0].dtype)
 return o

def _coerce_loc_index ( divisions , o ) : if ( divisions and isinstance ( divisions [ 0 ] , datetime ) ) : return pd . Timestamp ( o ) if ( divisions and isinstance ( divisions [ 0 ] , np . datetime64 ) ) : return np . datetime64 ( o ) . astype ( divisions [ 0 ] . dtype ) return o
transform values to be comparable against divisions this is particularly valuable to use with pandas datetimes .