import re


def try_assignment(arg):
    """
        Check if `arg` follows the format of a variable assignent,
        and if that succeeds, return the key and value strings in a tuple.
    """
    res = re.match(r" *([a-zA-Z]\w*) *: *(.*)", arg)
    #print("   try_assignment `%s'" % arg);
    #print(res.groups())
    if not res or not len(res.groups()) == 2:
        return ('', arg)
    k = res.group(1)
    v = res.group(2).strip()
    #print("   assigned `%s' = `%s'" % (k, v))
    return (k, v)