code: def rule(self):
          
          step_ratio = self.step_ratio
          method = self.method
          if method in ('multicomplex', ) or self.n == 0:
              return np.ones((1,))
  
          order, method_order = self.n - 1, self._method_order
          parity = self._parity(method, order, method_order)
          step = self._richardson_step()
          num_terms, ix = (order + method_order) // step, order // step
          fd_rules = FD_RULES.get((step_ratio, parity, num_terms))
          if fd_rules is None:
              fd_mat = self._fd_matrix(step_ratio, parity, num_terms)
              fd_rules = linalg.pinv(fd_mat)
              FD_RULES[(step_ratio, parity, num_terms)] = fd_rules
  
          if self._flip_fd_rule:
              return -fd_rules[ix]
          return fd_rules[ix]
docs: Return finite differencing rule.
  
          The rule is for a nominal unit step size, and must be scaled later
          to reflect the local step size.
  
          Member methods used
          -------------------
          _fd_matrix
  
          Member variables used
          ---------------------
          n
          order
          method