def prettify_obj_type(obj_type, *args, **kwargs):
    """
    Turns all-lowercase record type string to all caps or splits into
    words if underscore.
    e.g. 'cname' to 'CNAME' and 'address_record' to 'Address Record'
    """
    if not obj_type:
        return

    prettified = ''
    if obj_type in ['range', 'network', 'site', 'domain', 'nameserver',
                    'workgroup', 'system']:
        return obj_type[0].upper() + obj_type[1:]
    elif '_' in obj_type:
        capitalize = True
        for i in range(len(obj_type)):
            if capitalize:
                prettified += obj_type[i].upper()
                capitalize = False
            elif obj_type[i] == '_':
                prettified += ' '
                capitalize = True
            else:
                prettified += obj_type[i]
        return prettified

    return obj_type.upper()