def check_array_or_list(input):
if type(input) != np.ndarray:<EOL><INDENT>if type(input) == list:<EOL><INDENT>output = np.array(input)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>output = input<EOL><DEDENT>if output.ndim != <NUM_LIT:1>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if np.sum(output < <NUM_LIT:0.>) > <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return output<EOL>
Return 1D ndarray, if input can be converted and elements are
    non-negative.