<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def etag(self):
 """ Generates etag from file contents. """

        CHUNKSIZE = 1024 * 64
        from hashlib import md5
        hash = md5()
        with open(self.path) as fin:
            chunk = fin.read(CHUNKSIZE)
            while chunk:
                hash_update(hash, chunk)
                chunk = fin.read(CHUNKSIZE)
        return hash.hexdigest()