docs: def create_dirs(fname, is_file=False):
      """Create (output) directories if they don't exist
  
      Removes the file name part if is_file is set to True.
      """
      fname = os.path.abspath(fname)
      if is_file:
          fname = os.path.dirname(fname)
  
      if not os.path.exists(fname):
          os.makedirs(fname)