def METHOD_NAME(filestream: TextIO) -> Optional[str]:
    """Get the effective base from a snapcraft.yaml file.
    :param filename: The YAML file to load.
    :returns: Effective base of the project or None if the base cannot be determined.
    :raises SnapcraftError: If the yaml could not be loaded.
    """
    try:
        data = yaml.safe_load(filestream)
        return utils.get_effective_base(
            base=data.get("base"),
            build_base=data.get("build-base"),
            project_type=data.get("type"),
            name=data.get("name"),
        )
    except yaml.error.YAMLError as err:
        raise errors.SnapcraftError(f"snapcraft.yaml parsing error: {err!s}") from err