parameters: (buf, _opcode=_CONTROLS.NORMAL)
return_statement: return frame
docstring: Make a frame.
  
      This function always creates unmasked frames, and attempts to use the
      smallest possible lengths.
  
      @type buf: C{str}
      @param buf: A buffer of bytes.
  
      @type _opcode: C{_CONTROLS}
      @param _opcode: Which type of frame to create.
  
      @rtype: C{str}
      @return: A packed frame.
docstring_summary: Make a frame.
docstring_tokens: Make a frame .
function: def _makeFrame(buf, _opcode=_CONTROLS.NORMAL):
      """
      Make a frame.
  
      This function always creates unmasked frames, and attempts to use the
      smallest possible lengths.
  
      @type buf: C{str}
      @param buf: A buffer of bytes.
  
      @type _opcode: C{_CONTROLS}
      @param _opcode: Which type of frame to create.
  
      @rtype: C{str}
      @return: A packed frame.
      """
      bufferLength = len(buf)
  
      if bufferLength > 0xffff:
          length = "\x7f%s" % pack(">Q", bufferLength)
      elif bufferLength > 0x7d:
          length = "\x7e%s" % pack(">H", bufferLength)
      else:
          length = chr(bufferLength)
  
      # Always make a normal packet.
      header = chr(0x80 | _opcodeForType[_opcode])
      frame = "%s%s%s" % (header, length, buf)
      return frame
function_tokens: def _makeFrame ( buf , _opcode = _CONTROLS . NORMAL ) : bufferLength = len ( buf ) if bufferLength > 0xffff : length = "\x7f%s" % pack ( ">Q" , bufferLength ) elif bufferLength > 0x7d : length = "\x7e%s" % pack ( ">H" , bufferLength ) else : length = chr ( bufferLength ) # Always make a normal packet. header = chr ( 0x80 | _opcodeForType [ _opcode ] ) frame = "%s%s%s" % ( header , length , buf ) return frame