class_docstr: Random number generator base class used by bound module functions.
  
  Used to instantiate instances of Random to get generators that don't
  share state.
  
  Class Random can also be subclassed if you want to use a different basic
  generator of your own devising: in that case, override the following
  methods:  random(), seed(), getstate(), and setstate().
  Optionally, implement a getrandbits() method so that randrange()
  can cover arbitrarily large ranges.
class_docstr_tok: ["Random","number","generator","base","class","used","by","bound","module","functions",".","Used","to","instantiate","instances","of","Random","to","get","generators","that","don't","share","state",".","Class","Random","can","also","be","subclassed","if","you","want","to","use","a","different","basic","generator","of","your","own","devising",":","in","that","case",",","override","the","following","methods",":","random","(",")",",","seed","(",")",",","getstate","(",")",",","and","setstate","(",")",".","Optionally",",","implement","a","getrandbits","(",")","method","so","that","randrange","(",")","can","cover","arbitrarily","large","ranges","."]
docstr: Circular data distribution.
  
  mu is the mean angle, expressed in radians between 0 and 2*pi, and
  kappa is the concentration parameter, which must be greater than or
  equal to zero.  If kappa is equal to zero, this distribution reduces
  to a uniform random angle over the range 0 to 2*pi.
docstr_tok: ["Circular","data","distribution",".","mu","is","the","mean","angle",",","expressed","in","radians","between","0","and","2","*","pi",",","and","kappa","is","the","concentration","parameter",",","which","must","be","greater","than","or","equal","to","zero",".","If","kappa","is","equal","to","zero",",","this","distribution","reduces","to","a","uniform","random","angle","over","the","range","0","to","2","*","pi","."]
code: def vonmisesvariate(self, mu, kappa):
      """Circular data distribution.
  
      mu is the mean angle, expressed in radians between 0 and 2*pi, and
      kappa is the concentration parameter, which must be greater than or
      equal to zero.  If kappa is equal to zero, this distribution reduces
      to a uniform random angle over the range 0 to 2*pi.
  
      """
      # Based upon an algorithm published in: Fisher, N.I.,
      # "Statistical Analysis of Circular Data", Cambridge
      # University Press, 1993.
  
      # Thanks to Magnus Kessler for a correction to the
      # implementation of step 4.
  
      random = self.random
      if kappa <= 1e-6:
          return TWOPI * random()
  
      s = 0.5 / kappa
      r = s + _sqrt(1.0 + s * s)
  
      while True:
          u1 = random()
          z = _cos(_pi * u1)
  
          d = z / (r + z)
          u2 = random()
          if u2 < 1.0 - d * d or u2 <= (1.0 - d) * _exp(d):
              break
  
      q = 1.0 / r
      f = (q + z) / (1.0 + q * z)
      u3 = random()
      if u3 > 0.5:
          theta = (mu + _acos(f)) % TWOPI
      else:
          theta = (mu - _acos(f)) % TWOPI
  
      return theta
  
imports: from warnings import warn
  from math import log, exp, pi, e, ceil
  from math import sqrt, acos, cos, sin
  from math import tau, floor, isfinite
  from os import urandom
  from _collections_abc import Set, Sequence
  from operator import index
  from itertools import accumulate, repeat
  from bisect import bisect
  import os
  import _random
label_desc: Use image node_id 24 for calling the Random obj's underlying member method code with example usage: obj.vonmisesvariate(mu, kappa) and returns: theta, unknown