# Import suggested package
from package import function


def update_mailing_list_extended(mailing_list):
     """
       Your docstring documentation starts here.

       For more information on how to proper document your function, please refer to the official PEP8:
        https://www.python.org/dev/peps/pep-0008/#documentation-strings.

    """

     # Checks it the flag `opt-out` is present. You can use lower() to lowercase the flags and contemplate both
     # `opt-out` and `OPT-OUT` cases
     # Then, checks for the presence of the `unsubscribed` flag Finally,
     # checks if the email address contains `@gmail` provider
     for key, value in mailing_list_copy.items():

         # Your conditional logic to filter out the unsubscribed users
         if ():
     # Remove the key if one of the above conditions is satisfied


    # An array to collect the final output
    ids = []

    # Loop through the updated mailing list and append the ids of the active users to the `id` list
    for key, value in  # Your updated dictionary:
    # Append only the ids of the active users

    # Returns the updated mailing list with the active users
    return ids

