human
I am working on the file "Input_utils.ipynb".
The first task is:
Binary vector generator
Version 2 - via Itertool
Can you write Python code for it?

=====
What is a the Python code you requested?
assistant
#Here is the Python code you requested.

# def binary_vector_2(rows_n = [2,4,6,8,10], columns_n = 10):
#     rows = how_many(rows_n, 10)
#     index = 0
#     locations = np.zeros((rows, columns_n))

#     for i in rows_n:
#         for bin_string in kbits(10,i):
#             bin_array = np.fromstring(bin_string,'u1') - ord('0')
#             locations[index,:] = bin_array
#             index = index+1
#     return locations

# inputs = binary_vector_2()
# labels = find_labels(inputs, one_hot=True)
# #dataset_ver = Dataset(inputs, labels)
# #pickle_test(dataset_ver)
# inputs.shape

import numpy as np 
import itertools
from scipy.special import comb

def kbits(n, k):
    """ Generate a list of ordered binary strings representing all the possibile 
    way n chooses k. 
    Args:
        n (int): set cardinality 
        k (int): subset cardinality 
        
    Returns:
        result (string): list of binary strings 
    """
    result = []
    for bits in itertools.combinations(range(n), k):
        s = ['0'] * n
        for bit in bits:
            s[bit] = '1'
        result.append(''.join(s))
    return result

def binary_vector_2(rows_n = [2,4,6,8,10], distribution=[45], columns_n = 10):
    """ Matrix of binary vectors from distribution. 
    Args: 
        rows_n (int, ndarray): nx1
        distribution (int, ndarray): nx1
    
    Returns: 
        ndarray of dimension rows_n * distribution, columns_n
        
    TODO: check inputs, here given as list, but should it be a ndarray? 
    remove index accumulator and rewrite via len(kbit)
    
    Examples: 
        Should be written in doctest format and should illustrate how
        to use the function.
        distribution=comb(columns_n, row)
        returns all possible combinations: in reality not, should remove randomness: or better set flag 
        replacement = False 
    """
    
    rows_n = np.array(rows_n)
    distribution = np.array(distribution)
    
    assert np.all(rows_n >0)
    assert np.all(distribution >0), "Distribution values must be positive. {}...