code: def have_same_structure(d1, d2):
          
          # Keys of this level are the same
          if set(d1.keys()) != set(d2.keys()):
              return False
  
          # Check nested dictionaries
          for k1, k2 in zip(sorted(d1.keys()), sorted(d2.keys())):
              # If one of the values is a dictionary and the other is not
              if isinstance(d1[k1], dict) != isinstance(d2[k2], dict):
                  return False
              # If both are dictionaries, recur
              elif isinstance(d1[k1], dict) and isinstance(d2[k2], dict):
                  if not DatabaseManager.have_same_structure(d1[k1], d2[k2]):
                      return False
  
          return True
docs: Given two dictionaries (possibly with other nested dictionaries as
          values), this function checks whether they have the same key structure.
  
          >>> from sem import DatabaseManager
          >>> d1 = {'a': 1, 'b': 2}
          >>> d2 = {'a': [], 'b': 3}
          >>> d3 = {'a': 4, 'c': 5}
          >>> DatabaseManager.have_same_structure(d1, d2)
          True
          >>> DatabaseManager.have_same_structure(d1, d3)
          False
  
          >>> d4 = {'a': {'c': 1}, 'b': 2}
          >>> d5 = {'a': {'c': 3}, 'b': 4}
          >>> d6 = {'a': {'c': 5, 'd': 6}, 'b': 7}
          >>> DatabaseManager.have_same_structure(d1, d4)
          False
          >>> DatabaseManager.have_same_structure(d4, d5)
          True
          >>> DatabaseManager.have_same_structure(d4, d6)
          False