code: def _nested_cwl_record(xs, want_attrs, input_files):
      
      if isinstance(xs, (list, tuple)):
          return [_nested_cwl_record(x, want_attrs, input_files) for x in xs]
      else:
          assert isinstance(xs, dict), pprint.pformat(xs)
          return _collapse_to_cwl_record_single(xs, want_attrs, input_files)
docs: Convert arbitrarily nested samples into a nested list of dictionaries.
  
      nests only at the record level, rather than within records. For batching
      a top level list is all of the batches and sub-lists are samples within the
      batch.