code: def client_preferences_match_provider_capabilities(provider, registration_request):
      
  
      def match(client_preference, provider_capability):
          if isinstance(client_preference, list):
              # deal with comparing space separated values, e.g. 'response_types', without considering the order
              # at least one requested preference must be matched
              return len(find_common_values(client_preference, provider_capability)) > 0
  
          return client_preference in provider_capability
  
      for client_preference in registration_request.keys():
          if client_preference not in PREFERENCE2PROVIDER:
              # metadata parameter that shouldn't be matched
              continue
  
          provider_capability = PREFERENCE2PROVIDER[client_preference]
          if not match(registration_request[client_preference], provider.configuration_information[provider_capability]):
              raise InvalidClientRegistrationRequest(
                  'Could not match client preference {}={} with provider capability {}={}'.format(
                      client_preference, registration_request[client_preference], provider_capability,
                      provider.configuration_information[provider_capability]),
                  registration_request,
                  oauth_error='invalid_request')
docs: Verifies that all requested preferences in the client metadata can be fulfilled by this provider.
      :param registration_request: the authentication request to verify
      :raise InvalidClientRegistrationRequest: if the registration is incorrect