code: def python_level_to_golog(level: str) -> str:
      if not isinstance(level, str):
          raise ValueError(
              "`level` is expected to be a Python log level in the string form"
          )
  
      if level == "CRITICAL":
          return "FATAL"
      if level == "WARNING":
          return "WARN"
      return level
  
imports: import logging
  import os
  import sys
  import threading
  from enum import Enum
  from typing import Any, Optional, Union
label_desc: Use image node_id 8 for calling a global function with example usage: python_level_to_golog(level) and returns: level, str, str