def METHOD_NAME(function, factory,
                       mesh, bc=None, bc_zero=None, name=None,
                       ops=None, coeffs=None,
                       negative=False, functional=False):
    def assemble_op(f, name):
        coeff, params = f.to_fenics(mesh)
        return FenicsMatrixBasedOperator(factory(coeff), params,
                                         bc=bc, bc_zero=bc_zero, functional=functional, name=name)
    if isinstance(function, LincombFunction):
        operators = [assemble_op(f, f'{name}_{i}') for i, f in enumerate(function.functions)]
        cfs = [-c if negative else c for c in function.coefficients]
        if ops is not None:
            ops.extend(operators)
            coeffs.extend(cfs)
        else:
            return LincombOperator(operators, cfs, name=name)
    elif function is not None:
        operator = assemble_op(function, name)
        if ops is not None:
            ops.append(operator)
            coeffs.append(-1 if negative else 1.)
        else:
            return -operator if negative else operator