Explain how you would implement a function to check whether parentheses are valid.
Implement is_valid_parentheses(s), which receives a string containing (, ), {, }, [, and ], and returns True only when every opening bracket is closed by the matching bracket in the correct order. Return False for malformed, incorrectly nested, or empty inputs.
def is_valid_parentheses(s):