<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def iter_settings(mixed: Settings) -> Iterator[Tuple[str, Any]]: """Iterate over settings values from settings module or dict-like instance. :param mixed: Settings instance to iterate. """

    if isinstance(mixed, types.ModuleType):
        for attr in dir(mixed):
            if not is_setting_key(attr):
                continue
            yield (attr, getattr(mixed, attr))
    else:
        yield from filter(lambda item: is_setting_key(item[0]), mixed.items())