def METHOD_NAME(self, nb, resources=None):
    nb = deepcopy(nb)
    for cell in nb.cells:
        # Make sure every cell has a slide_type
        try:
            slide_type = cell.metadata.get("slideshow", {}).get("slide_type", "-")
        except AttributeError:
            slide_type = "-"
        cell.metadata.slide_type = slide_type
    # Find the first visible cell
    for index, cell in enumerate(nb.cells):
        if cell.metadata.slide_type not in {"notes", "skip"}:
            cell.metadata.slide_type = "slide"
            cell.metadata.slide_start = True
            cell.metadata.subslide_start = True
            first_slide_ix = index
            break
    else:
        msg = "All cells are hidden, cannot create slideshow"
        raise ValueError(msg)
    in_fragment = False
    for index, cell in enumerate(nb.cells[first_slide_ix + 1 :], start=(first_slide_ix + 1)):
        previous_cell = nb.cells[index - 1]
        # Slides are <section> elements in the HTML, subslides (the vertically
        # stacked slides) are also <section> elements inside the slides,
        # and fragments are <div>s within subslides. Subslide and fragment
        # elements can contain content:
        # <section>
        #   <section>
        #     (content)
        #     <div class="fragment">(content)</div>
        #   </section>
        # </section>
        # Get the slide type. If type is subslide or slide,
        # end the last slide/subslide/fragment as applicable.
        if cell.metadata.slide_type == "slide":
            previous_cell.metadata.slide_end = True
            cell.metadata.slide_start = True
        if cell.metadata.slide_type in {"subslide", "slide"}:
            previous_cell.metadata.fragment_end = in_fragment
            previous_cell.metadata.subslide_end = True
            cell.metadata.subslide_start = True
            in_fragment = False
        elif cell.metadata.slide_type == "fragment":
            cell.metadata.fragment_start = True
            if in_fragment:
                previous_cell.metadata.fragment_end = True
            else:
                in_fragment = True
    # The last cell will always be the end of a slide
    nb.cells[-1].metadata.fragment_end = in_fragment
    nb.cells[-1].metadata.subslide_end = True
    nb.cells[-1].metadata.slide_end = True
    return nb, resources