def num_tuples(self, rel_key):
        relation_args = {
            'userName': rel_key.user,
            'programName': rel_key.program,
            'relationName': rel_key.relation
        }
        if not self.connection:
            raise RuntimeError(
                "no cardinality of %s because no connection" % rel_key)
        try:
            dataset_info = self.connection.dataset(relation_args)
        except MyriaError:
            raise ValueError(rel_key)
        num_tuples = dataset_info['numTuples']
        assert isinstance(num_tuples, (int, long)), type(num_tuples)
        # that's a work round. numTuples is -1 if the dataset is old
        if num_tuples != -1:
            assert num_tuples >= 0
            return num_tuples
        return DEFAULT_CARDINALITY
dataset/ETHPy150Open uwescience/raco/raco/backends/myria/catalog.py/MyriaCatalog.num_tuples/original