def _score_cpu_topology(topology, wanttopology):
 score = 0
 if ((wanttopology.sockets != (-1)) and (topology.sockets == wanttopology.sockets)):
  score = (score + 1)
 if ((wanttopology.cores != (-1)) and (topology.cores == wanttopology.cores)):
  score = (score + 1)
 if ((wanttopology.threads != (-1)) and (topology.threads == wanttopology.threads)):
  score = (score + 1)
 return score

def _score_cpu_topology ( topology , wanttopology ) : score = 0 if ( ( wanttopology . sockets != ( - 1 ) ) and ( topology . sockets == wanttopology . sockets ) ) : score = ( score + 1 ) if ( ( wanttopology . cores != ( - 1 ) ) and ( topology . cores == wanttopology . cores ) ) : score = ( score + 1 ) if ( ( wanttopology . threads != ( - 1 ) ) and ( topology . threads == wanttopology . threads ) ) : score = ( score + 1 ) return score
compare a topology against a desired configuration .