'Get a contract by index from the session'

def get_contract(self, index):

    item = self.get_item(index)
    if item.contract:
        return item.contract
    else:
        raise exception.CmdErr, 'Contract    not    available'
