'Return a dictionary with keys arbitrary concatenations of attributes
and values lists of objects (Albums or Items) with those keys.
If strict, all attributes must be defined for a duplicate match.'

def _group_by(self, objs, keys, strict):

    import collections
    counts = collections.defaultdict(list)
    for obj in objs:
        values = [getattr(obj, k, None) for k in keys]
        values = [v for v in values if (v not in (None, ''))]
        if (strict and (len(values) < len(keys))):
            self._log.debug(u'some    keys    {0}    on    item    {1}    are    null    or    empty:    skipping', keys, displayable_path(obj.path))
        elif ((not strict) and (not len(values))):
            self._log.debug(u'all    keys    {0}    on    item    {1}    are    null    or    empty:    skipping', keys, displayable_path(obj.path))
        else:
            key = tuple(values)
            counts[key].append(obj)
    return counts
