code: def create_identity(self, user, sp_mapping, **extra_config):
          
  
          return {
              out_attr: getattr(user, user_attr)
              for user_attr, out_attr in sp_mapping.items()
              if hasattr(user, user_attr)
          }
docs: Generate an identity dictionary of the user based on the given mapping of desired user attributes by the SP