code: 
  
  
  
  
  
  '''simple docstring'''
  
  import argparse
  import json
  import re
  import string
  import sys
  from collections import Counter
  
  
  
  
  
  def lowerCamelCase		(  __lowerCamelCase				:					int					)		->Any:
  
      def remove_articles(__lowerCamelCase				:					Any					):
          return re.sub(R"""\b(a|an|the)\b"""      , """ """      , __lowerCamelCase					)
  
      def white_space_fix(__lowerCamelCase				:					Any					):
          return " ".join(text.split()					)
  
      def remove_punc(__lowerCamelCase				:					List[str]					):
          _SCREAMING_SNAKE_CASE             =    set(string.punctuation					)
          return "".join(ch for ch in text if ch not in exclude					)
  
      def lower(__lowerCamelCase				:					Optional[Any]					):
          return text.lower()
  
      return white_space_fix(remove_articles(remove_punc(lower(__lowerCamelCase					)					)					)					)
  
  
  
  
  
  def lowerCamelCase		(  __lowerCamelCase				:					str      , __lowerCamelCase				:					int					)		->Optional[Any]:
      _SCREAMING_SNAKE_CASE             =    normalize_answer(__lowerCamelCase					).split()
      _SCREAMING_SNAKE_CASE             =    normalize_answer(__lowerCamelCase					).split()
      _SCREAMING_SNAKE_CASE             =    Counter(__lowerCamelCase					) & Counter(__lowerCamelCase					)
      _SCREAMING_SNAKE_CASE             =    sum(common.values()					)
      if num_same == 0:
          return 0
      _SCREAMING_SNAKE_CASE             =    1.0 * num_same / len(__lowerCamelCase					)
      _SCREAMING_SNAKE_CASE             =    1.0 * num_same / len(__lowerCamelCase					)
      _SCREAMING_SNAKE_CASE             =    (2 * precision * recall) / (precision + recall)
      return fa
  
  
  
  
  
  def lowerCamelCase		(  __lowerCamelCase				:					int      , __lowerCamelCase				:					List[Any]					)		->Optional[Any]:
      return normalize_answer(__lowerCamelCase					) == normalize_answer(__lowerCamelCase					)
  
  
  
  
  
  def lowerCamelCase		(  __lowerCamelCase				:					List[Any]      , __lowerCamelCase				:					str      , __lowerCamelCase				:					List[Any]					)		->str:
      _SCREAMING_SNAKE_CASE             =    []
      for ground_truth in ground_truths:
          _SCREAMING_SNAKE_CASE             =    metric_fn(__lowerCamelCase      , __lowerCamelCase					)
          scores_for_ground_truths.append(__lowerCamelCase					)
      return max(__lowerCamelCase					)
  
  
  
  
  
  def lowerCamelCase		(  __lowerCamelCase				:					Tuple      , __lowerCamelCase				:					Any					)		->Tuple:
      _SCREAMING_SNAKE_CASE             =    _SCREAMING_SNAKE_CASE             =    _SCREAMING_SNAKE_CASE             =    0
      for article in dataset:
          for paragraph in article["paragraphs"]:
              for qa in paragraph["qas"]:
                  total += 1
                  if qa["id"] not in predictions:
                      _SCREAMING_SNAKE_CASE             =    """Unanswered question """ + qa["""id"""] + """ will receive score 0."""
                      print(__lowerCamelCase      , file=sys.stderr					)
                      continue
                  _SCREAMING_SNAKE_CASE             =    [x["""text"""] for x in qa["""answers"""]]
                  _SCREAMING_SNAKE_CASE             =    predictions[qa["""id"""]]
                  exact_match += metric_max_over_ground_truths(__lowerCamelCase      , __lowerCamelCase      , __lowerCamelCase					)
                  fa += metric_max_over_ground_truths(__lowerCamelCase      , __lowerCamelCase      , __lowerCamelCase					)
  
      _SCREAMING_SNAKE_CASE             =    100.0 * exact_match / total
      _SCREAMING_SNAKE_CASE             =    100.0 * fa / total
  
      return {"exact_match": exact_match, "f1": fa}
  
  
  if __name__ == "__main__":
        lowercase_			       =				"""1.1"""
        lowercase_			       =				argparse.ArgumentParser(description="""Evaluation for SQuAD """ + expected_version)
        parser.add_argument("""dataset_file""", help="""Dataset file""")
        parser.add_argument("""prediction_file""", help="""Prediction File""")
        lowercase_			       =				parser.parse_args()
        with open(args.dataset_file) as dataset_file:
              lowercase_			       =				json.load(dataset_file)
              if dataset_json["version"] != expected_version:
                    print(
                        """Evaluation expects v-""" + expected_version + """, but got dataset with v-""" + dataset_json["""version"""],
                        file=sys.stderr,
                    )
              lowercase_			       =				dataset_json["""data"""]
        with open(args.prediction_file) as prediction_file:
              lowercase_			       =				json.load(prediction_file)
        print(json.dumps(evaluate(dataset, predictions)))
  
  
  
  
style_context: 
  
  
  
  
  
  '''simple docstring'''
  
  def lowerCamelCase		(  __lowerCamelCase				:					float      , __lowerCamelCase				:					float      , __lowerCamelCase				:					float					)		->list[int]:
      if hue < 0 or hue > 360:
          raise Exception("""hue should be between 0 and 360"""					)
  
      if saturation < 0 or saturation > 1:
          raise Exception("""saturation should be between 0 and 1"""					)
  
      if value < 0 or value > 1:
          raise Exception("""value should be between 0 and 1"""					)
  
      _SCREAMING_SNAKE_CASE             =    value * saturation
      _SCREAMING_SNAKE_CASE             =    hue / 60
      _SCREAMING_SNAKE_CASE             =    chroma * (1 - abs(hue_section % 2 - 1					))
      _SCREAMING_SNAKE_CASE             =    value - chroma
  
      if hue_section >= 0 and hue_section <= 1:
          _SCREAMING_SNAKE_CASE             =    round(255 * (chroma + match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (second_largest_component + match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (match_value)					)
      elif hue_section > 1 and hue_section <= 2:
          _SCREAMING_SNAKE_CASE             =    round(255 * (second_largest_component + match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (chroma + match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (match_value)					)
      elif hue_section > 2 and hue_section <= 3:
          _SCREAMING_SNAKE_CASE             =    round(255 * (match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (chroma + match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (second_largest_component + match_value)					)
      elif hue_section > 3 and hue_section <= 4:
          _SCREAMING_SNAKE_CASE             =    round(255 * (match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (second_largest_component + match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (chroma + match_value)					)
      elif hue_section > 4 and hue_section <= 5:
          _SCREAMING_SNAKE_CASE             =    round(255 * (second_largest_component + match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (chroma + match_value)					)
      else:
          _SCREAMING_SNAKE_CASE             =    round(255 * (chroma + match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (match_value)					)
          _SCREAMING_SNAKE_CASE             =    round(255 * (second_largest_component + match_value)					)
  
      return [red, green, blue]
  
  
  
  
  
  def lowerCamelCase		(  __lowerCamelCase				:					int      , __lowerCamelCase				:					int      , __lowerCamelCase				:					int					)		->list[float]:
      if red < 0 or red > 255:
          raise Exception("""red should be between 0 and 255"""					)
  
      if green < 0 or green > 255:
          raise Exception("""green should be between 0 and 255"""					)
  
      if blue < 0 or blue > 255:
          raise Exception("""blue should be between 0 and 255"""					)
  
      _SCREAMING_SNAKE_CASE             =    red / 255
      _SCREAMING_SNAKE_CASE             =    green / 255
      _SCREAMING_SNAKE_CASE             =    blue / 255
      _SCREAMING_SNAKE_CASE             =    max(__lowerCamelCase      , __lowerCamelCase      , __lowerCamelCase					)
      _SCREAMING_SNAKE_CASE             =    value - min(__lowerCamelCase      , __lowerCamelCase      , __lowerCamelCase					)
      _SCREAMING_SNAKE_CASE             =    0 if value == 0 else chroma / value
  
      if chroma == 0:
          _SCREAMING_SNAKE_CASE             =    0.0
      elif value == float_red:
          _SCREAMING_SNAKE_CASE             =    60 * (0 + (float_green - float_blue) / chroma)
      elif value == float_green:
          _SCREAMING_SNAKE_CASE             =    60 * (2 + (float_blue - float_red) / chroma)
      else:
          _SCREAMING_SNAKE_CASE             =    60 * (4 + (float_red - float_green) / chroma)
  
      _SCREAMING_SNAKE_CASE             =    (hue + 360) % 360
  
      return [hue, saturation, value]
  
  
  
  
  
  
  def lowerCamelCase		(  __lowerCamelCase				:					list[float]      , __lowerCamelCase				:					list[float]					)		->bool:
      _SCREAMING_SNAKE_CASE             =    abs(hsv_a[0] - hsv_a[0]					) < 0.2
      _SCREAMING_SNAKE_CASE             =    abs(hsv_a[1] - hsv_a[1]					) < 0.002
      _SCREAMING_SNAKE_CASE             =    abs(hsv_a[2] - hsv_a[2]					) < 0.002
  
      return check_hue and check_saturation and check_value
  
  
  
  