(eqs)
return result
Solve a system of rational inequalities with rational coefficients.

    Examples
    ========

    >>> from sympy.abc import x
    >>> from sympy import Poly
    >>> from sympy.solvers.inequalities import solve_rational_inequalities

    >>> solve_rational_inequalities([[
    ... ((Poly(-x + 1), Poly(1, x)), '>='),
    ... ((Poly(-x + 1), Poly(1, x)), '<=')]])
    {1}

    >>> solve_rational_inequalities([[
    ... ((Poly(x), Poly(1, x)), '!='),
    ... ((Poly(-x + 1), Poly(1, x)), '>=')]])
    (-oo, 0) U (0, 1]

    See Also
    ========
    solve_poly_inequality
Solve a system of rational inequalities with rational coefficients.
Solve a system of rational inequalities with rational coefficients .
def solve_rational_inequalities(eqs):
    """Solve a system of rational inequalities with rational coefficients.

    Examples
    ========

    >>> from sympy.abc import x
    >>> from sympy import Poly
    >>> from sympy.solvers.inequalities import solve_rational_inequalities

    >>> solve_rational_inequalities([[
    ... ((Poly(-x + 1), Poly(1, x)), '>='),
    ... ((Poly(-x + 1), Poly(1, x)), '<=')]])
    {1}

    >>> solve_rational_inequalities([[
    ... ((Poly(x), Poly(1, x)), '!='),
    ... ((Poly(-x + 1), Poly(1, x)), '>=')]])
    (-oo, 0) U (0, 1]

    See Also
    ========
    solve_poly_inequality
    """
    result = S.EmptySet

    for _eqs in eqs:
        global_intervals = None

        for (numer, denom), rel in _eqs:
            numer_intervals = solve_poly_inequality(numer*denom, rel)
            denom_intervals = solve_poly_inequality(denom, '==')

            if global_intervals is None:
                global_intervals = numer_intervals
            else:
                intervals = []

                for numer_interval in numer_intervals:
                    for global_interval in global_intervals:
                        interval = numer_interval.intersect(global_interval)

                        if interval is not S.EmptySet:
                            intervals.append(interval)

                global_intervals = intervals

            intervals = []

            for global_interval in global_intervals:
                for denom_interval in denom_intervals:
                    global_interval -= denom_interval

                if global_interval is not S.EmptySet:
                    intervals.append(global_interval)

            global_intervals = intervals

            if not global_intervals:
                break

        for interval in global_intervals:
            result = result.union(interval)

    return result
def solve_rational_inequalities ( eqs ) : result = S . EmptySet for _eqs in eqs : global_intervals = None for ( numer , denom ) , rel in _eqs : numer_intervals = solve_poly_inequality ( numer * denom , rel ) denom_intervals = solve_poly_inequality ( denom , '==' ) if global_intervals is None : global_intervals = numer_intervals else : intervals = [ ] for numer_interval in numer_intervals : for global_interval in global_intervals : interval = numer_interval . intersect ( global_interval ) if interval is not S . EmptySet : intervals . append ( interval ) global_intervals = intervals intervals = [ ] for global_interval in global_intervals : for denom_interval in denom_intervals : global_interval -= denom_interval if global_interval is not S . EmptySet : intervals . append ( global_interval ) global_intervals = intervals if not global_intervals : break for interval in global_intervals : result = result . union ( interval ) return result