def _powerlaw_sequence(gamma, low, high, condition, length, max_iters):
 for i in range(max_iters):
  seq = []
  while (not length(seq)):
   seq.append(_zipf_rv_below(gamma, low, high))
  if condition(seq):
   return seq
 raise nx.ExceededMaxIterations('Could not create power law sequence')

def _powerlaw_sequence ( gamma , low , high , condition , length , max_iters ) : for i in range ( max_iters ) : seq = [ ] while ( not length ( seq ) ) : seq . append ( _zipf_rv_below ( gamma , low , high ) ) if condition ( seq ) : return seq raise nx . ExceededMaxIterations ( 'Could not create power law sequence' )
returns a list of numbers obeying a power law distribution .