code: def test_parse_bids_filename():
      fields = ["sub", "ses", "task", "lolo"]
      labels = ["01", "01", "langloc", "lala"]
      file_name = "sub-01_ses-01_task-langloc_lolo-lala_bold.nii.gz"
      file_path = os.path.join(
          "dataset", "sub-01", "ses-01", "func", file_name
      )
      file_dict = parse_bids_filename(file_path)
      for fidx, field in enumerate(fields):
          assert file_dict[field] == labels[fidx]
      assert file_dict["file_type"] == "nii.gz"
      assert file_dict["file_tag"] == "bold"
      assert file_dict["file_path"] == file_path
      assert file_dict["file_basename"] == file_name
      assert file_dict["file_fields"] == fields
  
imports: import json
  import os
  import numpy
  import pandas
  import pytest
  from nilearn._utils.data_gen import add_metadata_to_bids_dataset, create_fake_bids_dataset, generate_fake_fmri_data_and_design
  from nilearn.glm.first_level import FirstLevelModel
  from nilearn.glm.second_level import SecondLevelModel
  from nilearn.interfaces.bids import get_bids_files, parse_bids_filename, save_glm_to_bids
  from nilearn.interfaces.bids.query import _get_metadata_from_bids, infer_repetition_time_from_dataset, infer_slice_timing_start_time_from_dataset
  from nilearn.maskers import NiftiMasker
label_desc: Use image node_id 8 for calling a global function with example usage: test_parse_bids_filename() without return types