code: def _powerlaw_sequence(
      gamma, low, high, condition, length, max_iters, seed
  ):
      """Returns a list of numbers obeying a constrained power law distribution.
  
      ``gamma`` and ``low`` are the parameters for the Zipf distribution.
  
      ``high`` is the maximum allowed value for values draw from the Zipf
      distribution. For more information, see :func:`_zipf_rv_below`.
  
      ``condition`` and ``length`` are Boolean-valued functions on
      lists. While generating the list, random values are drawn and
      appended to the list until ``length`` is satisfied by the created
      list. Once ``condition`` is satisfied, the sequence generated in
      this way is returned.
  
      ``max_iters`` indicates the number of times to generate a list
      satisfying ``length``. If the number of iterations exceeds this
      value, :exc:`~networkx.exception.ExceededMaxIterations` is raised.
  
      seed : integer, random_state, or None (default)
          Indicator of random number generation state.
          See :ref:`Randomness<randomness>`.
      """
      for i in range(max_iters):
          seq = []
          while not length(seq):
              seq.append(_zipf_rv_below(gamma, low, high, seed))
          if condition(seq):
              return seq
      raise nx.ExceededMaxIterations(
          "Could not create power law sequence"
      )
  
file_path: networkx/networkx/generators/community.py
imports: import itertools
  import math
  import networkx
  from networkx.utils import py_random_state
label_desc: Use image node_id 11 for calling a global function with example usage: _powerlaw_sequence(gamma, low, high, condition, length, max_iters, seed) and returns: seq