import copy


def _merge_meta(base, child):
    """Merge the base and the child meta attributes.

    List entries, such as ``indexes`` are concatenated.
    ``abstract`` value is set to ``True`` only if defined as such
    in the child class.

    Args:
        base (dict):
            ``meta`` attribute from the base class.
        child (dict):
            ``meta`` attribute from the child class.

    Returns:
        dict:
            Merged metadata.
    """
    base = copy.deepcopy(base)
    child.setdefault('abstract', False)
    for key, value in child.items():
        if isinstance(value, list):
            base.setdefault(key, []).extend(value)
        else:
            base[key] = value

    return base