def head(_b, _x):
    """Determine the number of leading b's in vector x.

    Parameters
    ----------
    b: int
        Integer for counting at head of vector.
    x: array
        Vector of integers.

    Returns
    -------
    head: int
        Number of leading b's in x.
    """
    _head = 0
    for i in _x:
        if i == _b:
            _head += 1
        else:
            break
    return _head
