code: def extended_open(filename, mode="r"):
      if filename == "<stdout>":
          yield sys.stdout
      elif filename == "<stderr>":
          yield sys.stderr
      else:
          with open(filename, mode=mode) as f:
              yield f
  
imports: import atexit
  import copy
  import logging
  import operator
  import sys
  import time
  from collections import defaultdict
  from contextlib import contextmanager
  from typing import TYPE_CHECKING, Any, Optional, Union
  import numpy
  import pytensor
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply, Constant, Variable
  from pytensor.link.utils import get_destroy_dependencies
label_desc: Use image node_id 1 for calling a global function with example usage: extended_open(filename, mode) without return types