'Retrieve directly specified registry values, returning Stat objects.'

def GetRegistryValue(self, source):

    new_paths = set()
    has_glob = False
    for kvdict in source.attributes['key_value_pairs']:
        if (('*' in kvdict['key']) or paths.GROUPING_PATTERN.search(kvdict['key'])):
            has_glob = True
        if kvdict['value']:
            path = '\\'.join((kvdict['key'], kvdict['value']))
        else:
            path = kvdict['key']
        expanded_paths = artifact_utils.InterpolateKbAttributes(path, self.state.knowledge_base, ignore_errors=self.args.ignore_interpolation_errors)
        new_paths.update(expanded_paths)
    if has_glob:
        self.CallFlow(filesystem.Glob.__name__, paths=new_paths, pathtype=paths.PathSpec.PathType.REGISTRY, request_data={'artifact_name': self.current_artifact_name, 'source': source.ToPrimitiveDict()}, next_state='ProcessCollected')
    else:
        for new_path in new_paths:
            pathspec = paths.PathSpec(path=new_path, pathtype=paths.PathSpec.PathType.REGISTRY)
            self.CallClient(server_stubs.StatFile, pathspec=pathspec, request_data={'artifact_name': self.current_artifact_name, 'source': source.ToPrimitiveDict()}, next_state='ProcessCollectedRegistryStatEntry')
