def _check_hash(value):
    """Checks that a hash value is the expected format.

    Args:
        value: String; a git commit hash.

    Raises:
        GitRvException: if the value does is not 40 hex chars.
    """
    if COMMIT_HASH_REGEX.match(value) is None:
        raise GitRvException('Hash %r is not a valid commit hash.' % (value,))
dataset/ETHPy150Open googlearchive/git-rv/utils.py/_check_hash/original