original_docstring: Convert binary data to a line of ASCII characters in base64 coding.
  
      :param str bin_data: Binary data string, as bytes
  
      
docstring: Convert binary data to a line of ASCII characters in base64 coding.
docstring_tokens: Convert binary data to a line of ASCII characters in base64 coding .
code: def b2a_base64(bin_data):
      """Convert binary data to a line of ASCII characters in base64 coding.
  
      :param str bin_data: Binary data string, as bytes
  
      """
      newlength = (len(bin_data) + 2) // 3
      newlength = newlength * 4 + 1
      res = []
  
      leftchar = 0
      leftbits = 0
      for char in bin_data:
          # Shift into our buffer, and output any 6bits ready
          leftchar = (leftchar << 8) | char
          leftbits += 8
          res.append(TABLE_B2A_B64[(leftchar >> (leftbits - 6)) & 0x3F])
          leftbits -= 6
          if leftbits >= 6:
              res.append(TABLE_B2A_B64[(leftchar >> (leftbits - 6)) & 0x3F])
              leftbits -= 6
      #
      if leftbits == 2:
          res.append(TABLE_B2A_B64[(leftchar & 3) << 4])
          res.append("=")
          res.append("=")
      elif leftbits == 4:
          res.append(TABLE_B2A_B64[(leftchar & 0xF) << 2])
          res.append("=")
      res.append("\n")
      return bytes("".join(res), "ascii")
code_tokens: def b2a_base64 ( bin_data ) : newlength = ( len ( bin_data ) + 2 ) // 3 newlength = newlength * 4 + 1 res = [ ] leftchar = 0 leftbits = 0 for char in bin_data : leftchar = ( leftchar << 8 ) | char leftbits += 8 res . append ( TABLE_B2A_B64 [ ( leftchar >> ( leftbits - 6 ) ) & 0x3F ] ) leftbits -= 6 if leftbits >= 6 : res . append ( TABLE_B2A_B64 [ ( leftchar >> ( leftbits - 6 ) ) & 0x3F ] ) leftbits -= 6 if leftbits == 2 : res . append ( TABLE_B2A_B64 [ ( leftchar & 3 ) << 4 ] ) res . append ( "=" ) res . append ( "=" ) elif leftbits == 4 : res . append ( TABLE_B2A_B64 [ ( leftchar & 0xF ) << 2 ] ) res . append ( "=" ) res . append ( "\n" ) return bytes ( "" . join ( res ) , "ascii" )
short_docstring: Convert binary data to a line of ASCII characters in base64 coding.
short_docstring_tokens: Convert binary data to a line of ASCII characters in base64 coding .
comment: """Convert binary data to a line of ASCII characters in base64 coding.
  
      :param str bin_data: Binary data string, as bytes
  
      """$SEP$# Shift into our buffer, and output any 6bits ready$SEP$#