docs: def make_text_chunk(
  		type="tEXt", key="Comment", value="",
  		compression_flag=0, compression_method=0, lang="", translated_key=""):
  	"""Create a text chunk with a key value pair.
  	See https://www.w3.org/TR/PNG/#11textinfo for text chunk information.
  
  	Usage:
  	
  	.. code:: python
  
  		from apng import APNG, make_text_chunk
  
  		im = APNG.open("file.png")
  		png, control = im.frames[0]
  		png.chunks.append(make_text_chunk("tEXt", "Comment", "some text"))
  		im.save("file.png")
  
  	:arg str type: Text chunk type: "tEXt", "zTXt", or "iTXt":
  
  		tEXt uses Latin-1 characters.
  		zTXt uses Latin-1 characters, compressed with zlib.
  		iTXt uses UTF-8 characters.
  
  	:arg str key: The key string, 1-79 characters.
  	
  	:arg str value: The text value. It would be encoded into
  		:class:`bytes` and compressed if needed.
  		
  	:arg int compression_flag: The compression flag for iTXt.
  	:arg int compression_method: The compression method for zTXt and iTXt.
  	:arg str lang: The language tag for iTXt.
  	:arg str translated_key: The translated keyword for iTXt.
  	:rtype: Chunk
  	"""
  	# pylint: disable=redefined-builtin
  	if type == "tEXt":
  		data = key.encode("latin-1") + b"\0" + value.encode("latin-1")
  	elif type == "zTXt":
  		data = (
  			key.encode("latin-1") + struct.pack("!xb", compression_method) +
  			zlib.compress(value.encode("latin-1"))
  		)
  	elif type == "iTXt":
  		data = (
  			key.encode("latin-1") +
  			struct.pack("!xbb", compression_flag, compression_method) +
  			lang.encode("latin-1") + b"\0" +
  			translated_key.encode("utf-8") + b"\0"
  		)
  		if compression_flag:
  			data += zlib.compress(value.encode("utf-8"))
  		else:
  			data += value.encode("utf-8")
  	else:
  		raise TypeError("unknown type {!r}".format(type))
  	return Chunk(type, make_chunk(type, data))