code: def load(filename: str, format: str = None):
      
  
      path = Path(filename).resolve()
  
      with path.open() as file:
          data = file.read()
  
      if format is None:
          loader, error_class = _load_autodetect, InvalidMofileFormat
      else:
          try:
              loader, error_class = formats[format]
          except KeyError:
              raise InvalidMofileFormat(f'Unknown file format: {format}')
  
      try:
          config = loader(data)
      except error_class as e:
          raise InvalidMofileFormat(f'Unable to load task file: {e}')
  
      return Project(config, path.parent)
docs: Load a task file and get a ``Project`` back.