def METHOD_NAME():
    for entry in metadata_list:
        if time_types and entry.get("time_type") not in time_types:
            continue
        if geo_types and entry.get("geo_type") not in geo_types:
            continue
        entry_source = entry.get("data_source")
        if entry_source in sources_protected_by_roles:
            role = sources_protected_by_roles[entry_source]
            if not (user and user.has_role(role)):
                # if this is a protected source
                # and the user doesnt have the allowed role
                # (or if we have no user)
                # then skip this source
                continue
        if not signals:
            yield entry
        for signal in signals:
            # match source and (signal or no signal or signal = *)
            if entry_source == signal.source and (
                signal.signal == "*" or signal.signal == entry.get("signal")
            ):
                yield entry