code: def test_check_parameters_megatrawls_datasets():
      # testing whether the function raises the same error message
      # if invalid input parameters are provided
      message = "Invalid {0} input is provided: {1}."
  
      for invalid_input_dim in [1, 5, 30]:
          with pytest.raises(
              ValueError,
              match=message.format("dimensionality", invalid_input_dim),
          ):
              func.fetch_megatrawls_netmats(
                  dimensionality=invalid_input_dim
              )
  
      for invalid_input_timeserie in ["asdf", "time", "st2"]:
          with pytest.raises(
              ValueError,
              match=message.format(
                  "timeseries", invalid_input_timeserie
              ),
          ):
              func.fetch_megatrawls_netmats(
                  timeseries=invalid_input_timeserie
              )
  
      for invalid_output_name in ["net1", "net2"]:
          with pytest.raises(
              ValueError,
              match=message.format("matrices", invalid_output_name),
          ):
              func.fetch_megatrawls_netmats(
                  matrices=invalid_output_name
              )
  
imports: import json
  import os
  import re
  import shutil
  import tempfile
  import uuid
  from collections import OrderedDict
  from pathlib import Path
  import nibabel
  import numpy
  import pandas
  import pytest
  from nilearn.datasets import func
  from nilearn.datasets._utils import get_dataset_dir
  from nilearn.datasets.tests._testing import dict_to_archive, list_to_archive
  from nilearn.image import load_img
label_desc: Use image node_id 18 for calling a global function with example usage: test_check_parameters_megatrawls_datasets() without return types