code: def to_internal_filter(self, attribute_profile, external_attribute_names):
          
          try:
              profile_mapping = self.to_internal_attributes[attribute_profile]
          except KeyError:
              logger.warn("no attribute mapping found for the given attribute profile '%s'", attribute_profile)
              # no attributes since the given profile is not configured
              return []
  
          internal_attribute_names = set()  # use set to ensure only unique values
          for external_attribute_name in external_attribute_names:
              try:
                  internal_attribute_name = profile_mapping[external_attribute_name]
                  internal_attribute_names.add(internal_attribute_name)
              except KeyError:
                  pass
  
          return list(internal_attribute_names)
docs: Converts attribute names from external "type" to internal
  
          :type attribute_profile: str
          :type external_attribute_names: list[str]
          :type case_insensitive: bool
          :rtype: list[str]
  
          :param attribute_profile: From which external type to convert (ex: oidc, saml, ...)
          :param external_attribute_names: A list of attribute names
          :param case_insensitive: Create a case insensitive filter
          :return: A list of attribute names in the internal format