class_docstr: Options:
      - "majority": the majority value of the labels
      - "majority_weighted": the majority value of the labels, weighted by annotator's confidence
      - "disagreement": preserve the natural disagreement between annotators
docstr: The `_majority` function calculates the majority value for a given question based on the
  submitted responses in a list of feedback records.
  
  Args:
  - records The `records` parameter is a list of `FeedbackRecord` objects. Each
  `FeedbackRecord` object represents a feedback record and contains information about the
  responses given by a user.
  - question The "question" parameter in the code represents the specific question for which
  you want to determine the majority response. It is a string that identifies the question.
  
  Returns: the updated list of FeedbackRecord objects with the "_unified_responses" attribute
  updated for each record.
docstr_tok: ["The","`","_majority","`","function","calculates","the","majority","value","for","a","given","question","based","on","the","submitted","responses","in","a","list","of","feedback","records",".","Args",":","-","records","The","`","records","`","parameter","is","a","list","of","`","FeedbackRecord","`","objects",".","Each","`","FeedbackRecord","`","object","represents","a","feedback","record","and","contains","information","about","the","responses","given","by","a","user",".","-","question","The","``","question","''","parameter","in","the","code","represents","the","specific","question","for","which","you","want","to","determine","the","majority","response",".","It","is","a","string","that","identifies","the","question",".","Returns",":","the","updated","list","of","FeedbackRecord","objects","with","the","``","_unified_responses","''","attribute","updated","for","each","record","."]
code: def _majority(self, records: List[FeedbackRecord], question: str):
      """
      The `_majority` function calculates the majority value for a given question based on the
      submitted responses in a list of feedback records.
  
      Args:
      - records The `records` parameter is a list of `FeedbackRecord` objects. Each
      `FeedbackRecord` object represents a feedback record and contains information about the
      responses given by a user.
      - question The "question" parameter in the code represents the specific question for which
      you want to determine the majority response. It is a string that identifies the question.
  
      Returns: the updated list of FeedbackRecord objects with the "_unified_responses" attribute
      updated for each record.
      """
      for rec in records:
          if not rec.responses:
              continue
          counter = Counter()
          # only allow for submitted responses
          responses = [
              resp
              for resp in rec.responses
              if resp.status == "submitted"
          ]
          # get responses with a value that is most frequent
          for resp in responses:
              if isinstance(resp.values[question].value, list):
                  for value in resp.values[question].value:
                      counter.update([value])
              else:
                  counter.update([resp.values[question].value])
          # check if there is a majority based on the number of responses
          majority = int(len(responses) // 2) + 1
          majority_value = []
          for value, count in counter.items():
              if count >= majority:
                  majority_value.append(value)
  
          if not majority_value:
              majority_value = [random.choice(list(counter.keys()))]
  
          rec._unified_responses[question] = [
              UnifiedValueSchema(
                  value=list(majority_value), strategy=self.value
              )
          ]
      return records
  
imports: import random
  from abc import abstractmethod
  from collections import Counter
  from enum import Enum
  from typing import Any, Dict, List, Union
  import pandas
  from argilla.client.feedback.schemas import FeedbackRecord, LabelQuestion, MultiLabelQuestion, RankingQuestion, RatingQuestion, ValueSchema
  from argilla.pydantic_v1 import BaseModel, root_validator, validator
label_desc: Use image node_id 1 for calling the MultiLabelQuestionStrategy obj's underlying member method code with example usage: obj._majority(records, question) and returns: records