code: def generate_pydenticon(identifier, size):
      '''
      Use pydenticon to generate an identicon image.
      All parameters are extracted from configuration.
      '''
      blocks_size = get_internal_config('size')
      foreground = get_internal_config('foreground')
      background = get_internal_config('background')
      generator = pydenticon.Generator(blocks_size, blocks_size,
                                       digest=hashlib.sha1,
                                       foreground=foreground,
                                       background=background)
  
      # Pydenticon adds padding to the size and as a consequence
      # we need to compute the size without the padding
      padding = int(round(get_internal_config('padding') * size / 100.))
      size = size - 2 * padding
      padding = (padding, ) * 4
      return generator.generate(identifier, size, size,
                                padding=padding,
                                output_format='png'f generate_pydenticon(identifier, size):
      '''
      Use pydenticon to generate an identicon image.
      All parameters are extracted from configuration.
      '''
      blocks_size = get_internal_config('size')
      foreground = get_internal_config('foreground')
      background = get_internal_config('background')
      generator = pydenticon.Generator(blocks_size, blocks_size,
                                       digest=hashlib.sha1,
                                       foreground=foreground,
                                       background=background)
  
      # Pydenticon adds padding to the size and as a consequence
      # we need to compute the size without the padding
      padding = int(round(get_internal_config('padding') * size / 100.))
      size = size - 2 * padding
      padding = (padding, ) * 4
      return generator.generate(identifier, size, size,
                                padding=padding,
                                output_format='png')
docs: Use pydenticon to generate an identicon image.
      All parameters are extracted from configuration.