code: def concat_namedtuples(*tup, **kwargs):
      '''
      Concatenate 2 or more namedtuples. The new namedtuple type
      is provided by :class:`NamedTupleFactory`
      return new namedtuple instance
      '''
      name = kwargs['name'] if 'name' in kwargs else None
  
      # filter out empty elements
      filtered = [i for i in filter(None, tup)]
      if filtered:
          if len(filtered) == 1:
              return filtered[0]
          else:
              fields = chain(*(t._fields for t in filtered))
              values = chain(*(t for t in filtered))
              if not name:
                  name = 'SDMXNamedTuple'
              ConcatType = namedtuple_factory(name, fields)
              return ConcatType(*values)
      else:
          return (f concat_namedtuples(*tup, **kwargs):
      '''
      Concatenate 2 or more namedtuples. The new namedtuple type
      is provided by :class:`NamedTupleFactory`
      return new namedtuple instance
      '''
      name = kwargs['name'] if 'name' in kwargs else None
  
      # filter out empty elements
      filtered = [i for i in filter(None, tup)]
      if filtered:
          if len(filtered) == 1:
              return filtered[0]
          else:
              fields = chain(*(t._fields for t in filtered))
              values = chain(*(t for t in filtered))
              if not name:
                  name = 'SDMXNamedTuple'
              ConcatType = namedtuple_factory(name, fields)
              return ConcatType(*values)
      else:
          return ()
docs: Concatenate 2 or more namedtuples. The new namedtuple type
      is provided by :class:`NamedTupleFactory`
      return new namedtuple instance