code: def chain(*rules: Callable[[_T], _T]) -> Callable[[_T], _T]:
      """
      Compose a sequence of rules so that they apply to the expr sequentially
      """
  
      def chain_rl(expr: _T) -> _T:
          for rule in rules:
              expr = rule(expr)
          return expr
  
      return chain_rl
  
file_path: sympy/sympy/strategies/core.py
imports: from __future__ import annotations
  from collections.abc import Callable, Mapping
  from typing import TypeVar
  from sys import stdout
label_desc: Use image node_id 5 for calling a global function with example usage: chain() and returns: chain_rl, expr