parameters: (x, renderer=None)
docstring: returns the molecules as base64 encoded PNG image
docstring_summary: returns the molecules as base64 encoded PNG image
docstring_tokens: returns the molecules as base64 encoded PNG image
function: def PrintAsBase64PNGString(x, renderer=None):
    '''returns the molecules as base64 encoded PNG image
      '''
    if highlightSubstructures and hasattr(x, '__sssAtoms'):
      highlightAtoms = x.__sssAtoms
    else:
      highlightAtoms = []
    # TODO: should we generate coordinates if no coordinates available?
    # from rdkit.Chem import rdDepictor
    # try:
    #     # If no coordinates, calculate 2D
    #     x.GetConformer(-1)
    # except ValueError:
    #     rdDepictor.Compute2DCoords(x)
    if molRepresentation.lower() == 'svg':
      svg = Draw._moltoSVG(x, molSize, highlightAtoms, "", True)
      svg = minidom.parseString(svg)
      svg = svg.getElementsByTagName('svg')[0]
      svg.attributes['viewbox'] = f'0 0 {molSize[0]} {molSize[1]}'
      svg.attributes['style'] = f'max-width: {molSize[0]}px; height: {molSize[1]}px;'
      svg.attributes['data-content'] = 'rdkit/molecule'
      return svg.toxml()
    else:
      data = Draw._moltoimg(x, molSize, highlightAtoms, "", returnPNG=True, kekulize=True)
      return '<img data-content="rdkit/molecule" src="data:image/png;base64,%s" alt="Mol"/>' % _get_image(
        data)
function_tokens: def PrintAsBase64PNGString ( x , renderer = None ) : if highlightSubstructures and hasattr ( x , '__sssAtoms' ) : highlightAtoms = x . __sssAtoms else : highlightAtoms = [ ] # TODO: should we generate coordinates if no coordinates available? # from rdkit.Chem import rdDepictor # try: #     # If no coordinates, calculate 2D #     x.GetConformer(-1) # except ValueError: #     rdDepictor.Compute2DCoords(x) if molRepresentation . lower ( ) == 'svg' : svg = Draw . _moltoSVG ( x , molSize , highlightAtoms , "" , True ) svg = minidom . parseString ( svg ) svg = svg . getElementsByTagName ( 'svg' ) [ 0 ] svg . attributes [ 'viewbox' ] = f'0 0 {molSize[0]} {molSize[1]}' svg . attributes [ 'style' ] = f'max-width: {molSize[0]}px; height: {molSize[1]}px;' svg . attributes [ 'data-content' ] = 'rdkit/molecule' return svg . toxml ( ) else : data = Draw . _moltoimg ( x , molSize , highlightAtoms , "" , returnPNG = True , kekulize = True ) return '<img data-content="rdkit/molecule" src="data:image/png;base64,%s" alt="Mol"/>' % _get_image ( data )