def DetermineLocaleType(locale_str):
    """Determines the locale 'type' for a given locale name.

    Returns:
        (string) Always one of the following strings,
        'world' If the locale name refers to the world.
        'country' If the locale name looks like a country ID.
        'region' If the locale name looks like a region ID.
        'city' If the locale name looks like a city ID.
    """
    if locale_str == 'world':
        return 'world'

    depth_map = {1: 'country', 2: 'region', 3: 'city'}
    depth = len(locale_str.split('_'))

    return depth_map[depth]