code: def concat_main(args):
      
  
      # Get files directly
      if args.input_filepaths is not None:
          files = args.input_filepaths
  
      # Or find them
      else:
          files = get_file_list(args.file_wildcard)
          
          # No files found
          if len(files) == 0:
              msg = "No files were found. args.file_wildcard: {}".format(args.file_wildcard)
              logger.error(msg)
              raise Exception(msg)
  
      # Only 1 file found
      if len(files) == 1:
          logger.warning("Only 1 file found. No concatenation needs to be done, exiting")
          return
  
      # More than 1 file found
      else:
          # Parse each file and append to a list
          gctoos = []
          for f in files:
              gctoos.append(parse.parse(f))
  
          # Create concatenated gctoo object
          if args.concat_direction == "horiz":
              out_gctoo = hstack(gctoos, args.remove_all_metadata_fields, args.error_report_output_file,
                                 args.fields_to_remove, args.reset_ids)
  
          elif args.concat_direction == "vert":
              out_gctoo = vstack(gctoos, args.remove_all_metadata_fields, args.error_report_output_file,
                                 args.fields_to_remove, args.reset_ids)
  
      # Write out_gctoo to file
      logger.info("Writing to output file args.out_name:  {}".format(args.out_name))
  
      if args.out_type == "gctx":
          write_gctx.write(out_gctoo, args.out_name)
  
      elif args.out_type == "gct":
          write_gct.write(out_gctoo, args.out_name,
                            filler_null=args.filler_null,
                            metadata_null=args.metadata_null,
                            data_null=args.data_null)
docs: Separate method from main() in order to make testing easier and to
      enable command-line access.