def hash_resource(resource):
 md5 = hashlib.md5()
 md5.update(repr(resource))
 return md5.hexdigest()

def hash_resource ( resource ) : md5 = hashlib . md5 ( ) md5 . update ( repr ( resource ) ) return md5 . hexdigest ( )
hash a :class:xblock .