code: def update_bids_fields(bids_fields, img_file_patterns_type):
      """Update the bids_fields dictionary with the img_file_patterns_type."""
      if "extension" not in img_file_patterns_type:
          bids_fields["extension"] = "nii.gz"
      if "suffix" not in img_file_patterns_type:
          bids_fields["suffix"] = "bold"
      for key in img_file_patterns_type:
          if key == "entities":
              for entity in img_file_patterns_type["entities"]:
                  bids_fields["entities"][
                      entity
                  ] = img_file_patterns_type["entities"][entity]
          else:
              bids_fields[key] = img_file_patterns_type[key]
      return bids_fields
  
file_path: nilearn/nilearn/interfaces/fmriprep/tests/_testing.py
imports: import json
  import os
  import pandas
  from nilearn.interfaces.bids.utils import bids_entities, create_bids_filename
  from nilearn.interfaces.fmriprep import load_confounds_utils
label_desc: Use image node_id 4 for calling a global function with example usage: update_bids_fields(bids_fields, img_file_patterns_type) and returns: bids_fields