INNER CODE UNIT · Python

push

beader/tianchi_nl2sql · code/nl2sql/utils/__init__.py:55

    def push(self, table):
        self.table_dict[table.id] = table

    def __len__(self):
        return len(self.table_dict)

    def __add__(self, other):
        return Tables(
            table_list=list(self.table_dict.values()) +
            list(other.table_dict.values())
        )

    def __getitem__(self, id):
        return self.table_dict[id]

    def __iter__(self):
        for table_id, table in self.table_dict.items():
            yield table_id, table

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…