<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clean_community_indexes(communityID):
 """ Takes input of community assignments. Returns reindexed community assignment by using smallest numbers possible. Parameters communityID : array-like list or array of integers. Output from community detection algorithems. Returns ------- new_communityID : array cleaned list going from 0 to len(np.unique(communityID))-1 Note ----- Behaviour of funciton entails that the lowest community integer in communityID will recieve the lowest integer in new_communityID. """

    communityID = np.array(communityID)
    cid_shape = communityID.shape
    if len(cid_shape) > 1:
        communityID = communityID.flatten()
    new_communityID = np.zeros(len(communityID))
    for i, n in enumerate(np.unique(communityID)):
        new_communityID[communityID == n] = i
    if len(cid_shape) > 1:
        new_communityID = new_communityID.reshape(cid_shape)
    return new_communityID