

def _mul_as_two_parts(f):
    '\n    Find all the ways to split f into a product of two terms.\n    Return None on failure.\n\n    Although the order is canonical from multiset_partitions, this is\n    not necessarily the best order to process the terms. For example,\n    if the case of len(gs) == 2 is removed and multiset is allowed to\n    sort the terms, some tests fail.\n\n    >>> from sympy.integrals.meijerint import _mul_as_two_parts\n    >>> from sympy import sin, exp, ordered\n    >>> from sympy.abc import x\n    >>> list(ordered(_mul_as_two_parts(x*sin(x)*exp(x))))\n    [(x, exp(x)*sin(x)), (x*exp(x), sin(x)), (x*sin(x), exp(x))]\n    '
    gs = _mul_args(f)
    if (len(gs) < 2):
        return None
    if (len(gs) == 2):
        return [tuple(gs)]
    return [(Mul(*x), Mul(*y)) for (x, y) in multiset_partitions(gs, 2)]

dataset/ETHPy150Open sympy/sympy/sympy/integrals/meijerint.py _mul_as_two_parts/original