code: def null_safe(rule: Callable[[_T], _T | None]) -> Callable[[_T], _T]:
      """Return original expr if rule returns None"""
  
      def null_safe_rl(expr: _T) -> _T:
          result = rule(expr)
          if result is None:
              return expr
          return result
  
      return null_safe_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 7 for calling a global function with example usage: null_safe(rule) and returns: null_safe_rl, result, expr