'Builds a single valid headers frame out of the contained headers.'

def buildHeadersFrame(self, headers, flags=[], streamID=1, **priorityKwargs):

    f = hyperframe.frame.HeadersFrame(streamID)
    f.data = self.encoder.encode(headers)
    f.flags.add('END_HEADERS')
    for flag in flags:
        f.flags.add(flag)
    for (k, v) in priorityKwargs.items():
        setattr(f, k, v)
    return f
