def remove_duplicates(package_leaflets):
    """
    Keep only leaflets with unique product_name.

    If there is already the leaflet with same product_name - skip this leaflet

    :param package_leaflets: array of processed leaflets
    :return: array of unique leaflets
    """

    # save only leaflets with unique product_name
    package_leaflets_unique = []

    # keep track of unique product names observed so far
    unique_product_names = set()

    COUNT_DUPLICATE_PRODUCT_NAME = 0

    for leaflet in package_leaflets:
        if leaflet.product_name not in unique_product_names:
            unique_product_names.add(leaflet.product_name)
            # save unique leaflet separately
            package_leaflets_unique.append(leaflet)

        # if leaflet.product_name is in unique_product_names - then it is duplicate - do not save
        else:
            COUNT_DUPLICATE_PRODUCT_NAME += 1

    print("Number of *unique* leaflets: ", len(package_leaflets_unique))
    print("Number of *duplicate* leaflets (by product names): ", COUNT_DUPLICATE_PRODUCT_NAME)

    return package_leaflets_unique