Given a string, determine whether it contains a repeated substring pattern and return the matching pattern if one exists. Return the shortest non-empty substring that can be repeated at least twice to form the complete string, or None if no such pattern exists. Implement def repeated_substring_pattern(s):; assume 1 <= len(s) <= 500 and that s contains ordinary characters.
def repeated_substring_pattern(s):