code: def test_encode(self):
      eq = self.assertEqual
      from io import BytesIO, StringIO
  
      infp = BytesIO(
          b"abcdefghijklmnopqrstuvwxyz"
          b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
          b"0123456789!@#0^&*();:<>,. []{}"
      )
      outfp = BytesIO()
      base64.encode(infp, outfp)
      eq(
          outfp.getvalue(),
          b"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE"
          b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT"
          b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n",
      )
      # Non-binary files
      self.assertRaises(
          TypeError, base64.encode, StringIO("abc"), BytesIO()
      )
      self.assertRaises(
          TypeError, base64.encode, BytesIO(b"abc"), StringIO()
      )
      self.assertRaises(
          TypeError, base64.encode, StringIO("abc"), StringIO()
      )
  
imports: import unittest
  import base64
  import binascii
  import os
  from array import array
  from test.support import os_helper
  from test.support import script_helper
label_desc: Use image node_id 4 for calling the LegacyBase64TestCase obj's underlying member method code with example usage: obj.test_encode() without return types