code: def sign(self, hash160_lookup, tx_in_idx_set=None, hash_type=None, **kwargs):
          
          checker = self.SolutionChecker(self.tx)
          if tx_in_idx_set is None:
              tx_in_idx_set = range(len(self.tx.txs_in))
          self.tx.check_unspents()
          for tx_in_idx in sorted(tx_in_idx_set):
              tx_context = checker.tx_context_for_idx(tx_in_idx)
              try:
                  checker.check_solution(tx_context, flags=None)
                  continue
              except ScriptError:
                  pass
              try:
                  r = self.solve(hash160_lookup, tx_in_idx, hash_type=hash_type, **kwargs)
                  if isinstance(r, bytes):
                      self.tx.txs_in[tx_in_idx].script = r
                  else:
                      self.tx.txs_in[tx_in_idx].script = r[0]
                      self.tx.set_witness(tx_in_idx, r[1])
              except (SolvingError, ValueError):
                  pass
          return self
docs: Sign a standard transaction.
          hash160_lookup:
              A dictionary (or another object with .get) where keys are hash160 and
              values are tuples (secret exponent, public_pair, is_compressed) or None
              (in which case the script will obviously not be signed).