def get_upcast_box(box, vector):
if box is DataFrame or isinstance(vector, DataFrame):<EOL><INDENT>return DataFrame<EOL><DEDENT>if box is Series or isinstance(vector, Series):<EOL><INDENT>return Series<EOL><DEDENT>if box is pd.Index or isinstance(vector, pd.Index):<EOL><INDENT>return pd.Index<EOL><DEDENT>return box<EOL>
Given two box-types, find the one that takes priority