'Converts matches to a dict object.
:param details if True, values will be complete Match object, else it will be only string Match.value property
:type details: bool
:param implicit if True, multiple values will be set as a list in the dict. Else, only the first value
will be kept.
:type implicit: bool
:return:
:rtype: dict'

def to_dict(self, details=False, implicit=False):

    ret = MatchesDict()
    for match in sorted(self):
        value = (match if details else match.value)
        ret.matches[match.name].append(match)
        if (value not in ret.values_list[match.name]):
            ret.values_list[match.name].append(value)
        if (match.name in ret.keys()):
            if implicit:
                if (not isinstance(ret[match.name], list)):
                    if (ret[match.name] == value):
                        continue
                    ret[match.name] = [ret[match.name]]
                elif (value in ret[match.name]):
                    continue
                ret[match.name].append(value)
        else:
            ret[match.name] = value
    return ret
