def is_het(self, allele=None):
        """Find genotype calls that are heterozygous.

        Returns
        -------
        out : ndarray, bool, shape (n_variants, n_samples)
            Array where elements are True if the genotype call matches the
            condition.
        allele : int, optional
            Heterozygous allele.

        Examples
        --------

        >>> import allel
        >>> g = allel.GenotypeArray([[[0, 0], [0, 1]],
        ...                          [[0, 1], [1, 1]],
        ...                          [[0, 2], [-1, -1]]])
        >>> g.is_het()
        array([[False,  True],
               [ True, False],
               [ True, False]])
        >>> g.is_het(2)
        array([[False, False],
               [False, False],
               [ True, False]])
        >>> v = g[:, 0]
        >>> v
        <GenotypeVector shape=(3, 2) dtype=int64>
        0/0 0/1 0/2
        >>> v.is_het()
        array([False,  True,  True])

        """

        allele1 = self.values[..., 0, np.newaxis]  # type: np.ndarray
        other_alleles = self.values[..., 1:]  # type: np.ndarray
        out = np.all(self.values >= 0, axis=-1) & np.any(allele1 != other_alleles, axis=-1)
        if allele is not None:
            out &= np.any(self.values == allele, axis=-1)

        # handle mask
        if self.mask is not None:
            out &= ~self.mask

        return out