'Return whether a string has a colon which is not between brackets.
This function returns True if the given string has a colon which is
not between a pair of (round, square or curly) brackets. It assumes
that the brackets in the string are balanced.'

def __has_colon_not_in_brackets(self, text):

    for (pos, char) in enumerate(text):
        if ((char == ':') and (not self.__unmatched_braces_in_line(text[:pos]))):
            return True
    return False
