<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_duplicate_sg(security_groups):
 """Removes duplicate Security Groups that share a same name alias Args: security_groups (list):
 A list of security group id to compare against SECURITYGROUP_REPLACEMENTS Returns: security_groups (list):
 A list of security groups with duplicate aliases removed """

    for each_sg, duplicate_sg_name in SECURITYGROUP_REPLACEMENTS.items():
        if each_sg in security_groups and duplicate_sg_name in security_groups:
            LOG.info('Duplicate SG found. Removing %s in favor of %s.', duplicate_sg_name, each_sg)
            security_groups.remove(duplicate_sg_name)

    return security_groups