def name_to_tag(name):
    """
    Returns sanitized str `name`: no more than 10 characters,
    with spaces replaced with `_`
    """
    if len(name) > 10:
        name = name[:10]
    return name.replace(' ', '_').strip()