(self, mask=False)
return Frame(body=self.data, opcode=self.opcode,
                     masking_key=mask, fin=1).build()
Returns a frame bytes with the fin bit set and a random mask.

        If ``mask`` is set, automatically mask the frame
        using a generated 4-byte token.
Returns a frame bytes with the fin bit set and a random mask.
Returns a frame bytes with the fin bit set and a random mask .
def single(self, mask=False):
        """
        Returns a frame bytes with the fin bit set and a random mask.

        If ``mask`` is set, automatically mask the frame
        using a generated 4-byte token.
        """
        mask = os.urandom(4) if mask else None
        return Frame(body=self.data, opcode=self.opcode,
                     masking_key=mask, fin=1).build()
def single ( self , mask = False ) : mask = os . urandom ( 4 ) if mask else None return Frame ( body = self . data , opcode = self . opcode , masking_key = mask , fin = 1 ) . build ( )