docs: def func_info(task, n_runs, metadata, img, config):
      """
      Generate a paragraph describing T2*-weighted functional scans.
  
      Parameters
      ----------
      task : :obj:`str`
          The name of the task.
      n_runs : :obj:`int`
          The number of runs acquired for this task.
      metadata : :obj:`dict`
          The metadata for the scan from the json associated with the scan.
      img : :obj:`nibabel.Nifti1Image`
          Image corresponding to one of the runs.
      config : :obj:`dict`
          A dictionary with relevant information regarding sequences, sequence
          variants, phase encoding directions, and task names.
  
      Returns
      -------
      desc : :obj:`str`
          A description of the scan's acquisition information.
      """
      if metadata.get('MultibandAccelerationFactor', 1) > 1:
          mb_str = '; MB factor={}'.format(metadata['MultibandAccelerationFactor'])
      else:
          mb_str = ''
  
      if metadata.get('ParallelReductionFactorInPlane', 1) > 1:
          pr_str = ('; in-plane acceleration factor='
                    '{}'.format(metadata['ParallelReductionFactorInPlane']))
      else:
          pr_str = ''
  
      if 'SliceTiming' in metadata.keys():
          so_str = ' in {0} order'.format(get_slice_info(metadata['SliceTiming']))
      else:
          so_str = ''
  
      if 'EchoTime' in metadata.keys():
          if isinstance(metadata['EchoTime'], list):
              te = [num_to_str(t*1000) for t in metadata['EchoTime']]
              te_temp = ', '.join(te[:-1])
              te_temp += ', and {}'.format(te[-1])
              te = te_temp
              me_str = 'multi-echo '
          else:
              te = num_to_str(metadata['EchoTime']*1000)
              me_str = 'single-echo '
      else:
          te = 'UNKNOWN'
          me_str = 'UNKNOWN-echo'
  
      task_name = metadata.get('TaskName', task+' task')
      seqs, variants = get_seqstr(config, metadata)
      n_slices, vs_str, ms_str, fov_str = get_sizestr(img)
  
      tr = metadata['RepetitionTime']
      n_tps = img.shape[3]
      run_secs = math.ceil(n_tps * tr)
      mins, secs = divmod(run_secs, 60)
      length = '{0}:{1:02.0f}'.format(int(mins), int(secs))
  
      if n_runs == 1:
          run_str = '{0} run'.format(num2words(n_runs).title())
      else:
          run_str = '{0} runs'.format(num2words(n_runs).title())
  
      desc = '''
             {run_str} of {task} {variants} {seqs} {me_str} fMRI data were
             collected ({n_slices} slices{so_str}; repetition time, TR={tr}ms;
             echo time, TE={te}ms; flip angle, FA={fa}<deg>;
             field of view, FOV={fov}mm; matrix size={ms};
             voxel size={vs}mm{mb_str}{pr_str}).
             Each run was {length} minutes in length, during which
             {n_vols} functional volumes were acquired.
             '''.format(run_str=run_str,
                        task=task_name,
                        variants=variants,
                        seqs=seqs,
                        me_str=me_str,
                        n_slices=n_slices,
                        so_str=so_str,
                        tr=num_to_str(tr*1000),
                        te=te,
                        fa=metadata.get('FlipAngle', 'UNKNOWN'),
                        vs=vs_str,
                        fov=fov_str,
                        ms=ms_str,
                        length=length,
                        n_vols=n_tps,
                        mb_str=mb_str,
                        pr_str=pr_str
                       )
      desc = desc.replace('\n', ' ').lstrip()
      while '  ' in desc:
          desc = desc.replace('  ', ' ')
  
      return desc