
'''simple docstring'''
def 						A_(			A		:						list[int | list]						,			A		:						int):
							UpperCamelCase					       =			0
							for ele in arr:
														total_sum += product_sum(A						,			depth + 1) if isinstance(A						,			A) else ele
							return total_sum * depth







def 						A_(			A		:						list[int | list]):
							return product_sum(A						,			1)


if __name__ == "__main__":
						import doctest

						doctest.testmod()






'''simple docstring'''

import io
import json
import subprocess


lowerCAmelCase_			:			Tuple			   =     [
    ['''en''', '''ru'''],
    ['''ru''', '''en'''],
    ['''en''', '''de'''],
    ['''de''', '''en'''],
]

lowerCAmelCase_			:			str			   =     8







def __A  (    lowerCAmelCase_ ,       lowerCAmelCase_       ):
     _UpperCAmelCase					:  Union[str, Any]         =    {}
     for src, tgt in pairs:
          _UpperCAmelCase					:  Union[str, Any]         =    f"{src}-{tgt}"
          _UpperCAmelCase					:  List[Any]         =    f"sacrebleu -t wmt19 -l {pair} --echo src".split()
          _UpperCAmelCase					:  List[str]         =    subprocess.run(lowerCAmelCase_ ,       stdout=subprocess.PIPE       ).stdout.decode("""utf-8"""       ).splitlines()
          _UpperCAmelCase					:  str         =    f"sacrebleu -t wmt19 -l {pair} --echo ref".split()
          _UpperCAmelCase					:  List[Any]         =    subprocess.run(lowerCAmelCase_ ,       stdout=subprocess.PIPE       ).stdout.decode("""utf-8"""       ).splitlines()
          _UpperCAmelCase					:  int         =    {"""src""": src_lines[:n_objs], """tgt""": tgt_lines[:n_objs]}
     return text


lowerCAmelCase_			:			Optional[int]			   =     get_all_data(pairs, n_objs)
lowerCAmelCase_			:			str			   =     '''./fsmt_val_data.json'''
with io.open(filename, '''w''', encoding='''utf-8''') as f:
   lowerCAmelCase_			:			Tuple			   =     json.dump(text, f, indent=2, ensure_ascii=False)


