<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apply_rule(self, pattern, replacement, recursive=True):
 """Apply a single rules to the expression This is equivalent to :meth:`apply_rules` with ``rules=[(pattern, replacement)]`` Args: pattern (.Pattern):
 A pattern containing one or more wildcards replacement (callable):
 A callable that takes the wildcard names in `pattern` as keyword arguments, and returns a replacement for any expression that `pattern` matches. Example: Consider the following Heisenberg Hamiltonian:: '- (∑_{i,j ∈ ℌₛ} J_ij σ̂_i^(s) σ̂_j^(s))' We can transform this into a classical Hamiltonian by replacing the operators with scalars:: '- (∑_{i,j ∈ ℌₛ} J_ij σ_i σ_j)' """

        return self.apply_rules([(pattern, replacement)], recursive=recursive)