angr/exploration_techniques/stochastic.py
def weighted_pick(states):
                """
                param states: Diverging states.
                """
                assert len(states) >= 2
                total_weight = sum((self.affinity[s.addr] for s in states))
                selected = self._random.uniform(0, total_weight)
                i = 0
                for i, state in enumerate(states):
                    weight = self.affinity[state.addr]
                    if selected < weight:
                        break
                    else:
                        selected -= weight
                picked = states[i]
                return picked

                param states: Diverging states.
                
param states: Diverging states.
param states : Diverging states .
def weighted_pick(states):
                assert len(states) >= 2
                total_weight = sum((self.affinity[s.addr] for s in states))
                selected = self._random.uniform(0, total_weight)
                i = 0
                for i, state in enumerate(states):
                    weight = self.affinity[state.addr]
                    if selected < weight:
                        break
                    else:
                        selected -= weight
                picked = states[i]
                return picked
def weighted_pick ( states ) : assert len ( states ) >= 2 total_weight = sum ( ( self . affinity [ s . addr ] for s in states ) ) selected = self . _random . uniform ( 0 , total_weight ) i = 0 for i , state in enumerate ( states ) : weight = self . affinity [ state . addr ] if selected < weight : break else : selected -= weight picked = states [ i ] return picked
param states: Diverging states.
param states : Diverging states .
"""
                param states: Diverging states.
                """
states