"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-06 10:07:58.974610
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class that provides a mechanism for executing functions with fallbacks in case of errors.
    """

    def __init__(self, primary_function: Callable[..., Any], fallback_function: Callable[..., Any]):
        """
        Initialize the FallbackExecutor with a primary function and its corresponding fallback.

        :param primary_function: The main function to execute.
        :param fallback_function: The backup function to execute in case of errors in the primary function.
        """
        self.primary_function = primary_function
        self.fallback_function = fallback_function

    def run(self, *args, **kwargs) -> Any:
        """
        Execute the primary function with provided arguments. If an error occurs, revert to the fallback.

        :param args: Positional arguments passed to the primary and fallback functions.
        :param kwargs: Keyword arguments passed to the primary and fallback functions.
        :return: The result of the executed function or its fallback if an error occurred.
        """
        try:
            return self.primary_function(*args, **kwargs)
        except Exception as e:
            print(f"Error in primary function: {e}")
            return self.fallback_function(*args, **kwargs)


# Example usage
def divide(a: float, b: float) -> float:
    return a / b


def safe_divide(a: float, b: float) -> float:
    if b == 0:
        return 0.0
    return a / b


executor = FallbackExecutor(primary_function=divide, fallback_function=safe_divide)

result = executor.run(10, 2)
print(result)  # Output should be 5.0

result = executor.run(10, 0)
print(result)  # Output should be 0.0
```