'''simple docstring'''




import json
import sys






def 							snake_case__				(     _A:   Dict ,  _A:   Optional[Any]					)       ->      str:

		'''simple docstring'''


		with open(_A ,  encoding="""utf-8"""					) as f:
				lowerCAmelCase     =    json.load(_A					)

		lowerCAmelCase     =    ["""<details>""", """<summary>Show updated benchmarks!</summary>""", """ """]

		for benchmark_name in sorted(_A					):
				lowerCAmelCase     =    results[benchmark_name]

				lowerCAmelCase     =    benchmark_name.split("""/"""					)[-1]
				output_md.append(f"### Benchmark: {benchmark_file_name}"					)

				lowerCAmelCase     =    """| metric |"""
				lowerCAmelCase     =    """|--------|"""
				lowerCAmelCase     =    """| new / old (diff) |"""
				for metric_name in sorted(_A					):
						lowerCAmelCase     =    benchmark_res[metric_name]
						lowerCAmelCase     =    metric_vals["""new"""]
						lowerCAmelCase     =    metric_vals.get("""old""" ,  _A					)
						lowerCAmelCase     =    metric_vals.get("""diff""" ,  _A					)

						lowerCAmelCase     =    f" {new_val:f}" if isinstance(_A ,  (int, float)					) else """None"""

						if old_val is not None:
								val_str += f" / {old_val:f}" if isinstance(_A ,  (int, float)					) else "None"
						if dif_val is not None:
								val_str += f" ({dif_val:f})" if isinstance(_A ,  (int, float)					) else "None"

						title += " " + metric_name + " |"
						lines += "---|"
						value += val_str + " |"

				output_md += [title, lines, value, " "]

		output_md.append("""</details>"""					)

		with open(_A ,  """w""" ,  encoding="""utf-8"""					) as f:
				f.writelines("""\n""".join(_A					)					)


if __name__ == "__main__":
						__lowercase        =    sys.argv[1]
						__lowercase        =    sys.argv[2]

						format_json_to_md(input_json_file, output_md_file)





'''simple docstring'''




def 							snake_case__				(     _A:   int					)       ->      list[int]:

		'''simple docstring'''


		if length <= 0 or not isinstance(_A ,  _A					):
				raise ValueError("""Length must be a positive integer."""					)
		return [n * (2 * n - 1) for n in range(_A					)]


if __name__ == "__main__":
						print(hexagonal_numbers(length=5))
						print(hexagonal_numbers(length=1_0))




