def concat_all(*args):
 if (len(args) != 1):
  return concat_all(list(args))
 if (not isinstance(args[0], (tuple, list))):
  return [args[0]]
 res = []
 for k in args[0]:
  res.extend(concat_all(k))
 return res

def concat_all ( * args ) : if ( len ( args ) != 1 ) : return concat_all ( list ( args ) ) if ( not isinstance ( args [ 0 ] , ( tuple , list ) ) ) : return [ args [ 0 ] ] res = [ ] for k in args [ 0 ] : res . extend ( concat_all ( k ) ) return res
concat_all -> list concats all the arguments together .