def _split_on_first_equal(line, val='='):
    """Split a line based on first occurrence of " ="

    Parameters
    ----------
    line: str
        string to split
    split: str
        split based on this. Can be multiple characters.
    >>> _split_on_first_equal("this = abc = 1")
    ('this', 'abc = 1')
    """
    l = line.split(' {} '.format(val))
    if l[0].endswith(' {}'.format(val)):
        l[0] = l[0].replace(' {}'.format(val), '')
    return l[0], ' {} '.format(val).join(l[1:])
