original_docstring: 
      Coerces `atlas` to dict with keys `donors`
  
      If already a dictionary, confirms that `atlas` has entries for all values
      in `donors`
  
      Parameters
      ----------
      atlas : niimg-like object
          A parcellation image in MNI space, where each parcel is identified by a
          unique integer ID
      donors : array_like
          Donors that should have entries in returned `atlas` dictionary
      atlas_info : os.PathLike or pandas.DataFrame, optional
          Filepath to or pre-loaded dataframe containing information about
          `atlas`. Must have at least columns 'id', 'hemisphere', and 'structure'
          containing information mapping atlas IDs to hemisphere (i.e, "L", "R")
          and broad structural class (i.e., "cortex", "subcortex", "cerebellum").
          If provided, this will constrain matching of tissue samples to regions
          in `atlas`. Default: None
  
      Returns
      -------
      atlas : dict
          Dict where keys are `donors` and values are `atlas`. If a dict was
          provided it is checked to ensure
      atlas_info : pandas.DataFrame
          Loaded dataframe with information on atlas
      same : bool
          Whether one atlas was provided for all donors (True) instead of
          donor-specific atlases (False)
      
docstring: 
  
  Parameters
  
  atlas : niimg-like object
  A parcellation image in MNI space, where each parcel is identified by a
  unique integer ID
  donors : array_like
  Donors that should have entries in returned `atlas` dictionary
  atlas_info : os.PathLike or pandas.DataFrame, optional
  Filepath to or pre-loaded dataframe containing information about
  `atlas`.
  
  Returns
  
  atlas : dict
  Dict where keys are `donors` and values are `atlas`. If a dict was
  provided it is checked to ensure
  atlas_info : pandas.DataFrame
  Loaded dataframe with information on atlas
  same : bool
  Whether one atlas was provided for all donors (True) instead of
  donor-specific atlases (False)
docstring_tokens: Parameters atlas : niimg - like object A parcellation image in MNI space where each parcel is identified by a unique integer ID donors : array_like Donors that should have entries in returned ` atlas ` dictionary atlas_info : os . PathLike or pandas . DataFrame optional Filepath to or pre - loaded dataframe containing information about ` atlas ` . Returns atlas : dict Dict where keys are ` donors ` and values are ` atlas ` . If a dict was provided it is checked to ensure atlas_info : pandas . DataFrame Loaded dataframe with information on atlas same : bool Whether one atlas was provided for all donors ( True ) instead of donor - specific atlases ( False )
code: def coerce_atlas_to_dict(atlas, donors, atlas_info=None):
      """
      Coerces `atlas` to dict with keys `donors`
  
      If already a dictionary, confirms that `atlas` has entries for all values
      in `donors`
  
      Parameters
      ----------
      atlas : niimg-like object
          A parcellation image in MNI space, where each parcel is identified by a
          unique integer ID
      donors : array_like
          Donors that should have entries in returned `atlas` dictionary
      atlas_info : os.PathLike or pandas.DataFrame, optional
          Filepath to or pre-loaded dataframe containing information about
          `atlas`. Must have at least columns 'id', 'hemisphere', and 'structure'
          containing information mapping atlas IDs to hemisphere (i.e, "L", "R")
          and broad structural class (i.e., "cortex", "subcortex", "cerebellum").
          If provided, this will constrain matching of tissue samples to regions
          in `atlas`. Default: None
  
      Returns
      -------
      atlas : dict
          Dict where keys are `donors` and values are `atlas`. If a dict was
          provided it is checked to ensure
      atlas_info : pandas.DataFrame
          Loaded dataframe with information on atlas
      same : bool
          Whether one atlas was provided for all donors (True) instead of
          donor-specific atlases (False)
      """
  
      donors = datasets.fetchers.check_donors(donors)
      same = True
  
      # FIXME: so that we're not depending on type checks so much :grimacing:
      if isinstance(atlas, dict):
          atlas = {
              datasets.WELL_KNOWN_IDS.subj[d]: utils.check_img(a)
              for d, a in atlas.items()
          }
          same = False
          missing = set(donors) - set(atlas)
          if len(missing) > 0:
              raise ValueError('Provided `atlas` does not have entry for all '
                               f'requested donors. Missing donors: {donors}.')
          lgr.info('Donor-specific atlases provided; using native MRI '
                   'coordinates for tissue samples')
      else:
          atlas = utils.check_img(atlas)
          atlas = {donor: atlas for donor in donors}
          lgr.info('Group-level atlas provided; using MNI coordinates for '
                   'tissue samples')
  
      if atlas_info is not None:
          for donor, atl in atlas.items():
              atlas_info = utils.check_atlas_info(atlas[donor], atlas_info)
  
      return atlas, atlas_info, same
code_tokens: def coerce_atlas_to_dict ( atlas , donors , atlas_info = None ) : donors = datasets . fetchers . check_donors ( donors ) same = True if isinstance ( atlas , dict ) : atlas = { datasets . WELL_KNOWN_IDS . subj [ d ] : utils . check_img ( a ) for d , a in atlas . items ( ) } same = False missing = set ( donors ) - set ( atlas ) if len ( missing ) > 0 : raise ValueError ( 'Provided `atlas` does not have entry for all ' f'requested donors. Missing donors: {donors}.' ) lgr . info ( 'Donor-specific atlases provided; using native MRI ' 'coordinates for tissue samples' ) else : atlas = utils . check_img ( atlas ) atlas = { donor : atlas for donor in donors } lgr . info ( 'Group-level atlas provided; using MNI coordinates for ' 'tissue samples' ) if atlas_info is not None : for donor , atl in atlas . items ( ) : atlas_info = utils . check_atlas_info ( atlas [ donor ] , atlas_info ) return atlas , atlas_info , same
short_docstring: Coerces `atlas` to dict with keys `donors`
  If already a dictionary, confirms that `atlas` has entries for all values
  in `donors`
short_docstring_tokens: Coerces ` atlas ` to dict with keys ` donors ` If already a dictionary confirms that ` atlas ` has entries for all values in ` donors `
comment: """
      Coerces `atlas` to dict with keys `donors`
  
      If already a dictionary, confirms that `atlas` has entries for all values
      in `donors`
  
      Parameters
      ----------
      atlas : niimg-like object
          A parcellation image in MNI space, where each parcel is identified by a
          unique integer ID
      donors : array_like
          Donors that should have entries in returned `atlas` dictionary
      atlas_info : os.PathLike or pandas.DataFrame, optional
          Filepath to or pre-loaded dataframe containing information about
          `atlas`. Must have at least columns 'id', 'hemisphere', and 'structure'
          containing information mapping atlas IDs to hemisphere (i.e, "L", "R")
          and broad structural class (i.e., "cortex", "subcortex", "cerebellum").
          If provided, this will constrain matching of tissue samples to regions
          in `atlas`. Default: None
  
      Returns
      -------
      atlas : dict
          Dict where keys are `donors` and values are `atlas`. If a dict was
          provided it is checked to ensure
      atlas_info : pandas.DataFrame
          Loaded dataframe with information on atlas
      same : bool
          Whether one atlas was provided for all donors (True) instead of
          donor-specific atlases (False)
      """$SEP$# FIXME: so that we're not depending on type checks so much :grimacing: