code: def emitter(p=0.1):
      """Return a random value in [0, 1) with probability p, else 0."""
      while True:
          v = np.random.rand()
          if v > p:
              yield 0.0
          else:
              yield np.random.rand()
  
file_path: matplotlib/galleries/examples/animation/strip_chart.py
imports: import matplotlib.pyplot
  import numpy
  import matplotlib.animation
  from matplotlib.lines import Line2D
label_desc: Use image node_id 1 for calling a global function with example usage: emitter(p) without return types