code: def compose_tx(*tx_list):
      """Utility to compose a sequence of TxPairs.
  
      The transformations are applied in order during the `apply` method:
      e.g. [f, g] --> y = g(f(x))
      and in reverse order during the `apply_inv` method:
      e.g. [f, g] --> x = f^-1(g^-1(x))
  
      Args:
        *tx_list: a sequence of TxPairs as positional arguments.
  
      Returns:
        a new TxPair.
      """
  
      def apply_fn(x: chex.Array):
          for tx in tx_list:
              x = tx.apply(x)
          return x
  
      def apply_inv_fn(x: chex.Array):
          for tx in tx_list[::-1]:
              x = tx.apply_inv(x)
          return x
  
      return TxPair(apply_fn, apply_inv_fn)
  
file_path: rlax/rlax/_src/nonlinear_bellman.py
imports: import collections
  import functools
  import chex
  import jax.numpy
  from rlax._src import base
  from rlax._src import multistep
  from rlax._src import transforms
label_desc: Use image node_id 2 for calling a global function with example usage: compose_tx() and returns: TxPair, x, x