def __init__(self, rows, columns, digest=hashlib.md5, foreground=["#000000"], background="#ffffff"):
        """
        Initialises an instance of identicon generator. The instance can be used
        for creating identicons with differing image formats, sizes, and with
        different padding.

        Arguments:

          rows - Number of block rows in an identicon.

          columns - Number of block columns in an identicon.

          digest - Digest class that should be used for the user's data. The
          class should support accepting a single constructor argument for
          passing the data on which the digest will be run. Instances of the
          class should also support a single hexdigest() method that should
          return a digest of passed data as a hex string. Default is
          hashlib.md5. Selection of the digest will limit the maximum values
          that can be set for rows and columns. Digest needs to be able to
          generate (columns / 2 + columns % 2) * rows + 8 bits of entropy.

          foreground - List of colours which should be used for drawing the
          identicon. Each element should be a string of format supported by the
          PIL.ImageColor module. Default is ["#000000"] (only black).

          background - Colour (single) which should be used for background and
          padding, represented as a string of format supported by the
          PIL.ImageColor module. Default is "#ffffff" (white).
        """

        # Check if the digest produces sufficient entropy for identicon
        # generation.
        entropy_provided = len(digest(b"test").hexdigest()) // 2 * 8
        entropy_required = (columns // 2 + columns % 2) * rows + 8

        if entropy_provided < entropy_required:
            raise ValueError("Passed digest '%s' is not capable of providing %d bits of entropy" % (str(digest), entropy_required))

        # Set the expected digest size. This is used later on to detect if
        # passed data is a digest already or not.
        self.digest_entropy = entropy_provided

        self.rows = rows
        self.columns = columns

        self.foreground = foreground
        self.background = background

        self.digest = digest
dataset/ETHPy150Open azaghal/pydenticon/pydenticon/__init__.py/Generator.__init__/original