code: def check_response(
      self,
      response: ResponseValue,
      status: Optional[ResponseStatus] = None,
  ):
      if not isinstance(response.value, list):
          raise ValueError(
              f"This Ranking question expects a list of values, found {type(response.value)}"
          )
  
      values = []
      ranks = []
      for response_option in response.value:
          values.append(response_option.get("value"))
          ranks.append(response_option.get("rank"))
  
      # Only if the response is submitted check that all the possible options have been ranked or that all the
      # provided options contains a valid rank
      if status == ResponseStatus.submitted:
          if len(response.value) != len(self.option_values):
              raise ValueError(
                  f"This Ranking question expects a list containing {len(self.option_values)} values, found a list of"
                  f" {len(response.value)} values"
              )
  
          invalid_ranks = _are_all_elements_in_list(
              ranks, self.rank_values
          )
          if invalid_ranks:
              raise ValueError(
                  f"{invalid_ranks!r} are not valid ranks for this Ranking question.\nValid ranks are:"
                  f" {self.rank_values!r}"
              )
  
      invalid_values = _are_all_elements_in_list(
          values, self.option_values
      )
      if invalid_values:
          raise ValueError(
              f"{invalid_values!r} are not valid options for this Ranking question.\nValid options are:"
              f" {self.option_values!r}"
          )
  
      unique_values = set(values)
      if len(response.value) != len(unique_values):
          raise ValueError(
              "This Ranking question expects a list of unique values, but duplicates were found"
          )
  
imports: from typing import Any, Generic, List, Literal, Optional, Protocol, TypeVar, Union
  from argilla.server.enums import QuestionType, ResponseStatus
  from argilla.server.pydantic_v1 import BaseModel, Field
label_desc: Use image node_id 2 for calling the RankingQuestionSettings obj's underlying member method code with example usage: obj.check_response(response, status) without return types