code: def test_arrow_time_callback():
      # Check ISO 8601 variations
      assert _arrow_time_callback(
          Mock(), Mock(), "2022.08.23"
      ) == arrow.Arrow(2022, 8, 23)
  
      assert _arrow_time_callback(
          Mock(), Mock(), "2022.08.23 12:34"
      ) == arrow.Arrow(2022, 8, 23, 12, 34)
  
      assert _arrow_time_callback(
          Mock(), Mock(), "2022-08-23 12:34"
      ) == arrow.Arrow(2022, 8, 23, 12, 34)
  
      assert _arrow_time_callback(
          Mock(), Mock(), "2022-08-23 12:34:00.000"
      ) == arrow.Arrow(2022, 8, 23, 12, 34)
  
      # Just check humanized format is parsed
      assert (
          type(_arrow_time_callback(Mock(), Mock(), "48 hours ago"))
          is arrow.Arrow
      )
  
      assert (
          type(_arrow_time_callback(Mock(), Mock(), "60 minutes ago"))
          is arrow.Arrow
      )
  
      assert (
          type(_arrow_time_callback(Mock(), Mock(), "120 seconds ago"))
          is arrow.Arrow
      )
  
      # Check raising errors
      with pytest.raises(Exception, match="cannot parse time Mon"):
          _arrow_time_callback(Mock(), Mock(), "Mon")
  
      with pytest.raises(
          Exception, match="cannot parse time Mon Sep 08 16:41:45 2022"
      ):
          _arrow_time_callback(
              Mock(), Mock(), "Mon Sep 08 16:41:45 2022"
          )
  
      with pytest.raises(
          Exception, match="cannot parse time 2022.125.12"
      ):
          _arrow_time_callback(Mock(), Mock(), "2022.125.12")
  
      with pytest.raises(
          Exception, match="cannot parse time 1 time unit ago"
      ):
          _arrow_time_callback(Mock(), Mock(), "1 time unit ago")
  
file_path: pytorch-lightning/tests/tests_app/utilities/test_cli_helpers.py
imports: import os
  import sys
  from unittest.mock import Mock, patch
  import arrow
  import lightning.app
  import pytest
  from lightning.app.utilities.cli_helpers import _arrow_time_callback, _check_environment_and_redirect, _format_input_env_variables, _get_newer_version
label_desc: Use image node_id 2 for calling a global function with example usage: test_arrow_time_callback() without return types