"""simple docstring"""





from collections import Counter
from timeit import timeit





def 				a_     (      _lowerCAmelCase  : str = ""   , ):





       '''simple docstring'''

       return sum(c % 2 for c in Counter(input_str.replace(' '   , ''     ).lower()     ).values()     ) < 2





def 				a_     (      _lowerCAmelCase  : str = ""     ):





       '''simple docstring'''

       if len(_lowerCAmelCase     ) == 0:
              return True
       lowercase__			:		int       =	input_str.replace(' '   , ''     ).lower()
       # character_freq_dict: Stores the frequency of every character in the input string
       lowercase__			:		dict[str, int]       =	{}

       for character in lower_case_input_str:
              lowercase__			:		Optional[Any]       =	character_freq_dict.get(_lowerCAmelCase   , 0     ) + 1
       lowercase__			:		Any       =	0

       for character_count in character_freq_dict.values():
              if character_count % 2:
                     odd_char += 1
       if odd_char > 1:
              return False
       return True





def 				a_     (      _lowerCAmelCase  : str = ""     ):





       '''simple docstring'''

       print('\nFor string = '   , _lowerCAmelCase   , ':'     )
       print(
           '> can_string_be_rearranged_as_palindrome_counter()'   , '\tans ='   , can_string_be_rearranged_as_palindrome_counter(_lowerCAmelCase     )   , '\ttime ='   , timeit(
               'z.can_string_be_rearranged_as_palindrome_counter(z.check_str)'   , setup='import __main__ as z'   , )   , 'seconds'   , )
       print(
           '> can_string_be_rearranged_as_palindrome()'   , '\tans ='   , can_string_be_rearranged_as_palindrome(_lowerCAmelCase     )   , '\ttime ='   , timeit(
               'z.can_string_be_rearranged_as_palindrome(z.check_str)'   , setup='import __main__ as z'   , )   , 'seconds'   , )


if __name__ == "__main__":
       _UpperCamelCase   :						int      =    input(
           "Enter string to determine if it can be rearranged as a palindrome or not: "
       ).strip()
       benchmark(check_str)
       _UpperCamelCase   :						List[Any]      =    can_string_be_rearranged_as_palindrome_counter(check_str)
       print(f'''{check_str} can {"" if status else "not "}be rearranged as a palindrome''')









"""simple docstring"""



import argparse
import json

from tqdm import tqdm
def 						_SCREAMING_SNAKE_CASE (    ):





  '''simple docstring'''





  lowercase							    =       argparse.ArgumentParser()

  # Required parameters
  parser.add_argument(
      '--src_path'		,					type=__snake_case		,					default='biencoder-nq-dev.json'		,					help='Path to raw DPR training data'		,					)
  parser.add_argument(
      '--evaluation_set'		,					type=__snake_case		,					help='where to store parsed evaluation_set file'		,					)
  parser.add_argument(
      '--gold_data_path'		,					type=__snake_case		,					help='where to store parsed gold_data_path file'		,					)
  lowercase							    =       parser.parse_args()

  with open(args.src_path		,					'r'    ) as src_file, open(args.evaluation_set		,					'w'    ) as eval_file, open(
      args.gold_data_path		,					'w'    ) as gold_file:
    lowercase							    =       json.load(__snake_case    )
    for dpr_record in tqdm(__snake_case    ):
      lowercase							    =       dpr_record['question']
      lowercase							    =       [context['title'] for context in dpr_record['positive_ctxs']]
      eval_file.write(question + '\n'    )
      gold_file.write('\t'.join(__snake_case    ) + '\n'    )


if __name__ == "__main__":
    main()


