code: def _set_concatenate(sets):
      
      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))
docs: concatenate indexable objects.
  
      Parameters
      ----------
      sets : iterable of indexable objects
  
      Returns
      -------
      indexable object
  
      handles both arrays and tuples of arrays