def _has_symbol(symbol, name):
    """
    Check if has provided symbol in name.

    Recognizes either the _SYMBOL pattern at end of string, or _SYMBOL_ in
    middle.
    """
    return name.endswith('_' + symbol) or ('_' + symbol + '_') in name