def METHOD_NAME(parameter_dict, reffile_types, download=True):
    """Determine CRDS's best reference files to use for a particular
    observation, and download them if they are not already present in
    the ``CRDS_PATH``. The determination is made based on the
    information in the ``parameter_dictionary``.
    Parameters
    ----------
    parameter_dict : dict
        Dictionary of basic metadata from the file to be processed by
        the returned reference files (e.g. ``INSTRUME``, ``DETECTOR``,
        etc)
    reffile_types : list
        List of reference file types to look up and download. These must
        be contained in CRDS's list of reference file types.
    download : bool
        If ``True`` (default), the identified best reference files will
        be downloaded. If ``False``, the dictionary of best reference
        files will still be returned, but the files will not be
        downloaded. The use of ``False`` is primarily intended to
        support testing on Travis.
    Returns
    -------
    reffile_mapping : dict
        Mapping of downloaded CRDS file locations
    """
    # IMPORTANT: Import of crds package must be done AFTER the environment
    # variables are set in the functions above
    import crds
    from crds import CrdsLookupError
    if download:
        try:
            reffile_mapping = crds.getreferences(parameter_dict, reftypes=reffile_types)
        except CrdsLookupError:
            raise ValueError("ERROR: CRDSLookupError when trying to find reference files for parameters: {}".format(parameter_dict))
    else:
        # If the files will not be downloaded, still return the same local
        # paths that are returned when the files are downloaded. Note that
        # this follows the directory structure currently assumed by CRDS.
        crds_path = os.environ.get('CRDS_PATH')
        try:
            reffile_mapping = crds.getrecommendations(parameter_dict, reftypes=reffile_types)
        except CrdsLookupError:
            raise ValueError("ERROR: CRDSLookupError when trying to find reference files for parameters: {}".format(parameter_dict))
        for key, value in reffile_mapping.items():
            # Check for NOT FOUND must be done here because the following
            # line will raise an exception if NOT FOUND is present
            if "NOT FOUND" in value:
                reffile_mapping[key] = "NOT FOUND"
            else:
                instrument = value.split('_')[1]
                reffile_mapping[key] = os.path.join(crds_path, 'references/jwst', instrument, value)
    return reffile_mapping