code: def test_infer_user_script_when_missing():
      """Test that user script is inferred correctly even if missing"""
      parser = OrionCmdlineParser()
  
      with pytest.raises(FileNotFoundError) as exc:
          parser.parse("python script.py and some args".split(" "))
      assert exc.match(
          "The path specified for the script does not exist"
      )
  
      parser = OrionCmdlineParser(allow_non_existing_files=True)
      parser.parse("python script.py and some args".split(" "))
      assert parser.user_script == "script.py"
  
imports: import os
  from pathlib import Path
  from typing import Any, List, NamedTuple, Optional, Tuple
  import pytest
  from orion.core.io.convert import JSONConverter
  from orion.core.io.orion_cmdline_parser import OrionCmdlineParser
  from orion.core.worker.experiment import Experiment
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 23 for calling a global function with example usage: test_infer_user_script_when_missing() without return types