simpler implementation of `BaseProvider.random_element`