"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 03:34:37.996488
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class that provides a fallback mechanism for executing functions.
    
    This class allows you to define primary and backup functions to be executed in case of failure or specific conditions.

    Args:
        primary_function (Callable): The main function to attempt execution.
        backup_function (Callable, optional): The function to execute if the primary function fails. Defaults to None.
    """

    def __init__(self, primary_function: Callable[..., Any], backup_function: Callable[..., Any] = None):
        self.primary_function = primary_function
        self.backup_function = backup_function

    def _execute(self, func: Callable, *args, **kwargs) -> Any:
        """Execute the given function with provided arguments and return its result."""
        try:
            result = func(*args, **kwargs)
            if not isinstance(result, Exception):
                return result
        except Exception as e:
            pass

    def run(self, *args, **kwargs) -> Any:
        """
        Execute the primary function or fall back to the backup function.
        
        Returns:
            The result of the successful execution or None if both fail.
        """
        result = self._execute(self.primary_function, *args, **kwargs)
        if not isinstance(result, Exception):
            return result
        elif self.backup_function is not None:
            return self._execute(self.backup_function, *args, **kwargs)
        else:
            return None


# Example usage

def primary_function(x: int) -> str:
    """Primary function that raises an error on odd numbers."""
    if x % 2 != 0:
        raise ValueError("Odd number received")
    return f"Processed {x}"

def backup_function(x: int) -> str:
    """Backup function that processes even numbers and returns a different message."""
    return f"Even number processed with fallback: {x}"


fallback_executor = FallbackExecutor(primary_function, backup_function)
result = fallback_executor.run(5)  # Should use the backup function
print(result)

result = fallback_executor.run(4)  # Should use the primary function and succeed
print(result)
```