code: def int_arg(
      request: Request, key: Text, default: Optional[int] = None
  ) -> Optional[int]:
      """Returns a passed argument cast as an int or None.
  
      Checks the `key` parameter of the request if it contains a valid
      int value. If not, `default` is returned.
  
      Args:
          request: Sanic request.
          key: Name of argument.
          default: Default value for `key` argument.
  
      Returns:
          An int value if `key` is a valid integer, `default` otherwise.
      """
      arg = request.args.get(key, default)
  
      if arg is default:
          return arg
  
      try:
          return int(str(arg))
      except (ValueError, TypeError):
          logger.warning(f"Failed to convert '{arg}' to int.")
          return default
  
imports: import ssl
  from functools import cached_property
  import aiohttp
  import logging
  import os
  from aiohttp.client_exceptions import ContentTypeError
  from sanic.request import Request
  from typing import Any, Optional, Text, Dict
  from rasa.shared.exceptions import FileNotFoundException
  import rasa.shared.utils.io
  import rasa.utils.io
  from rasa.core.constants import DEFAULT_REQUEST_TIMEOUT
label_desc: Use image node_id 5 for calling a global function with example usage: int_arg(request, key, default) and returns: arg, int, default