code: def foldr(
      fn,
      sequences,
      outputs_info,
      non_sequences=None,
      mode=None,
      name=None,
  ):
      """Construct a `Scan` `Op` that functions like Haskell's `foldr`.
  
      Parameters
      ----------
      fn
          The function that ``foldr`` applies at each iteration step
          (see ``scan`` for more info).
      sequences
          List of sequences over which ``foldr`` iterates
          (see ``scan`` for more info).
      outputs_info
          List of dictionaries describing the outputs of reduce
          (see ``scan`` for more info).
      non_sequences
          List of arguments passed to `fn`. ``foldr`` will not iterate over these
          arguments (see ``scan`` for more info).
      mode
          See ``scan``.
      name
          See ``scan``.
  
      """
      return reduce(
          fn=fn,
          sequences=sequences,
          outputs_info=outputs_info,
          non_sequences=non_sequences,
          go_backwards=True,
          mode=mode,
          name=name,
      )
  
imports: import logging
  from pytensor.scan import scan
label_desc: Use image node_id 4 for calling a global function with example usage: foldr(fn, sequences, outputs_info, non_sequences, mode, name) and returns: reduce