def copy_object(source_store, source_name, target_store, target_name=None,
    create=False, replace=False):
    """Convenience method that copies object data from source store to target
    store. `source_object` and `target_object` should be object names within
    the respective stores. If `target_name` is not specified, then
    `source_name` is used."""
    target_name = target_name or source_name
    source = source_store.get_object(source_name)
    if create:
        if not replace and target_store.exists(target_name):
            raise Exception(
                'Target object already exists. Use reaplce=True to delete the object object and create replacement'
                )
        target = target_store.create(target_name, source.fields, replace=
            True, from_obj=source)
    else:
        target = target_store.get_object(target_name)
        target.append_from(source)
        target.flush()
    return target
