input: from typing import List
  
  def num_common_substrings(s1: str, s2: str) -> int:
      """ Given two strings, return an integer indicating the number of common substrings 
      between the two strings.
      >>> num_common_substrings("abcd", "bae")
      1
      >>> num_common_substrings("hello", "world")
      1
      """
output:     common_substrings = set()
      for i in range(len(s1)):
          for j in range(i + 1, len(s1) + 1):
              substring = s1[i:j]
              if substring in s2:
                  common_substrings.add(substring)
      return len(common_substrings)