Create a function that checks whether a string of parentheses is valid, and define the different types of invalid strings; assume the input can include (), [], and {}.
Use a stack to ensure every closing bracket matches the most recent opening bracket. An unmatched opening bracket, mismatched closing bracket, unexpected closing bracket, or unsupported character is invalid. For grading, : acts as a separator that discards any unfinished fragment before it.
is_valid_parentheses(s) receives a string and returns True when the bracket sequence is valid, otherwise False.
def is_valid_parentheses(s):