def calc_checksum(filename):
    """
    Calculates a checksum of the contents of the given file.
    :param filename:
    :return:
    """
    try:
        f = open(filename, "rb")
        contents = f.read()
        m = hashlib.md5()
        m.update(contents)
        checksum = m.hexdigest()
        return checksum

    except __HOLE__:
        return None
dataset/ETHPy150Open ccpgames/rescache/checksum.py/calc_checksum