code: def fetch_megatrawls_netmats(
      dimensionality=100,
      timeseries="eigen_regression",
      matrices="partial_correlation",
      data_dir=None,
      resume=True,
      verbose=1,
  ):
      """Download and return Network Matrices data \
      from MegaTrawls release in HCP.
  
      This data can be used to predict relationships between imaging data and
      non-imaging behavioural measures such as age, sex, education, etc.
      The network matrices are estimated from functional connectivity
      datasets of 461 subjects. Full technical details in references.
  
      More information available in :footcite:t:`Smith2015b`,
      :footcite:t:`Smith2015a`, :footcite:t:`Filippini2009`,
      :footcite:t:`Smith2014`, and :footcite:t:`Reilly2009`.
  
      Parameters
      ----------
      dimensionality : :obj:`int`, default=100
          Valid inputs are 25, 50, 100, 200, 300. By default, network matrices
          estimated using Group :term:`ICA` brain :term:`parcellation`
          of 100 components/dimensions will be returned.
  
      timeseries : :obj:`str`, default='eigen_regression'
          Valid inputs are 'multiple_spatial_regression' or 'eigen_regression'.
          By default 'eigen_regression', matrices estimated using first principal
          eigen component timeseries signals extracted from each subject data
          parcellations will be returned.
          Otherwise, 'multiple_spatial_regression'
          matrices estimated using spatial regressor based timeseries signals
          extracted from each subject data parcellations will be returned.
  
      matrices : :obj:`str`, default='partial_correlation'
          Valid inputs are 'full_correlation' or 'partial_correlation'.
          By default, partial correlation matrices will be returned
          otherwise if selected full correlation matrices will be returned.
      %(data_dir)s
      %(resume)s
      %(verbose)s
  
      Returns
      -------
      data : Bunch
          Dictionary-like object, the attributes are :
  
          - 'dimensions': int, consists of given input in dimensions.
  
          - 'timeseries': str, consists of given input in timeseries method.
  
          - 'matrices': str, consists of given type of specific matrices.
  
          - 'correlation_matrices': ndarray, consists of correlation matrices
            based on given type of matrices. Array size will depend on given
            dimensions (n, n).
  
          - 'description': data description
  
      References
      ----------
      .. footbibliography::
  
      Notes
      -----
      See description for terms & conditions on data usage.
  
      """
      url = "http://www.nitrc.org/frs/download.php/8037/Megatrawls.tgz"
      opts = {"uncompress": True}
  
      error_message = (
          "Invalid {0} input is provided: {1}, choose one of them {2}"
      )
      # standard dataset terms
      dimensionalities = [25, 50, 100, 200, 300]
      if dimensionality not in dimensionalities:
          raise ValueError(
              error_message.format(
                  "dimensionality", dimensionality, dimensionalities
              )
          )
      timeseries_methods = [
          "multiple_spatial_regression",
          "eigen_regression",
      ]
      if timeseries not in timeseries_methods:
          raise ValueError(
              error_message.format(
                  "timeseries", timeseries, timeseries_methods
              )
          )
      output_matrices_names = [
          "full_correlation",
          "partial_correlation",
      ]
      if matrices not in output_matrices_names:
          raise ValueError(
              error_message.format(
                  "matrices", matrices, output_matrices_names
              )
          )
  
      dataset_name = "Megatrawls"
      data_dir = get_dataset_dir(
          dataset_name, data_dir=data_dir, verbose=verbose
      )
      description = get_dataset_descr(dataset_name)
  
      timeseries_map = dict(
          multiple_spatial_regression="ts2", eigen_regression="ts3"
      )
      matrices_map = dict(
          full_correlation="Znet1.txt", partial_correlation="Znet2.txt"
      )
      filepath = [
          (
              os.path.join(
                  "3T_Q1-Q6related468_MSMsulc_d%d_%s"
                  % (dimensionality, timeseries_map[timeseries]),
                  matrices_map[matrices],
              ),
              url,
              opts,
          )
      ]
  
      # Fetch all the files
      files = fetch_files(
          data_dir, filepath, resume=resume, verbose=verbose
      )
  
      # Load the files into arrays
      correlation_matrices = csv_to_array(files[0])
  
      return Bunch(
          dimensions=dimensionality,
          timeseries=timeseries,
          matrices=matrices,
          correlation_matrices=correlation_matrices,
          description=description,
      )
  
imports: import fnmatch
  import glob
  import json
  import numbers
  import os
  import re
  import warnings
  from io import BytesIO
  from pathlib import Path
  import nibabel
  import nibabel
  import numpy
  import pandas
  from scipy.io import loadmat
  from sklearn.utils import Bunch
  from nilearn.image import get_data
  from .._utils import check_niimg, fill_doc
  from .._utils.numpy_conversions import csv_to_array
  from ._utils import fetch_files, fetch_single_file, filter_columns, get_dataset_descr, get_dataset_dir, read_md5_sum_file, tree, uncompress_file
label_desc: Use image node_id 12 for calling a global function with example usage: fetch_megatrawls_netmats(dimensionality, timeseries, matrices, data_dir, resume, verbose) and returns: Bunch