code: def insert_flux_bias(cur, chain, system, flux_bias, chain_strength, encoded_data=None):
      
      if encoded_data is None:
          encoded_data = {}
  
      insert_chain(cur, chain, encoded_data)
      insert_system(cur, system, encoded_data)
  
      if 'flux_bias' not in encoded_data:
          encoded_data['flux_bias'] = _encode_real(flux_bias)
      if 'chain_strength' not in encoded_data:
          encoded_data['chain_strength'] = _encode_real(chain_strength)
      if 'insert_time' not in encoded_data:
          encoded_data['insert_time'] = datetime.datetime.now()
  
      insert = \
          """
          INSERT OR REPLACE INTO flux_bias(chain_id, system_id, insert_time, flux_bias, chain_strength)
          SELECT
              chain.id,
              system.id,
              :insert_time,
              :flux_bias,
              :chain_strength
          FROM chain, system
          WHERE
              chain.chain_length = :chain_length AND
              chain.nodes = :nodes AND
              system.system_name = :system_name;
          """
  
      cur.execute(insert, encoded_data)
docs: Insert a flux bias offset into the cache.
  
      Args:
          cur (:class:`sqlite3.Cursor`):
              An sqlite3 cursor. This function is meant to be run within a :obj:`with` statement.
  
          chain (iterable):
              A collection of nodes. Chains in embedding act as one node.
  
          system (str):
              The unique name of a system.
  
          flux_bias (float):
              The flux bias offset associated with the given chain.
  
          chain_strength (float):
              The magnitude of the negative quadratic bias that induces the given chain in an Ising
              problem.
  
          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.