code: def compute_fixed_effects(
      contrast_imgs,
      variance_imgs,
      mask=None,
      precision_weighted=False,
      dofs=None,
      return_z_score=False,
  ):
      """Compute the fixed effects, given images of effects and variance.
  
      Parameters
      ----------
      contrast_imgs : list of Nifti1Images or strings
          The input contrast images.
  
      variance_imgs : list of Nifti1Images or strings
          The input variance images.
  
      mask : Nifti1Image or NiftiMasker instance or None, optional
          Mask image. If ``None``, it is recomputed from ``contrast_imgs``.
  
      precision_weighted : Bool, default=False
          Whether fixed effects estimates should be weighted by inverse
          variance or not.
  
      dofs : array-like or None, default=None
          the degrees of freedom of the models with ``len = len(variance_imgs)``
          when ``None``,
          it is assumed that the degrees of freedom are 100 per input.
  
      return_z_score: Bool, default=False
          Whether ``fixed_fx_z_score_img`` should be output or not.
  
      Returns
      -------
      fixed_fx_contrast_img : Nifti1Image
          The fixed effects contrast computed within the mask.
  
      fixed_fx_variance_img : Nifti1Image
          The fixed effects variance computed within the mask.
  
      fixed_fx_stat_img : Nifti1Image
          The fixed effects stat computed within the mask.
  
      fixed_fx_z_score_img : Nifti1Image, optional
          The fixed effects corresponding z-transform
  
      Warns
      -----
      DeprecationWarning
          Starting in version 0.13, fixed_fx_z_score_img will always be returned
  
      """
      n_runs = len(contrast_imgs)
      if n_runs != len(variance_imgs):
          raise ValueError(
              f"The number of contrast images ({len(contrast_imgs)}) differs "
              f"from the number of variance images ({len(variance_imgs)})."
          )
  
      if isinstance(mask, NiftiMasker):
          masker = mask.fit()
      elif mask is None:
          masker = NiftiMasker().fit(contrast_imgs)
      else:
          masker = NiftiMasker(mask_img=mask).fit()
  
      variances = masker.transform(variance_imgs)
      contrasts = np.array(
          [
              masker.transform(contrast_img)
              for contrast_img in contrast_imgs
          ]
      )
  
      if dofs is not None:
          if len(dofs) != n_runs:
              raise ValueError(
                  f"The number of degrees of freedom ({len(dofs)}) "
                  f"differs from the number of contrast images ({n_runs})."
              )
      else:
          dofs = [100] * n_runs
  
      (
          fixed_fx_contrast,
          fixed_fx_variance,
          fixed_fx_stat,
          fixed_fx_z_score,
      ) = _compute_fixed_effects_params(
          contrasts, variances, precision_weighted, dofs
      )
  
      fixed_fx_contrast_img = masker.inverse_transform(
          fixed_fx_contrast
      )
      fixed_fx_variance_img = masker.inverse_transform(
          fixed_fx_variance
      )
      fixed_fx_stat_img = masker.inverse_transform(fixed_fx_stat)
      fixed_fx_z_score_img = masker.inverse_transform(fixed_fx_z_score)
      warn(
          category=DeprecationWarning,
          message="The behavior of this function will be "
          "changed in release 0.13 to have an additional"
          "return value 'fixed_fx_z_score_img'  by default. "
          "Please set return_z_score to True.",
      )
      if return_z_score:
          return (
              fixed_fx_contrast_img,
              fixed_fx_variance_img,
              fixed_fx_stat_img,
              fixed_fx_z_score_img,
          )
      else:
          return (
              fixed_fx_contrast_img,
              fixed_fx_variance_img,
              fixed_fx_stat_img,
          )
  
imports: from warnings import warn
  import numpy
  import pandas
  import scipy.stats
  from nilearn._utils import rename_parameters
  from nilearn.glm._utils import pad_contrast, z_score
  from nilearn.maskers import NiftiMasker
label_desc: Use image node_id 4 for calling a global function with example usage: compute_fixed_effects(contrast_imgs, variance_imgs, mask, precision_weighted, dofs, return_z_score) and returns: fixed_fx_contrast_img,  fixed_fx_variance_img,  fixed_fx_stat_img,  fixed_fx_z_score_img, fixed_fx_contrast_img,  fixed_fx_variance_img,  fixed_fx_stat_img