def METHOD_NAME():
    """ Try to fill the dye database from known files
    returns (boolean): True if a database was found, false otherwise
    Note: it uses a cached version of the Fluorophores.org JSON database
    """
    # For the API see doc/fluorophores-api.txt
    for p in FLUODB_PATHS:
        try:
            findex = open(p + u"environment/index.json")
        except IOError:
            # can't find this file, try the next one
            continue
        index = json.load(findex)
        basedir = p
        break
    else:
        return False
    # Load the main excitation and emission peak for each environment
    # For each environment, download it
    for eid, e in index.items():
        # find the names (of the substance)
        names = set()
        s = e["substance"]
        names.add(_clean_up_name(s["common_name"]))  # in case loading the substance file fails
        nsid = int(s["substance_id"])
        sname = basedir + u"substance/%d.json" % nsid
        try:
            fs = open(sname, "r")
            fulls = json.load(fs)
            for n in fulls["common_names"]:
                names.add(_clean_up_name(n))
        except (IOError, ValueError):
            # no such file => no problem
            logging.debug("Failed to open %s", sname)
        # Discard empty names or names made of one character
        names = set(n for n in names if len(n) > 1)
        if not names:
            logging.debug("Skipping environment %d which has substance without name", eid)
        # solvent name
        solname = e["solvent"] or ""
        solname = solname.strip()
        # find the peaks
        xpeaks = e["excitation_max"]
        epeaks = e["emission_max"]
        if len(xpeaks) == 0 or len(epeaks) == 0:
            # not enough information to be worthy
            continue
        # In case of multiple peaks, select the one that make most sense:
        # excitation is just before emission
        if len(xpeaks) == 1:
            xp = xpeaks[0]
            if len(epeaks) == 1:  # easy
                ep = epeaks[0]
            else:  # Closest emission above excitation
                for ep in sorted(epeaks):
                    if ep > xp:
                        break
                else:
                    ep = max(epeaks)
        else: # multiple excitations
            if len(epeaks) == 1:  # Closest excitation below emissions
                ep = epeaks[0]
                for xp in sorted(xpeaks, reverse=True):
                    if xp < ep:
                        break
                else:
                    xp = min(xpeaks)
            else:  # Find something not too weird
                for ep in sorted(epeaks):
                    if any(xp < ep for xp in xpeaks):
                        break
                else:
                    ep = max(epeaks)
                for xp in sorted(xpeaks, reverse=True):
                    if xp < ep:
                        break
                else:
                    xp = min(xpeaks)
        if not xp <= ep:
            logging.info("Dye %s, excitation is %d > emission %d nm", s["common_name"], xp, ep)
        xwl = xp * 1e-9  # m
        ewl = ep * 1e-9  # m
        # Note: if two substances have the same name (and it changes something)
        # => add the solvent name.
        for n in names:
            if not solname:
                fullname = n
            else:
                fullname = n + u" (in %s)" % solname
            if fullname in DyeDatabase and DyeDatabase[fullname] != (xwl, ewl):
                logging.info("Dropping duplicated dye %s", fullname)
                continue
            else:
                DyeDatabase[fullname] = (xwl, ewl)
    # TODO: also de-duplicate names in a case insensitive way
    logging.info("Loaded %d dye names from the database.", len(DyeDatabase))
    return True