def METHOD_NAME(cls, subs, fp, format_, fps=None, **kwargs):
    """See :meth:`pysubs2.formats.FormatBase.from_file()`"""
    for line in fp:
        match = MICRODVD_LINE.match(line)
        if not match:
            continue
        fstart, fend, text = match.groups()
        fstart, fend = map(int, (fstart, fend))
        if fps is None:
            # We don't know the framerate, but it is customary to include
            # it as text of the first subtitle. In that case, we skip
            # this auxiliary subtitle and proceed with reading.
            try:
                fps = float(text)
                subs.fps = fps
                continue
            except ValueError:
                raise UnknownFPSError("Framerate was not specified and "
                                      "cannot be read from "
                                      "the MicroDVD file.")
        start, end = map(partial(frames_to_ms, fps=fps), (fstart, fend))
        def prepare_text(text):
            text = text.replace("|", r"\N")
            def style_replacer(match):
                tags = [c for c in "biu" if c in match.group(0)]
                return "{%s}" % "".join(r"\%s1" % c for c in tags)
            text = re.sub(r"\{[Yy]:[^}]+\}", style_replacer, text)
            text = re.sub(r"\{[Ff]:([^}]+)\}", r"{\\fn\1}", text)
            text = re.sub(r"\{[Ss]:([^}]+)\}", r"{\\fs\1}", text)
            text = re.sub(r"\{P:(\d+),(\d+)\}", r"{\\pos(\1,\2)}", text)
            return text.strip()
        ev = SSAEvent(start=start, end=end, text=prepare_text(text))
        subs.append(ev)