Noblis software may receive compact configuration or message fragments containing parentheses and square brackets. Implement a method that determines whether every opening delimiter is closed by the correct delimiter in the correct order.
A string is valid when each ( has a matching ), each [ has a matching ], and delimiters are properly nested. Ignore all characters other than (, ), [, and ].
Implement is_balanced(s), where s is a string. Return True if the relevant delimiters are balanced and properly nested; otherwise, return False. The empty string is considered valid.
def is_balanced(s):