code: def find_compcor(confounds_json, compcor, n_compcor):
      """Build list for the number of compcor components.
  
      Parameters
      ----------
      confounds_json : :obj:`dict`
          Dictionary of confounds from the confounds.json file.
      compcor : :obj:`str`
          Compcor strategy to use. Options are "temporal_anat", "temporal",
          "anat", or "combined".
      n_compcor : :obj:`int` or :obj:`str`
          Number of compcor components to retain. If "all", all components
          are retained.
  
      Returns
      -------
      collector : :obj:`list`
          List of compcor components to retain.
      """
      prefix_set, anat_mask = _check_compcor_method(compcor)
  
      collector = []
      for prefix in prefix_set:
          # all possible compcor confounds in order
          all_compcor_name = [
              comp
              for comp in confounds_json.keys()
              if f"{prefix}_comp_cor" in comp
          ]
          # filter by prefix first (anat vs temporal)
          compcor_cols_filt = _prefix_confound_filter(
              prefix, all_compcor_name
          )
          if prefix == "a":
              # apply acompor mask option if relevant, and select top components
              compcor_cols_filt = _acompcor_mask(
                  confounds_json,
                  anat_mask,
                  compcor_cols_filt,
                  n_compcor,
              )
          else:
              # select top components
              compcor_cols_filt = _select_compcor(
                  compcor_cols_filt, n_compcor
              )
          # Aggregate components across all masks
          collector += compcor_cols_filt
      return collector
  
label_desc: Use image node_id 1 for calling a global function with example usage: find_compcor(confounds_json, compcor, n_compcor) and returns: collector