def _set_concatenate(sets):
    """concatenate indexable objects.

    Parameters
    ----------
    sets : iterable of indexable objects

    Returns
    -------
    indexable object

    handles both arrays and tuples of arrays
    """
    def con(set):
        # if not all():
        #     raise ValueError('concatenated keys must have the same dtype')
        try:
            return np.concatenate([s for s in sets if len(s)])
        except ValueError:
            return set[0]

    if any(not isinstance(s, tuple) for s in sets):
        #assume all arrays
        return con(sets)
    else:
        #assume all tuples
        return tuple(con(s) for s in zip(*sets))
def _set_concatenate ( sets ) : def con ( set ) : try : return np . concatenate ( [ s for s in sets if len ( s ) ] ) except ValueError : return set [ 0 ] if any ( not isinstance ( s , tuple ) for s in sets ) : return con ( sets ) else : return tuple ( con ( s ) for s in zip ( * sets ) )
concatenate indexable objects.

    Parameters
    ----------
    sets : iterable of indexable objects

    Returns
    -------
    indexable object

    handles both arrays and tuples of arrays