(n, a, b)
return np.array(list(set(itertools.permutations(s, n))))
Get all permutations of [a, b, 0, 0, ..., 0] of length n.
    len(out) == (n-1)*n.
Get all permutations of [a, b, 0, 0, ..., 0] of length n.
    len(out) == (n-1)*n.
Get all permutations of [ a b 0 0 ... 0 ] of length n . len ( out ) == ( n - 1 ) * n .
def _s11(n, a, b):
    """Get all permutations of [a, b, 0, 0, ..., 0] of length n.
    len(out) == (n-1)*n.
    """
    s = [a, b] + (n - 2) * [0]
    # First permutations, then set can be really inefficient if items are
    # repeated. Check out <https://stackoverflow.com/q/6284396/353337> for
    # improvements.
    return np.array(list(set(itertools.permutations(s, n))))
def _s11 ( n , a , b ) : s = [ a , b ] + ( n - 2 ) * [ 0 ] # First permutations, then set can be really inefficient if items are # repeated. Check out <https://stackoverflow.com/q/6284396/353337> for # improvements. return np . array ( list ( set ( itertools . permutations ( s , n ) ) ) )