code: def uu_encode(input, errors="strict", filename="<data>", mode=0o666):
      assert errors == "strict"
      infile = BytesIO(input)
      outfile = BytesIO()
      read = infile.read
      write = outfile.write
  
      # Remove newline chars from filename
      filename = filename.replace("\n", "\\n")
      filename = filename.replace("\r", "\\r")
  
      # Encode
      write(
          ("begin %o %s\n" % (mode & 0o777, filename)).encode("ascii")
      )
      chunk = read(45)
      while chunk:
          write(binascii.b2a_uu(chunk))
          chunk = read(45)
      write(b" \nend\n")
  
      return (outfile.getvalue(), len(input))
  
imports: import codecs
  import binascii
  from io import BytesIO
label_desc: Use image node_id 1 for calling a global function with example usage: uu_encode(input, errors, filename, mode) and returns: outfile,  len