def _clean_identifier(arg):
    """
    Our class property names have an appended underscore when they clash with Python names.

    This will strip off any trailing underscores, ready for serialisation.

    :type arg: str
    :rtype: str

    >>> _clean_identifier('id_')
    'id'
    >>> _clean_identifier('id')
    'id'
    """
    return arg[:-1] if arg.endswith('_') else arg