input: from typing import List, Dict, Union, Optional
  
  class FileSystem:
      """
      The FileSystem class provides methods for saving, deleting, and finding task data in a specified directory.
  
      - 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.
  
      Example:
      >>> fs = FileSystem({'taskDir': '~/tasks/'})
      >>> fs.save_task({'name': 'Task1', 'description': 'First task'})
      >>> fs.all_task_data()
      [{'id': 1, 'name': 'Task1', 'description': 'First task'}]
      >>> fs.find_by_id(1)
      {'id': 1, 'name': 'Task1', 'description': 'First task'}
      >>> fs.delete_task(1)
      >>> fs.all_task_data()
      []
      """
  
      def __init__(self, param: Dict[str, str]) -> None:
          self.__jsub_dir = os.path.expanduser(param.get('taskDir', '~/jsub/'))
          self.__json_format = param.get('format', 'compact')
  
      def save_task(self, data: Dict[str, Union[str, int, float]]) -> None:
          if 'id' not in data:
              data['id'] = self.__new_task_id()
          safe_mkdir(os.path.join(self.__jsub_dir, str(data['id']), 'taskInfo'))
          task_path = os.path.join(self.__jsub_dir, str(data['id']), 'taskInfo', 'repo')
          data_str = self.__json_str(data)
          with open(task_path, 'a+') as f:
              fcntl.flock(f, fcntl.LOCK_EX)
              f.seek(0)
              f.truncate()
              f.write(data_str)
  
      def delete_task(self, task_id: int) -> None:
          safe_rmdir(os.path.join(self.__jsub_dir, str(task_id)))
  
      def find_by_id(self, task_id: int) -> Optional[Dict[str, Union[str, int, float]]]:
          return self.task_data(task_id)
  
      def find_by_ids(self, task_ids: List[int]) -> List[Dict[str, Union[str, int, float]]]:
          all_data = []
          for task_id in task_ids:
              try:
                  td = self.task_data(task_id)
                  all_data.append(td)
              except RepoReadError as e:
                  self.__logger.debug(e)
          return all_data
  
      def all_task_data(self, order: str = 'asc') -> List[Dict[str, Union[str, int, float]]]:
          task_ids = [d for d in os.listdir(self.__jsub_dir) if os.path.isdir(os.path.join(self.__jsub_dir, d))]
          task_ids.sort(key=int, reverse=(order == 'desc'))
          return self.find_by_ids(task_ids)
  
      def task_data(self, task_id: int) -> Optional[Dict[str, Union[str, int, float]]]:
          safe_mkdir(os.path.join(self.__jsub_dir, str(task_id), 'taskInfo'))
          task_path = os.path.join(self.__jsub_dir, str(task_id), 'taskInfo', 'repo')
          with open(task_path, 'a+') as f:
              fcntl.flock(f, fcntl.LOCK_EX)
              f.seek(0)
              data_str = f.read()
          try:
              return json.loads(data_str)
          except ValueError as e:
              raise RepoReadError('JSON decode error on task %s: %s' % (task_id, e))
  
      def __new_task_id(self) -> int:
          task_ids = [int(d) for d in os.listdir(self.__jsub_dir) if os.path.isdir(os.path.join(self.__jsub_dir, d))]
          if not task_ids:
              return 1
          task_ids.sort(key=int, reverse=True)
          return (task_ids[0] + 1)
  
      def __json_str(self, data: Dict[str, Union[str, int, float]]) -> str:
          if self.__json_format == 'pretty':
              return json.dumps(data, indent=2)
          return json.dumps(data, separators=(',', ':'))
output:     
      def __init__(self, param: Dict[str, str]) -> None:
          self.__jsub_dir = os.path.expanduser(param.get('taskDir', '~/jsub/'))
          self.__json_format = param.get('format', 'compact')
          self.__logger = logging.getLogger('FileSystem')
          self.__logger.setLevel(logging.DEBUG)
          ch = logging.StreamHandler()
          ch.setLevel(logging.DEBUG)
          formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
          ch.setFormatter(formatter)
          self.__logger.addHandler(ch)
  
      def __new_task_id(self) -> int:
          task_ids = [int(d) for d in os.listdir(self.__jsub_dir) if os.path.isdir(os.path.join(self.__jsub_dir, d))]
          if not task_ids:
              return 1
          task_ids.sort(key=int, reverse=True)
          return (task_ids[0] + 1)
  
      def __json_str(self, data: Dict[str, Union[str, int, float]]) -> str:
          if self.__json_format == 'pretty':
              return json.dumps(data, indent=2)
          return json.dumps(data, separators=(',', ':'))
  