'Return [commutative factors, non-commutative factors] of self.
self is treated as a Mul and the ordering of the factors is maintained.
If ``cset`` is True the commutative factors will be returned in a set.
If there were repeated factors (as may happen with an unevaluated Mul)
then an error will be raised unless it is explicitly supressed by
setting ``warn`` to False.
Note: -1 is always separated from a Number unless split_1 is False.
>>> from sympy import symbols, oo
>>> A, B = symbols(\'A B\', commutative=0)
>>> x, y = symbols(\'x y\')
>>> (-2*x*y).args_cnc()
[[-1, 2, x, y], []]
>>> (-2.5*x).args_cnc()
[[-1, 2.5, x], []]
>>> (-2*x*A*B*y).args_cnc()
[[-1, 2, x, y], [A, B]]
>>> (-2*x*A*B*y).args_cnc(split_1=False)
[[-2, x, y], [A, B]]
>>> (-2*x*y).args_cnc(cset=True)
[{-1, 2, x, y}, []]
The arg is always treated as a Mul:
>>> (-2 + x + A).args_cnc()
[[], [x - 2 + A]]
>>> (-oo).args_cnc() # -oo is a singleton
[[-1, oo], []]'

def args_cnc(self, cset=False, warn=True, split_1=True):

    if self.is_Mul:
        args = list(self.args)
    else:
        args = [self]
    for (i, mi) in enumerate(args):
        if (not mi.is_commutative):
            c = args[:i]
            nc = args[i:]
            break
    else:
        c = args
        nc = []
    if (c and split_1 and (c[0].is_Number and c[0].is_negative and (c[0] is not S.NegativeOne))):
        c[:1] = [S.NegativeOne, (- c[0])]
    if cset:
        clen = len(c)
        c = set(c)
        if (clen and warn and (len(c) != clen)):
            raise ValueError(('repeated    commutative    arguments:    %s' % [ci for ci in c if (list(self.args).count(ci) > 1)]))
    return [c, nc]
