original_docstring: Convert a block of base64 data back to binary and return the binary data.
  
      :param str b64_data: Base64 data.
  
      
docstring: Convert a block of base64 data back to binary and return the binary data.
docstring_tokens: Convert a block of base64 data back to binary and return the binary data .
code: def a2b_base64(b64_data):
      """Convert a block of base64 data back to binary and return the binary data.
  
      :param str b64_data: Base64 data.
  
      """
      res = []
      quad_pos = 0
      leftchar = 0
      leftbits = 0
      last_char_was_a_pad = False
  
      for char in b64_data:
          char = chr(char)
          if char == "=":
              if quad_pos > 2 or (quad_pos == 2 and last_char_was_a_pad):
                  break  # stop on 'xxx=' or on 'xx=='
              last_char_was_a_pad = True
          else:
              n = ord(TABLE_A2B_B64[ord(char)])
              if n == 0xFF:
                  continue  # ignore strange characters
              #
              # Shift it in on the low end, and see if there's
              # a byte ready for output.
              quad_pos = (quad_pos + 1) & 3
              leftchar = (leftchar << 6) | n
              leftbits += 6
              #
              if leftbits >= 8:
                  leftbits -= 8
                  res.append((leftchar >> leftbits).to_bytes(1, "big"))
                  leftchar &= (1 << leftbits) - 1
              #
              last_char_was_a_pad = False
      else:
          if leftbits != 0:
              raise Exception("Incorrect padding")
  
      return b"".join(res)
code_tokens: def a2b_base64 ( b64_data ) : res = [ ] quad_pos = 0 leftchar = 0 leftbits = 0 last_char_was_a_pad = False for char in b64_data : char = chr ( char ) if char == "=" : if quad_pos > 2 or ( quad_pos == 2 and last_char_was_a_pad ) : break last_char_was_a_pad = True else : n = ord ( TABLE_A2B_B64 [ ord ( char ) ] ) if n == 0xFF : continue quad_pos = ( quad_pos + 1 ) & 3 leftchar = ( leftchar << 6 ) | n leftbits += 6 if leftbits >= 8 : leftbits -= 8 res . append ( ( leftchar >> leftbits ) . to_bytes ( 1 , "big" ) ) leftchar &= ( 1 << leftbits ) - 1 last_char_was_a_pad = False else : if leftbits != 0 : raise Exception ( "Incorrect padding" ) return b"" . join ( res )
short_docstring: Convert a block of base64 data back to binary and return the binary data.
short_docstring_tokens: Convert a block of base64 data back to binary and return the binary data .
comment: """Convert a block of base64 data back to binary and return the binary data.
  
      :param str b64_data: Base64 data.
  
      """$SEP$# stop on 'xxx=' or on 'xx=='$SEP$# ignore strange characters$SEP$#$SEP$# Shift it in on the low end, and see if there's$SEP$# a byte ready for output.$SEP$#$SEP$#