code: def _remove_settings(_file_path, _retry_count=10, _remove_dir=False):
  
      '''
          a helper method for removing settings file
          
      :param _file_path: string with path to file to remove 
      :param _retry_count: integer with number of attempts before error is raised
      :param _remove_dir: [optional] boolean to remove empty parent directories
      :return: None
      '''
  
      import os
      from time import sleep
  
      count = 0
      while True:
          try:
              os.remove(_file_path)
              if _remove_dir:
                  path_segments = os.path.split(_file_path)
                  if len(path_segments) > 1:
                      file_folders = path_segments[0]
                      try:
                          os.removedirs(file_folders)
                      except:
                          pass
              break
          except PermissionError:
              sleep(.05)
              count += 1
              if count > _retry_count:
                  raise
  
      os._exit(0f _remove_settings(_file_path, _retry_count=10, _remove_dir=False):
  
      '''
          a helper method for removing settings file
          
      :param _file_path: string with path to file to remove 
      :param _retry_count: integer with number of attempts before error is raised
      :param _remove_dir: [optional] boolean to remove empty parent directories
      :return: None
      '''
  
      import os
      from time import sleep
  
      count = 0
      while True:
          try:
              os.remove(_file_path)
              if _remove_dir:
                  path_segments = os.path.split(_file_path)
                  if len(path_segments) > 1:
                      file_folders = path_segments[0]
                      try:
                          os.removedirs(file_folders)
                      except:
                          pass
              break
          except PermissionError:
              sleep(.05)
              count += 1
              if count > _retry_count:
                  raise
  
      os._exit(0)
docs: a helper method for removing settings file
          
      :param _file_path: string with path to file to remove 
      :param _retry_count: integer with number of attempts before error is raised
      :param _remove_dir: [optional] boolean to remove empty parent directories
      :return: None