def _mul_as_two_parts(f):
 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)]

def _mul_as_two_parts ( f ) : 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 ) ]
find all the ways to split f into a product of two terms .