code: def sign_tx(network, tx, wifs=[], **kwargs):
      
      keychain = network.keychain()
      keychain.add_secrets((network.parse.wif(_) for _ in wifs))
      solver = tx.Solver(tx)
      solver.sign(keychain, **kwargs)
docs: :param tx: a transaction
      :param wifs: the list of WIFs required to sign this transaction.
      :return: :class:`Tx <Tx>` object, modified in place
  
      This is a convenience function used to sign a transaction.
      The transaction must have "unspents" set by, for example, calling tx.unspents_from_db.
  
      Returns the signed Tx transaction, or raises an exception.
  
      Usage::
  
          >> sign_tx(network, tx, wifs=["KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn"])