def clean_entity(entity):
    """Gets the entity name from the catapult-server status-error definition.

    Args:
        entity (str): Raw entity to format.

    Returns:
        str: Formatted entity name.
    """
    return entity.lstrip().replace('DEFINE_', '').replace('_RESULT', '').lower(
        ).replace('_', ' ').title().replace('Neutral', 'Neutral_').rstrip(
        ).replace(' ', '')
