def METHOD_NAME(self, headers, flags=[], stream_id=1, **priority_kwargs):
    """
    Builds a single valid headers frame out of the contained headers.
    """
    f = HeadersFrame(stream_id)
    f.data = self.encoder.encode(headers)
    f.flags.add("END_HEADERS")
    for flag in flags:
        f.flags.add(flag)
    for k, v in priority_kwargs.items():
        setattr(f, k, v)
    return f