def set_defaults(key):
def decorator(func):<EOL><INDENT>@functools.wraps(func)<EOL>def wrapper(phase, new_value):<EOL><INDENT>new_value = new_value or []<EOL>for item in new_value:<EOL><INDENT>galaxy = new_value[item] if isinstance(item, str) else item<EOL>galaxy.redshift = galaxy.redshift or conf.instance.general.get("<STR_LIT>", key, float)<EOL><DEDENT>return func(phase, new_value)<EOL><DEDENT>return wrapper<EOL><DEDENT>return decorator<EOL>
Load a default value for redshift from config and set it as the redshift for source or lens galaxies that have
falsey redshifts

Parameters
----------
key: str

Returns
-------
decorator
    A decorator that wraps the setter function to set defaults