code: def ratsimp(expr):
      """
      Put an expression over a common denominator, cancel and reduce.
  
      Examples
      ========
  
      >>> from sympy import ratsimp
      >>> from sympy.abc import x, y
      >>> ratsimp(1/x + 1/y)
      (x + y)/(x*y)
      """
  
      f, g = cancel(expr).as_numer_denom()
      try:
          Q, r = reduced(f, [g], field=True, expand=False)
      except ComputationFailed:
          return f / g
  
      return Add(*Q) + cancel(r / g)
  
file_path: sympy/sympy/simplify/ratsimp.py
imports: from itertools import combinations_with_replacement
  from sympy.core import symbols, Add, Dummy
  from sympy.core.numbers import Rational
  from sympy.polys import cancel, ComputationFailed, parallel_poly_from_expr, reduced, Poly
  from sympy.polys.monomials import Monomial, monomial_div
  from sympy.polys.polyerrors import DomainError, PolificationFailed
  from sympy.utilities.misc import debug, debugf
label_desc: Use image node_id 1 for calling a global function with example usage: ratsimp(expr) and returns: unknown, unknown