input: 
  from typing import Dict, List, Union
  
  
  class FileSystem:
      """
      A Python class that provides methods for saving, deleting, and finding task data.
      To use this class, import it and create an instance with a parameter dictionary that 
      includes a 'taskDir' key specifying the directory where task data should be stored. 
      Then call the methods on the instance as needed.
  
      Methods:
      - save_task(data: Dict[str, Union[str, int]]) -> None: 
          Saves task data. If the dictionary does not already include an 'id' key, one will 
          be generated and added to the dictionary. The task data will be stored in a file in 
          a subdirectory of the taskDir directory named after the task ID.
      - delete_task(task_id: int) -> None: 
          Deletes task data by removing the subdirectory containing the task data.
      - find_by_id(task_id: int) -> Dict[str, Union[str, int]]: 
          Finds task data by ID and returns the task data as a dictionary.
      - find_by_ids(task_ids: List[int]) -> List[Dict[str, Union[str, int]]]: 
          Finds task data for multiple IDs and returns a list of task data dictionaries.
      - all_task_data(order: str = 'asc') -> List[Dict[str, Union[str, int]]]: 
          Returns a list of all task data dictionaries, sorted by ID in ascending order 
          by default (or descending order if the 'order' parameter is set to 'desc').
      - task_data(task_id: int) -> Union[Dict[str, Union[str, int]], None]: 
          Gets task data for a specific ID without raising an error if the data is not found. 
          Returns the task data as a dictionary, or None if the task data is not found.
  
      Example:
      >>> fs = FileSystem({'taskDir': '~/tasks/'})
      >>> fs.save_task({'name': 'Task 1'})
      >>> fs.find_by_id(1)
      {'id': 1, 'name': 'Task 1'}
      >>> fs.delete_task(1)
      >>> fs.find_by_id(1)
      None
      """
  
output:     
      def __init__(self, params: Dict[str, str]):
          self.taskDir = params['taskDir']
          self.task_counter = 0
  
      def save_task(self, data: Dict[str, Union[str, int]]) -> None:
          if 'id' not in data:
              self.task_counter += 1
              data['id'] = self.task_counter
          task_id = data['id']
          task_dir = os.path.join(self.taskDir, str(task_id))
          os.makedirs(task_dir, exist_ok=True)
          with open(os.path.join(task_dir, 'data.json'), 'w') as f:
              json.dump(data, f)
  
      def delete_task(self, task_id: int) -> None:
          task_dir = os.path.join(self.taskDir, str(task_id))
          if os.path.exists(task_dir):
              shutil.rmtree(task_dir)
  
      def find_by_id(self, task_id: int) -> Dict[str, Union[str, int]]:
          task_dir = os.path.join(self.taskDir, str(task_id))
          data_file = os.path.join(task_dir, 'data.json')
          if os.path.exists(data_file):
              with open(data_file, 'r') as f:
                  return json.load(f)
          return None
  
      def find_by_ids(self, task_ids: List[int]) -> List[Dict[str, Union[str, int]]]:
          return [self.find_by_id(task_id) for task_id in task_ids if self.find_by_id(task_id) is not None]
  
      def all_task_data(self, order: str = 'asc') -> List[Dict[str, Union[str, int]]]:
          all_data = []
          for task_id in sorted(os.listdir(self.taskDir), reverse=(order == 'desc')):
              task_data = self.find_by_id(int(task_id))
              if task_data:
                  all_data.append(task_data)
          return all_data
  
      def task_data(self, task_id: int) -> Union[Dict[str, Union[str, int]], None]:
          return self.find_by_id(task_id)
  