<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_next_filename(filename):
 """ Parses a "next" filename into its equivalent blurb metadata. Returns a dict. """

        components = filename.split(os.sep)
        section, filename = components[-2:]
        section = unsanitize_section(section)
        assert section in sections, f("Unknown section {section}")

        fields = [x.strip() for x in filename.split(".")]
        assert len(fields) >= 4, f("Can't parse 'next' filename! filename {filename!r} fields {fields}")
        assert fields[-1] == "rst"

        metadata = {"date": fields[0], "nonce": fields[-2], "section": section}

        for field in fields[1:-2]:
            for name in ("bpo",):
                _, got, value = field.partition(name + "-")
                if got:
                    metadata[name] = value.strip()
                    break
            else:
                assert False, "Found unparsable field in 'next' filename: " + repr(field)

        return metadata