import hashlib


def get_md5_tmp(path):
    """
        return the md5 sum of the path.
        if the path is a temporary directory, the md5 is prefixed with "tmp_"
    """
    m = hashlib.md5()
    m.update(path)

    if path.__contains__("temp") or path.__contains__("tmp"):
        return "tmp_%r" % m.hexdigest()

    return m.hexdigest()