code: def test_rationalize():
      from mpmath import cos, pi, mpf
  
      assert rationalize(cos(pi / 3)) == S.Half
      assert rationalize(mpf("0.333333333333333")) == Rational(1, 3)
      assert rationalize(mpf("-0.333333333333333")) == Rational(-1, 3)
      assert rationalize(pi, maxcoeff=250) == Rational(355, 113)
  
file_path: sympy/sympy/concrete/tests/test_guess.py
imports: from sympy.concrete.guess import find_simple_recurrence_vector, find_simple_recurrence, rationalize, guess_generating_function_rational, guess_generating_function, guess
  from sympy.concrete.products import Product
  from sympy.core.function import Function
  from sympy.core.numbers import Rational
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.core.sympify import sympify
  from sympy.functions.combinatorial.factorials import RisingFactorial, factorial
  from sympy.functions.combinatorial.numbers import fibonacci
  from sympy.functions.elementary.exponential import exp
label_desc: Use image node_id 3 for calling a global function with example usage: test_rationalize() without return types