def _align(terms):
try:<EOL><INDENT>terms = list(com.flatten(terms))<EOL><DEDENT>except TypeError:<EOL><INDENT>if isinstance(terms.value, pd.core.generic.NDFrame):<EOL><INDENT>typ = type(terms.value)<EOL>return typ, _zip_axes_from_type(typ, terms.value.axes)<EOL><DEDENT>return np.result_type(terms.type), None<EOL><DEDENT>if all(term.is_scalar for term in terms):<EOL><INDENT>return _result_type_many(*(term.value for term in terms)).type, None<EOL><DEDENT>typ, axes = _align_core(terms)<EOL>return typ, axes<EOL>
Align a set of terms