input: 
  class FileSystem:
      """
      A Python class that provides methods for saving, deleting, and finding task data in a file system.
      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:
  
      - To save task data, call the save_task method with a dictionary containing the 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.
      - To delete task data, call the delete_task method with the ID of the task to delete. This will remove the
        subdirectory containing the task data.
      - To find task data by ID, call the find_by_id method with the ID of the task to find. This will return the task
        data as a dictionary.
      - To find task data for multiple IDs, call the find_by_ids method with a list of IDs. This will return a list of
        task data dictionaries.
      - To find all task data, call the all_task_data method. This will return 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').
      - To get task data for a specific ID without raising an error if the data is not found, call the task_data method
        with the ID of the task to find. This will return the task data as a dictionary, or None if the task data is not
        found.
  
      >>> fs = FileSystem({'taskDir': '~/tasks/'})
      >>> fs.save_task({'name': 'Task1', 'description': 'First task'})
      >>> fs.save_task({'id': 2, 'name': 'Task2', 'description': 'Second task'})
      >>> fs.find_by_id(1) == {'id': 1, 'name': 'Task1', 'description': 'First task'}
      True
      >>> fs.find_by_ids([1, 2]) == [
      ...     {'id': 1, 'name': 'Task1', 'description': 'First task'},
      ...     {'id': 2, 'name': 'Task2', 'description': 'Second task'}
      ... ]
      True
      >>> fs.all_task_data() == [
      ...     {'id': 1, 'name': 'Task1', 'description': 'First task'},
      ...     {'id': 2, 'name': 'Task2', 'description': 'Second task'}
      ... ]
      True
      >>> fs.delete_task(1)
      >>> fs.find_by_id(1) is None
      True
      >>> fs.task_data(1) is None
      True
      """
  
output:     
      def __init__(self, params: dict):
          self.task_dir = params['taskDir']
          if not os.path.exists(self.task_dir):
              os.makedirs(self.task_dir)
  
      def save_task(self, task_data: dict):
          if 'id' not in task_data:
              task_data['id'] = self._generate_id()
          task_id = task_data['id']
          task_path = os.path.join(self.task_dir, str(task_id))
          if not os.path.exists(task_path):
              os.makedirs(task_path)
          with open(os.path.join(task_path, 'task.json'), 'w') as f:
              json.dump(task_data, f)
  
      def delete_task(self, task_id: int):
          task_path = os.path.join(self.task_dir, str(task_id))
          if os.path.exists(task_path):
              shutil.rmtree(task_path)
  
      def find_by_id(self, task_id: int) -> dict:
          task_path = os.path.join(self.task_dir, str(task_id), 'task.json')
          if os.path.exists(task_path):
              with open(task_path, 'r') as f:
                  return json.load(f)
          return None
  
      def find_by_ids(self, task_ids: List[int]) -> List[dict]:
          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]:
          task_ids = [int(d) for d in os.listdir(self.task_dir) if os.path.isdir(os.path.join(self.task_dir, d))]
          task_ids.sort(reverse=(order == 'desc'))
          return [self.find_by_id(task_id) for task_id in task_ids]
  
      def task_data(self, task_id: int) -> dict:
          return self.find_by_id(task_id)
  
      def _generate_id(self) -> int:
          task_ids = [int(d) for d in os.listdir(self.task_dir) if os.path.isdir(os.path.join(self.task_dir, d))]
          return max(task_ids, default=0) + 1
  