'Sign this transaction with a private key.
A potentially already existing signature would be overridden.'

def sign(self, key, network_id=None):

    if (network_id is None):
        rawhash = utils.sha3(rlp.encode(self, UnsignedTransaction))
    else:
        assert (1 <= network_id < ((2 ** 63) - 18))
        rlpdata = rlp.encode((rlp.infer_sedes(self).serialize(self)[:(-3)] + [network_id, '', '']))
        rawhash = utils.sha3(rlpdata)
    key = normalize_key(key)
    (self.v, self.r, self.s) = ecsign(rawhash, key)
    if (network_id is not None):
        self.v += (8 + (network_id * 2))
    self._sender = utils.privtoaddr(key)
    return self
