input: Write a function to create a Song class in Python that meets the following criteria. Create a class Song with two instance variables, title and artist, and three methods, str(), eq(), and length(). If the given class meets the criteria, return True; otherwise, return False. If no class is provided, return False.
  
  assert song_class_valid("""class Song:\n    def __init__(self, title, artist):\n        self.title = title\n        self.artist = artist\n   \n    def __str__(self):\n        return f'Title: {self.title}\\nArtist: {self.artist}'\n    \n    def __eq__(self, other):\n        return self.artist == other.artist and self.title == other.title\n\n    def length(self):\n        return len(self.title)""")==True
  assert song_class_valid("""class Song:\n    def __init__(self, title, artist):\n        self.title = title\n        self.artist = artist\n   \n    def __eq__(self, other):\n        return self.artist == other.artist and self.title == other.title\n\n    def length(self):\n        return len(self.title)""")==False
  assert song_class_valid("""class Song:\n    def __init__(self, title, artist):\n        self.title = title\n        self.artist = artist\n   \n    def __str__(self):\n        return f'Title: {self.title}\\nArtist: {self.artist}'\n    \n    def __eq__(self, other):\n        return self.artist == other.artist\n\n    def length(self):\n        return len(self.title)""")==False
  assert song_class_valid("")==False
output: def song_class_valid(code):
      if not code:
          return False
      
      try:
          exec(code)
          song_instance = Song("Test Title", "Test Artist")
          
          if not hasattr(song_instance, 'title') or not hasattr(song_instance, 'artist'):
              return False
          
          if not hasattr(Song, '__str__') or not callable(Song.__str__):
              return False
          
          if not hasattr(Song, '__eq__') or not callable(Song.__eq__):
              return False
          
          if not hasattr(Song, 'length') or not callable(Song.length):
              return False
          
          return True
      except:
          return False