code: def iter_over_pairs(pairs):
      """
      Return an iterator over pairs present in the 'pairs' input.
  
      Parameters
      ----------
      pairs : dictionary or iterable
          The pairs to iterate upon. These may be stored either as (key, value)
          items in a dictionary, or directly as pairs in any kind of iterable
          structure.
  
      Returns
      -------
      iterable
          An iterable yielding pairs.
  
      """
      if isinstance(pairs, dict):
          return pairs.items()
      else:
          return pairs
  
file_path: pytensor/pytensor/compile/function/pfunc.py
imports: from collections.abc import Sequence
  from copy import copy
  from typing import Optional, Union, overload
  from pytensor.compile.function.types import Function, UnusedInputError, orig_function
  from pytensor.compile.io import In, Out
  from pytensor.compile.profiling import ProfileStats
  from pytensor.compile.sharedvalue import SharedVariable, shared
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Constant, Variable, clone_node_and_cache
  from pytensor.graph.fg import FunctionGraph
label_desc: Use image node_id 9 for calling a global function with example usage: iter_over_pairs(pairs) and returns: pairs, pairs