code: def _upload_files(item, files, upload_kwargs, prev_identifier=None, archive_session=None):
      
      responses = []
      if (upload_kwargs['verbose']) and (prev_identifier != item.identifier):
          print('{0}:'.format(item.identifier))
  
      try:
          response = item.upload(files, **upload_kwargs)
          responses += response
      except HTTPError as exc:
          responses += [exc.response]
      finally:
          # Debug mode.
          if upload_kwargs['debug']:
              for i, r in enumerate(responses):
                  if i != 0:
                      print('---')
                  headers = '\n'.join(
                      [' {0}:{1}'.format(k, v) for (k, v) in r.headers.items()]
                  )
                  print('Endpoint:\n {0}\n'.format(r.url))
                  print('HTTP Headers:\n{0}'.format(headers))
                  return responses
  
          # Format error message for any non 200 responses that
          # we haven't caught yet,and write to stderr.
          if responses and responses[-1].status_code and responses[-1].status_code != 200:
              if not responses[-1].status_code:
                  return responses
              filename = responses[-1].request.url.split('/')[-1]
              try:
                  msg = get_s3_xml_text(responses[-1].content)
              except:
                  msg = responses[-1].content
              print(' error uploading {}: {}'.format(filename, msg), file=sys.stderr)
  
      return responses
docs: Helper function for calling :meth:`Item.upload`