@classmethod
def _build_request_type(cls, is_in, req_type, recipient):
    """ Builds the request type field for a USB request.

        is_in -- True iff this is a DEVICE-to-HOST request.
        req_type -- The type of request to be used.
        recipient -- The context in which this request should be interprted.

        returns -- a request_type byte
        """
    request_type = 0
    if is_in:
        request_type |= cls.ENDPOINT_DIRECTION_IN
    request_type |= req_type << 5
    request_type |= recipient
    return request_type
