def copy_attributes_between_objects(from_object, to_object, attributes=[],
    defaults=dict(), not_found_value=None):
    """Copy attributes from one object to another

    Looks up `attributes` in `from_obj` and copies them to `to_object`.  If
    not present in `from_object` the corresponding attribute in `to_object`
    will be set to `defaults` or `not_found_value` if not in `defaults`.

    Parameters
    ----------
    from_object : object or module
        Object to copy attributes from.
    to_object : object or module
        Object to copy attributes to.
    attributes : list of strings
        A list of attribute names to copy from `from_object` to `object_to`.
    defaults : dict of string-value pairs
        Dictionary specifying the default value of each attribute that is not
        found in `from_object`.
    not_found_value : optional
        Default value to set attribute to if not found in `from_object` or in
        `defaults`.  Default not_found_value=None.

    Returns
    -------
    None

    """
    for v in attributes:
        to_object.__setattr__(v, from_object.__dict__.get(v, defaults.get(v,
            not_found_value)))
    return
