code: def __init__(
      self,
      basedir: PathType,
      resource_dir: Optional[PathType] = None,
      source_dir: Optional[PathType] = None,
      template: Optional[PathType] = None,
      priority: int = DEFAULT_FILE_STORAGE_PRIORITY,
      copy_artifacts: bool = True,
      copy_sources: bool = True,
  ):
      basedir = Path(basedir)
      resource_dir = resource_dir or basedir / "_resources"
      source_dir = source_dir or basedir / "_sources"
      if template is not None:
          if not os.path.exists(template):
              raise FileNotFoundError(
                  "Couldn't find template file '{}'".format(template)
              )
      else:
          template = basedir / "template.html"
          if not template.exists():
              template = None
      self.initialize(
          basedir,
          resource_dir,
          source_dir,
          template,
          priority,
          copy_artifacts,
          copy_sources,
      )
  
imports: import json
  import os
  import os.path
  from pathlib import Path
  from typing import Optional
  import warnings
  from shutil import copyfile, SameFileError
  from sacred.commandline_options import cli_option
  from sacred.dependencies import get_digest
  from sacred.observers.base import RunObserver
  from sacred import optional
  from sacred.serializer import flatten
  from sacred.utils import PathType
label_desc: Use image node_id 2 to create a new FileStorageObserver object from inherited base classes: RunObserver with example: obj = FileStorageObserver(basedir, resource_dir, source_dir, template, priority, copy_artifacts, copy_sources)