code: def insert_feasible_configurations(cur, feasible_configurations, encoded_data=None):
      
      if encoded_data is None:
          encoded_data = {}
  
      if 'num_variables' not in encoded_data:
          encoded_data['num_variables'] = len(next(iter(feasible_configurations)))
      if 'num_feasible_configurations' not in encoded_data:
          encoded_data['num_feasible_configurations'] = len(feasible_configurations)
      if 'feasible_configurations' not in encoded_data or 'energies' not in encoded_data:
          encoded = {_serialize_config(config): en for config, en in feasible_configurations.items()}
  
          configs, energies = zip(*sorted(encoded.items()))
          encoded_data['feasible_configurations'] = json.dumps(configs, separators=(',', ':'))
          encoded_data['energies'] = json.dumps(energies, separators=(',', ':'))
  
      insert = """
              INSERT OR IGNORE INTO feasible_configurations(
                  num_variables,
                  num_feasible_configurations,
                  feasible_configurations,
                  energies)
              VALUES (
                  :num_variables,
                  :num_feasible_configurations,
                  :feasible_configurations,
                  :energies);
              """
  
      cur.execute(insert, encoded_data)
docs: Insert a group of feasible configurations into the cache.
  
      Args:
          cur (:class:`sqlite3.Cursor`): An sqlite3 cursor. This function
              is meant to be run within a :obj:`with` statement.
          feasible_configurations (dict[tuple[int]): The set of feasible
              configurations. Each key should be a tuple of variable assignments.
              The values are the relative energies.
          encoded_data (dict, optional): If a dictionary is provided, it
              will be populated with the serialized data. This is useful for
              preventing encoding the same information many times.
  
      Examples:
          >>> feasible_configurations = {(-1, -1): 0.0, (+1, +1): 0.0}
          >>> with pmc.cache_connect(':memory:') as cur:
          ...     pmc.insert_feasible_configurations(cur, feasible_configurations)