code: def _generate_dataset_description(out_file, model_level):
      """Generate a BIDS dataset_description.json file with relevant metadata.
  
      .. versionadded:: 0.9.2
  
      Parameters
      ----------
      out_file : :obj:`str`
          Output JSON filename, to be created by the function.
      model_level : {1, 2}
          The level of the model. 1 means a first-level model.
          2 means a second-level model.
      """
      repo_url = "https://github.com/nilearn/nilearn"
      dataset_description = {
          "GeneratedBy": {
              "Name": "nilearn",
              "Version": __version__,
              "Description": (
                  "A Nilearn "
                  f"{'first' if model_level == 1 else 'second'}"
                  "-level GLM."
              ),
              "CodeURL": (f"{repo_url}/releases/tag/{__version__}"),
          }
      }
  
      with open(out_file, "w") as f_obj:
          json.dump(
              dataset_description, f_obj, indent=4, sort_keys=True
          )
  
file_path: nilearn/nilearn/interfaces/bids/glm.py
imports: import json
  import os
  import warnings
  import numpy
  from nilearn import __version__
label_desc: Use image node_id 3 for calling a global function with example usage: _generate_dataset_description(out_file, model_level) without return types