"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 10:58:17.662317
"""

```python
class FallbackExecutor:
    """
    A class for creating a fallback execution mechanism that recovers from errors gracefully.

    Parameters:
        - primary_function (Callable): The main function to execute.
        - backup_functions (List[Callable]): List of backup functions to use if the primary function fails.
        - error_types (Tuple[type, ...], optional): Tuple of exception types for which the fallback will be triggered. Default is SystemExit and KeyboardInterrupt.

    Methods:
        - run: Executes the main function or a backup function in case of an error.
    """

    def __init__(self, primary_function: Callable[[Any], Any], backup_functions: List[Callable[[Any], Any]], error_types: Tuple[type, ...] = (SystemExit, KeyboardInterrupt)):
        self.primary_function = primary_function
        self.backup_functions = backup_functions
        self.error_types = error_types

    def run(self, *args, **kwargs) -> Any:
        """
        Executes the primary function with given arguments. If an error occurs, it executes one of the backup functions.

        Parameters:
            - args: Positional arguments to pass to the main and backup functions.
            - kwargs: Keyword arguments to pass to the main and backup functions.

        Returns:
            The result of the executed function or None if no backups are available.
        """
        try:
            return self.primary_function(*args, **kwargs)
        except self.error_types as e:
            for func in self.backup_functions:
                try:
                    return func(*args, **kwargs)
                except self.error_types:
                    continue
            return None

# Example usage
def main_function(x):
    if x == 1:
        raise ValueError("Invalid input")
    return x * 2

def backup_function_1(x):
    return x + 3

def backup_function_2(x):
    return x - 3

fallback_executor = FallbackExecutor(main_function, [backup_function_1, backup_function_2])

# Test cases
print(fallback_executor.run(2))  # Should print 4 (main function)
print(fallback_executor.run(1))  # Should print 0 (backup_function_2)

```