code: def _zipf_rv_below(gamma, xmin, threshold, seed):
      """Returns a random value chosen from the bounded Zipf distribution.
  
      Repeatedly draws values from the Zipf distribution until the
      threshold is met, then returns that value.
      """
      result = nx.utils.zipf_rv(gamma, xmin, seed)
      while result > threshold:
          result = nx.utils.zipf_rv(gamma, xmin, seed)
      return result
  
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 10 for calling a global function with example usage: _zipf_rv_below(gamma, xmin, threshold, seed) and returns: result