<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def factor_product(*args):
 """ Returns factor product over `args`. Parameters args: `BaseFactor` instances. factors to be multiplied Returns ------- BaseFactor: `BaseFactor` representing factor product over all the `BaseFactor` instances in args. Examples -------- ['x1', 'x2', 'x3', 'x4'] array([2, 3, 2, 2]) array([[[[ 0, 0], [ 4, 6]], [[ 0, 4], [12, 18]], [[ 0, 8], [20, 30]]], [[[ 6, 18], [35, 49]], [[ 8, 24], [45, 63]], [[10, 30], [55, 77]]]]) """

    if not all(isinstance(phi, BaseFactor) for phi in args):
        raise TypeError("Arguments must be factors")
    # Check if all of the arguments are of the same type
    elif len(set(map(type, args))) != 1:
            raise NotImplementedError("All the args are expected to ",
                                      "be instances of the same factor class.")

    return reduce(lambda phi1, phi2: phi1 * phi2, args)