
import csv
from typing import Collection

class Table:
    """
    A simple in-memory database.
    """
    @staticmethod
    def from_csv_file(filename: str, header: Collection[str] = None) -> 'Table':
        """
        Create a Table object using data from the file at the given path.

        If `header` is not provided, the first row is used as header.
        """
        with open(filename, 'r') as csvfile:
            reader = csv.reader(csvfile)
            table = Table(next(reader) if header is None else tuple(header))
            for row in reader:
                table.append(row)
        return table

    def __init__(self, header: Collection[str]) -> None:
        self.header = tuple(header)
        self.width = len(self.header)
        self.data = [] # type: list[tuple]
        self.column_index = dict(zip(self.header, range(self.width)))

    def get_column_index(self, name: str) -> int:
        """
        Get the index of the column with the given name.

        This is for internal uses.
        """
        index = self.column_index.get(name)
        if index is None:
            raise KeyError("The table has no column named '{}'".format(name))
        return index

    def append(self, data: Collection):
        """
        Append a new row to the table.
        """
        assert len(data) == self.width
        self.data.append(tuple(data))

@@ -5,16 +5,44 @@
 ort csv%0A
+from typing import Iterable%0A
 from typ
@@ -573,59 +573,32 @@
     
-for row in reader:%0A                table.append(row
+table.append_many(reader
 )%0A  
@@ -1379,8 +1379,134 @@
 (data))%0A
+%0A    def append_many(self, iterable: Iterable%5BCollection%5D) -%3E None:%0A        for row in iterable:%0A            self.append(row)%0A

implement Table#append_many