'Check if the security group is already associated
with the instance. If Yes, return True.'

def is_associated_with_server(self, security_group, instance_uuid):

    if (not security_group):
        return False
    instances = security_group.get('instances')
    if (not instances):
        return False
    for inst in instances:
        if (instance_uuid == inst['uuid']):
            return True
    return False
