[docs]defcombine(*x:Any):""" Generic combine that checks if the objects are n-dimensional for n > 1 (i.e. has a ``shape`` property of length greater than 1); if so, it calls :py:func:`~biocutils.combine_rows.combine_rows` to combine them by the first dimension, otherwise it assumes that they are vector-like and calls :py:func:`~biocutils.combine_sequences.combine_sequences` instead. Args: x: Objects to combine. Returns: A combined object, typically the same type as the first element in ``x``. """has_1d=Falsehas_nd=Falseforyinx:ifis_high_dimensional(y):has_nd=Trueelse:has_1d=Trueifhas_ndandhas_1d:raiseValueError("cannot mix 1-dimensional and higher-dimensional objects in `combine`")ifhas_nd:returncombine_rows(*x)else:returncombine_sequences(*x)