print('found extra folder %s' % extra_folder_path)
         call('cp -r %s %s' % (extra_folder_path, rawdatapath),
              shell=True)
         if os.path.isdir(pjoin(lucas_scanid_path, folder)):
             acqId = fw.add_acquisition({
                 'label':
                 folder,
                 'session':
                 flywheel_exams[0]['fw_id']
             })
             for root, folders, files in os.walk(
                     pjoin(lucas_scanid_path, folder)):
                 for file in files:
                     print('uploading %s to acq %s %s' %
                           (pjoin(root, file), folder, acqId))
                     fw.upload_file_to_acquisition(
                         acqId, pjoin(root, file))
 # download behavioral folders
 for root, folders, files in os.walk(lucas_scanid_path):
     for folder in folders:
         if folder in behav_targets:
             behav_folder_path = pjoin(root, folder)
             print('found behav folder %s' % behav_folder_path)
             files_under_behavioral = []
             for root2, folders2, files2 in os.walk(
                     behav_folder_path):
                 for behav_file in files2:
                     files_under_behavioral.append(
                         pjoin(root2, behav_file))
             # add behavioral to rawdata
             call('cp -r %s %s' %
                  (pjoin(root, folder),
 run = False
 if '/fmri/' in root:
     folder_list = pjoin(root, folder).split('/')
     for i in range(len(folder_list)):
         if folder_list[i] == 'fmri':
             run = folder_list[i + 1]
             break
     for exam in flywheel_exams:
         fw_acqs = fw.get_session_acquisitions(
             exam['fw_id'])
         for fw_acq in fw_acqs:
             if fw_acq['label'] == run:
                 found_run_on_fw = True
                 for behav_path in files_under_behavioral:
                     print('uploading %s' % behav_path)
                     fw.upload_file_to_acquisition(
                         fw_acq['_id'], behav_path)
 if not found_run_on_fw:
     if run:
         print(
             'run %s not found, creating acquisition behavioral under flywheel exam id %s'
             % (run, flywheel_exams[0]['fw_id']))
     else:
         print(
             'creating acquisition behavioral under flywheel exam id %s'
             % run, flywheel_exams[0]['fw_id'])
     acqId = fw.add_acquisition({
         'label':
         'behavioral',
         'session':
         flywheel_exams[0]['fw_id']
     })