def _num_samples(x):
if not hasattr(x, '<STR_LIT>') and not hasattr(x, '<STR_LIT>'):<EOL><INDENT>if hasattr(x, '<STR_LIT>'):<EOL><INDENT>x = np.asarray(x)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>" % x)<EOL><DEDENT><DEDENT>return x.shape[<NUM_LIT:0>] if hasattr(x, '<STR_LIT>') else len(x)<EOL>
Return number of samples in array-like x.