'The recursive business logic of :meth:`_map_data_to_scheme`:
Traverse two structures of nested dictionaries in parallel and `yield`
tuples of corresponding leaf nodes.
If a leaf node belongs to a composite attribute (is a `tuple`),
populate `composites` rather than yielding straight away.
All the child functions for a single traversal share the same
`composites` instance, which is passed along.'

def _data_to_scheme_child(self, subdata, subscheme, composites):

    for (k, v) in subscheme.items():
        if (k in subdata):
            if (type(v) == dict):
                for (attr, val) in self._data_to_scheme_child(subdata[k], v, composites):
                    (yield (attr, val))
            elif (type(v) == tuple):
                (composite_attribute, part_number) = v
                attribute_parts = composites[composite_attribute]
                while (len(attribute_parts) <= part_number):
                    attribute_parts.append('')
                attribute_parts[part_number] = subdata[k]
            else:
                (yield (v, subdata[k]))
        else:
            self._log.warning(u'Acousticbrainz    did    not    provide    infoabout    {}', k)
            self._log.debug(u'Data    {}    could    not    be    mapped    to    scheme    {}    because    key    {}    was    not    found', subdata, v, k)
