<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def multiplicity(keys, axis=semantics.axis_default):
 """return the multiplicity of each key, or how often it occurs in the set Parameters keys : indexable object Returns ------- ndarray, [keys.size], int the number of times each input item occurs in the set """

    index = as_index(keys, axis)
    return index.count[index.inverse]