def clean_no_data_tensors(np_array): clean_idx = map(lambda xx: 0 if xx == 1 else slice(None, None, None), np_array.shape) if check_args(lambda xx: xx == 1, *np_array.shape): clean_idx[0] = slice(None, None, None) return np_array[clean_idx]
def test_check_args_1(): assert check_args(lambda xx:isinstance(xx,int),*range(10)) == True
def test_check_args_2(): assert check_args(lambda xx:isinstance(xx,int),*map(str,range(10))) == False