"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 20:32:49.108065
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class for handling function execution with a fallback mechanism.
    
    This class is designed to attempt executing a given function and handle any potential errors by
    executing a fallback function instead. It provides a way to gracefully recover from exceptions
    that may occur during the execution of the main function.
    """

    def __init__(self, main_func: Callable[[], Any], fallback_func: Callable[[], Any]):
        """
        Initialize the FallbackExecutor with the main and fallback functions.

        :param main_func: The main function to attempt executing.
        :param fallback_func: The fallback function to execute if an error occurs in the main function.
        """
        self.main_func = main_func
        self.fallback_func = fallback_func

    def run(self) -> Any:
        """
        Run the main function and handle any exceptions by attempting the fallback function.

        :return: The result of the successfully executed function, either the main or the fallback.
        """
        try:
            return self.main_func()
        except Exception as e:
            print(f"Error occurred in main function: {e}")
            return self.fallback_func()


# Example usage
def divide_numbers(num1: int, num2: int) -> float:
    """Function to safely divide two numbers."""
    return num1 / num2

def safe_divide_fallback() -> str:
    """Fallback function that returns a message when division by zero occurs."""
    return "Safe mode activated. Returning 0."

# Create an instance of FallbackExecutor with the main and fallback functions
executor = FallbackExecutor(
    main_func=lambda: divide_numbers(10, 2),
    fallback_func=safe_divide_fallback,
)

# Run the executor to demonstrate functionality
result = executor.run()
print(result)  # Expected output: 5.0

# Introduce a scenario that will trigger the fallback function
result = executor.run()
print(result)  # Expected output: "Safe mode activated. Returning 0."
```