code: def write_file(file, b):
  	
  	if hasattr(file, "write_bytes"):
  		file.write_bytes(b)
  	elif hasattr(file, "write"):
  		file.write(b)
  	else:
  		with open(file, "wb") as f:
  			f.write(b)
docs: Write ``b`` to file ``file``.
  	
  	:arg file type: path-like or file-like object.
  	:arg bytes b: The content.