code: def test_b64encode(self):
      eq = self.assertEqual
      # Test default alphabet
      eq(base64.b64encode(b"www.python.org"), b"d3d3LnB5dGhvbi5vcmc=")
      eq(base64.b64encode(b"\x00"), b"AA==")
      eq(base64.b64encode(b"a"), b"YQ==")
      eq(base64.b64encode(b"ab"), b"YWI=")
      eq(base64.b64encode(b"abc"), b"YWJj")
      eq(base64.b64encode(b""), b"")
      eq(
          base64.b64encode(
              b"abcdefghijklmnopqrstuvwxyz"
              b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
              b"0123456789!@#0^&*();:<>,. []{}"
          ),
          b"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE"
          b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT"
          b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==",
      )
      # Test with arbitrary alternative characters
      eq(
          base64.b64encode(b"\xd3V\xbeo\xf7\x1d", altchars=b"*$"),
          b"01a*b$cd",
      )
      eq(
          base64.b64encode(
              b"\xd3V\xbeo\xf7\x1d", altchars=bytearray(b"*$")
          ),
          b"01a*b$cd",
      )
      eq(
          base64.b64encode(
              b"\xd3V\xbeo\xf7\x1d", altchars=memoryview(b"*$")
          ),
          b"01a*b$cd",
      )
      eq(
          base64.b64encode(
              b"\xd3V\xbeo\xf7\x1d", altchars=array("B", b"*$")
          ),
          b"01a*b$cd",
      )
      # Non-bytes
      self.check_other_types(base64.b64encode, b"abcd", b"YWJjZA==")
      self.check_encode_type_errors(base64.b64encode)
      self.assertRaises(TypeError, base64.b64encode, b"", altchars="*$")
      # Test standard alphabet
      eq(
          base64.standard_b64encode(b"www.python.org"),
          b"d3d3LnB5dGhvbi5vcmc=",
      )
      eq(base64.standard_b64encode(b"a"), b"YQ==")
      eq(base64.standard_b64encode(b"ab"), b"YWI=")
      eq(base64.standard_b64encode(b"abc"), b"YWJj")
      eq(base64.standard_b64encode(b""), b"")
      eq(
          base64.standard_b64encode(
              b"abcdefghijklmnopqrstuvwxyz"
              b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
              b"0123456789!@#0^&*();:<>,. []{}"
          ),
          b"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE"
          b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT"
          b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==",
      )
      # Non-bytes
      self.check_other_types(
          base64.standard_b64encode, b"abcd", b"YWJjZA=="
      )
      self.check_encode_type_errors(base64.standard_b64encode)
      # Test with 'URL safe' alternative characters
      eq(base64.urlsafe_b64encode(b"\xd3V\xbeo\xf7\x1d"), b"01a-b_cd")
      # Non-bytes
      self.check_other_types(
          base64.urlsafe_b64encode, b"\xd3V\xbeo\xf7\x1d", b"01a-b_cd"
      )
      self.check_encode_type_errors(base64.urlsafe_b64encode)
  
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 6 for calling the BaseXYTestCase obj's underlying member method code with example usage: obj.test_b64encode() without return types