def compare_array_and_print_results(a, b, print_msg, check_type=True):
    """
    Compare two arrays and print results.
    """
    if isinstance(a, list) or isinstance(a, tuple):
        is_equal, err_arr = compare_array(a, b, check_type=False)
        assert is_equal, (
            f"Failed, {print_msg}\n"
            f"numpy result: {err_arr[0]}\n"
            f"cupynumeric_result: {err_arr[1]}\n"
            f"cupynumeric and numpy shows"
            f" different result\n"
        )
        print(f"Passed, {print_msg}")

    else:
        is_equal, err_arr = compare_array(a, b, check_type=check_type)
        assert is_equal, (
            f"Failed, {print_msg}\n"
            f"numpy result: {err_arr[0]}, {a.shape}\n"
            f"cupynumeric_result: {err_arr[1]}, {b.shape}\n"
            f"cupynumeric and numpy shows"
            f" different result\n"
        )
        print(
            f"Passed, {print_msg}, np: ({a.shape}, {a.dtype})"
            f", cupynumeric: ({b.shape}, {b.dtype})"
        )

    Compare two arrays and print results.
    
tests/integration/utils/utils.py