def _value_counts_arraylike(values, dropna):
values = _ensure_arraylike(values)<EOL>original = values<EOL>values, dtype, ndtype = _ensure_data(values)<EOL>if needs_i8_conversion(dtype):<EOL><INDENT>keys, counts = htable.value_count_int64(values, dropna)<EOL>if dropna:<EOL><INDENT>msk = keys != iNaT<EOL>keys, counts = keys[msk], counts[msk]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>f = getattr(htable, "<STR_LIT>".format(dtype=ndtype))<EOL>keys, counts = f(values, dropna)<EOL>mask = isna(values)<EOL>if not dropna and mask.any():<EOL><INDENT>if not isna(keys).any():<EOL><INDENT>keys = np.insert(keys, <NUM_LIT:0>, np.NaN)<EOL>counts = np.insert(counts, <NUM_LIT:0>, mask.sum())<EOL><DEDENT><DEDENT><DEDENT>keys = _reconstruct_data(keys, original.dtype, original)<EOL>return keys, counts<EOL>
Parameters
----------
values : arraylike
dropna : boolean

Returns
-------
(uniques, counts)