code: def random_complex_number(
      a=2, b=-1, c=3, d=1, rational=False, tolerance=None
  ):
      """
      Return a random complex number.
  
      To reduce chance of hitting branch cuts or anything, we guarantee
      b <= Im z <= d, a <= Re z <= c
  
      When rational is True, a rational approximation to a random number
      is obtained within specified tolerance, if any.
      """
      from sympy.core.numbers import I
      from sympy.simplify.simplify import nsimplify
  
      A, B = uniform(a, c), uniform(b, d)
      if not rational:
          return A + I * B
      return nsimplify(
          A, rational=True, tolerance=tolerance
      ) + I * nsimplify(B, rational=True, tolerance=tolerance)
  
file_path: sympy/sympy/core/random.py
imports: from sympy.utilities.iterables import is_sequence
  from sympy.utilities.misc import as_int
  import random
label_desc: Use image node_id 2 for calling a global function with example usage: random_complex_number(a, b, c, d, rational, tolerance) and returns: unknown, unknown