'Parse each returned registry value.'

def Parse(self, stat, knowledge_base):

    _ = knowledge_base
    sid_str = stat.pathspec.Dirname().Basename()
    if SID_RE.match(sid_str):
        kb_user = rdf_client.User()
        kb_user.sid = sid_str
        if (stat.pathspec.Basename() == 'ProfileImagePath'):
            if stat.resident:
                kb_user.homedir = utils.SmartUnicode(stat.resident)
            else:
                kb_user.homedir = stat.registry_data.GetValue()
            kb_user.userprofile = kb_user.homedir
            try:
                kb_user.username = kb_user.homedir.rsplit('\\', 1)[(-1)]
            except IndexError:
                pass
        (yield kb_user)
