code: def test_ScanArgs_remove_outer_input():
      hmm_model_env = create_test_hmm()
      scan_args = hmm_model_env["scan_args"]
      hmm_model_env["scan_op"]
      Y_t = hmm_model_env["Y_t"]
      Y_rv = hmm_model_env["Y_rv"]
      sigmas_in = hmm_model_env["sigmas_in"]
      sigmas_t = hmm_model_env["sigmas_t"]
      Gamma_rv = hmm_model_env["Gamma_rv"]
      Gamma_in = hmm_model_env["Gamma_in"]
      hmm_model_env["S_rv"]
      S_in = hmm_model_env["S_in"]
      S_t = hmm_model_env["S_t"]
      rng_in = hmm_model_env["rng_in"]
      scan_updates = hmm_model_env["scan_updates"]
  
      # Remove `sigmas` (i.e. the outer-input)
      scan_args_copy = copy(scan_args)
      test_v = sigmas_in
      rm_info = scan_args_copy.remove_from_fields(
          test_v, rm_dependents=True
      )
      removed_nodes, _ = zip(*rm_info)
  
      # `sigmas_in` (i.e. outer-graph input) should be gone
      assert scan_args.outer_in_seqs[-1] in removed_nodes
      assert test_v not in scan_args_copy.inner_in_seqs
  
      # `sigmas[t]` should be gone
      assert sigmas_t in removed_nodes
      assert sigmas_t not in scan_args_copy.inner_in_seqs
  
      # `Y_t` (i.e. inner-graph output) should be gone
      assert Y_t in removed_nodes
      assert len(scan_args_copy.inner_out_nit_sot) == 0
  
      # `Y_rv` (i.e. outer-graph output) should be gone
      assert Y_rv not in scan_args_copy.outer_outputs
      assert len(scan_args_copy.outer_out_nit_sot) == 0
  
      assert S_t in scan_args_copy.inner_out_sit_sot
      assert S_in in scan_args_copy.outer_out_sit_sot
      assert Gamma_in in scan_args_copy.inner_in_non_seqs
      assert Gamma_rv in scan_args_copy.outer_in_non_seqs
      assert rng_in in scan_args_copy.inner_out_shared
      assert list(scan_updates.values()) == scan_args.outer_out_shared
  
file_path: pytensor/tests/scan/test_utils.py
imports: from copy import copy
  import numpy
  import pytest
  import pytensor
  from pytensor import tensor
  from pytensor.scan.utils import ScanArgs
label_desc: Use image node_id 6 for calling a global function with example usage: test_ScanArgs_remove_outer_input() without return types