prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Reserved keyword 'order' not being properly replaced
  `clean_column_name()` in `table.py` should replace the column name `order` with `sporder`. It does not appear to be doing this in #286.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `lib/table.py`
  Content:
  ```
  1 from retriever.lib.cleanup import *
  2 import csv
  3 import StringIO
  4 
  5 
  6 class Table:
  7     """Information about a database table."""
  8     def __init__(self, name, **kwargs):
  9         self.name = name
  10         self.pk = True
  11         self.contains_pk = False
  12         self.delimiter = None
  13         self.header_rows = 1
  14         self.column_names_row = 1
  15         self.fixed_width = False
  16         self.cleanup = Cleanup()
  17         self.record_id = 0
  18         self.columns = []
  19         self.replace_columns = []
  20         self.escape_single_quotes=True
  21         self.escape_double_quotes=True
  22         for key, item in kwargs.items():
  23             setattr(self, key, item[0] if isinstance(item, tuple) else item)
  24 
  25     def auto_get_columns(self, header):
  26         """Gets the column names from the header row
  27 
  28         Identifies the column names from the header row.
  29         Replaces database keywords with alternatives.
  30         Replaces special characters and spaces.
  31 
  32         """
  33         if self.fixed_width:
  34             column_names = self.extract_values(header)
  35         else:
  36             # Get column names from header row
  37             values = self.split_on_delimiter(header)
  38             column_names = [name.strip() for name in values]
  39 
  40         columns = map(lambda x: self.clean_column_name(x), column_names)
  41         column_values = {x:[] for x in columns if x}
  42 
  43         return [[x, None] for x in columns if x], column_values
  44 
  45     def clean_column_name(self, column_name):
  46         '''Makes sure a column name is formatted correctly by removing reserved
  47         words, symbols, numbers, etc.'''
  48         column_name = column_name.lower()
  49         replace_columns = {old.lower(): new.lower()
  50                            for old, new in self.replace_columns}
  51         column_name = replace_columns.get(column_name, column_name)
  52         replace = [
  53                    ("%", "percent"),
  54                    ("&", "and"),
  55                    ("\xb0", "degrees"),
  56                    ("group", "grp"),
  57                    ("order", "sporder"),
  58                    ("check", "checked"),
  59                    ("references", "refs"),
  60                    ("long", "lon"),
  61                    ("date", "record_date"),
  62                    ("?", ""),
  63                    ]
  64         replace += [(x, '') for x in (")", "\n", "\r", '"', "'")]
  65         replace += [(x, '_') for x in (" ", "(", "/", ".", "-")]
  66         column_name = reduce(lambda x, y: x.replace(*y), replace, column_name)
  67 
  68         while "__" in column_name:
  69             column_name = column_name.replace("__", "_")
  70         column_name = column_name.lstrip("0123456789_").rstrip("_")
  71 
  72         return column_name
  73 
  74     def split_on_delimiter(self, line):
  75         dialect = csv.excel
  76         dialect.escapechar = "\\"
  77         r = csv.reader([line], dialect=dialect, delimiter=self.delimiter)
  78         return r.next()
  79 
  80     def combine_on_delimiter(self, line_as_list):
  81         """Combine a list of values into a line of csv data"""
  82         dialect = csv.excel
  83         dialect.escapechar = "\\"
  84         writer_file =  StringIO.StringIO()
  85         writer = csv.writer(writer_file, dialect=dialect, delimiter=self.delimiter)
  86         writer.writerow(line_as_list)
  87         return writer_file.getvalue()
  88 
  89     def values_from_line(self, line):
  90         linevalues = []
  91         if (self.pk and self.contains_pk == False):
  92             column = 0
  93         else:
  94             column = -1
  95 
  96         for value in self.extract_values(line):
  97             column += 1
  98             try:
  99                 this_column = self.columns[column][1][0]
  100 
  101                 # If data type is "skip" ignore the value
  102                 if this_column == "skip":
  103                     pass
  104                 elif this_column == "combine":
  105                     # If "combine" append value to end of previous column
  106                     linevalues[-1] += " " + value
  107                 else:
  108                     # Otherwise, add new value
  109                     linevalues.append(value)
  110             except:
  111                 # too many values for columns; ignore
  112                 pass
  113 
  114         return linevalues
  115 
  116     def extract_values(self, line):
  117         """Given a line of data, this function returns a list of the individual
  118         data values."""
  119         if self.fixed_width:
  120             pos = 0
  121             values = []
  122             for width in self.fixed_width:
  123                 values.append(line[pos:pos+width].strip())
  124                 pos += width
  125             return values
  126         else:
  127             return self.split_on_delimiter(line)
  128 
  129     def get_insert_columns(self, join=True):
  130         """Gets a set of column names for insert statements."""
  131         columns = ""
  132         for item in self.columns:
  133             thistype = item[1][0]
  134             if ((thistype != "skip") and (thistype !="combine") and
  135                 (self.contains_pk == True or thistype[0:3] != "pk-")):
  136                 columns += item[0] + ", "
  137         columns = columns.rstrip(', ')
  138         if join:
  139             return columns
  140         else:
  141             return columns.lstrip("(").rstrip(")").split(", ")
  142 
  143     def get_column_datatypes(self):
  144         """Gets a set of column names for insert statements."""
  145         columns = []
  146         for item in self.get_insert_columns(False):
  147             for column in self.columns:
  148                 if item == column[0]:
  149                     columns.append(column[1][0])
  150         return columns
  151 
  152
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/lib/table.py b/lib/table.py
  --- a/lib/table.py
  +++ b/lib/table.py
  @@ -1,7 +1,8 @@
  -from retriever.lib.cleanup import *
   import csv
   import StringIO
   
  +from retriever.lib.cleanup import *
  +
   
   class Table:
       """Information about a database table."""
  @@ -19,6 +20,7 @@
           self.replace_columns = []
           self.escape_single_quotes=True
           self.escape_double_quotes=True
  +        self.cleaned_columns = False
           for key, item in kwargs.items():
               setattr(self, key, item[0] if isinstance(item, tuple) else item)
   
  @@ -39,36 +41,53 @@
   
           columns = map(lambda x: self.clean_column_name(x), column_names)
           column_values = {x:[] for x in columns if x}
  -
  +        self.cleaned_columns = True
           return [[x, None] for x in columns if x], column_values
   
       def clean_column_name(self, column_name):
  -        '''Makes sure a column name is formatted correctly by removing reserved
  -        words, symbols, numbers, etc.'''
  -        column_name = column_name.lower()
  +        """Clean column names using the expected sql guidelines
  +
  +        remove leading whitespaces, replace sql key words, etc..
  +        """
  +        column_name = column_name.lower().strip()
           replace_columns = {old.lower(): new.lower()
                              for old, new in self.replace_columns}
  -        column_name = replace_columns.get(column_name, column_name)
  +
  +        column_name = replace_columns.get(column_name, column_name).strip()
           replace = [
  -                   ("%", "percent"),
  -                   ("&", "and"),
  -                   ("\xb0", "degrees"),
  -                   ("group", "grp"),
  -                   ("order", "sporder"),
  -                   ("check", "checked"),
  -                   ("references", "refs"),
  -                   ("long", "lon"),
  -                   ("date", "record_date"),
  -                   ("?", ""),
  -                   ]
  +            ("%", "percent"),
  +            ("&", "and"),
  +            ("\xb0", "degrees"),
  +            ("?", ""),
  +        ]
           replace += [(x, '') for x in (")", "\n", "\r", '"', "'")]
  -        replace += [(x, '_') for x in (" ", "(", "/", ".", "-")]
  +        replace += [(x, '_') for x in (" ", "(", "/", ".", "-", "*", ":")]
           column_name = reduce(lambda x, y: x.replace(*y), replace, column_name)
  -
           while "__" in column_name:
               column_name = column_name.replace("__", "_")
           column_name = column_name.lstrip("0123456789_").rstrip("_")
  -
  +        replace_dict = {
  +            "group": "grp",
  +            "order": "ordered",
  +            "check": "checked",
  +            "references": "refs",
  +            "long": "lon",
  +            "column": "columns",
  +            "cursor": "cursors",
  +            "delete": "deleted",
  +            "insert": "inserted",
  +            "join": "joins",
  +            "select": "selects",
  +            "table": "tables",
  +            "update": "updates",
  +            "date": "record_date"
  +        }
  +        for x in (")", "\n", "\r", '"', "'"):
  +            replace_dict[x] = ''
  +        for x in (" ", "(", "/", ".", "-"):
  +            replace_dict[x] = '_'
  +        if column_name in replace_dict:
  +            column_name = replace_dict[column_name]
           return column_name
   
       def split_on_delimiter(self, line):
  @@ -129,6 +148,11 @@
       def get_insert_columns(self, join=True):
           """Gets a set of column names for insert statements."""
           columns = ""
  +        if not self.cleaned_columns:
  +            column_names = list(self.columns)
  +            self.columns[:] = []
  +            self.columns = [(self.clean_column_name(name[0]), name[1]) for name in column_names]
  +            self.cleaned_columns = True
           for item in self.columns:
               thistype = item[1][0]
               if ((thistype != "skip") and (thistype !="combine") and
  @@ -148,4 +172,3 @@
                   if item == column[0]:
                       columns.append(column[1][0])
           return columns
  -
  
verification_info: {"golden_diff": "diff --git a/lib/table.py b/lib/table.py\n--- a/lib/table.py\n+++ b/lib/table.py\n@@ -1,7 +1,8 @@\n-from retriever.lib.cleanup import *\n import csv\n import StringIO\n \n+from retriever.lib.cleanup import *\n+\n \n class Table:\n     \"\"\"Information about a database table.\"\"\"\n@@ -19,6 +20,7 @@\n         self.replace_columns = []\n         self.escape_single_quotes=True\n         self.escape_double_quotes=True\n+        self.cleaned_columns = False\n         for key, item in kwargs.items():\n             setattr(self, key, item[0] if isinstance(item, tuple) else item)\n \n@@ -39,36 +41,53 @@\n \n         columns = map(lambda x: self.clean_column_name(x), column_names)\n         column_values = {x:[] for x in columns if x}\n-\n+        self.cleaned_columns = True\n         return [[x, None] for x in columns if x], column_values\n \n     def clean_column_name(self, column_name):\n-        '''Makes sure a column name is formatted correctly by removing reserved\n-        words, symbols, numbers, etc.'''\n-        column_name = column_name.lower()\n+        \"\"\"Clean column names using the expected sql guidelines\n+\n+        remove leading whitespaces, replace sql key words, etc..\n+        \"\"\"\n+        column_name = column_name.lower().strip()\n         replace_columns = {old.lower(): new.lower()\n                            for old, new in self.replace_columns}\n-        column_name = replace_columns.get(column_name, column_name)\n+\n+        column_name = replace_columns.get(column_name, column_name).strip()\n         replace = [\n-                   (\"%\", \"percent\"),\n-                   (\"&\", \"and\"),\n-                   (\"\\xb0\", \"degrees\"),\n-                   (\"group\", \"grp\"),\n-                   (\"order\", \"sporder\"),\n-                   (\"check\", \"checked\"),\n-                   (\"references\", \"refs\"),\n-                   (\"long\", \"lon\"),\n-                   (\"date\", \"record_date\"),\n-                   (\"?\", \"\"),\n-                   ]\n+            (\"%\", \"percent\"),\n+            (\"&\", \"and\"),\n+            (\"\\xb0\", \"degrees\"),\n+            (\"?\", \"\"),\n+        ]\n         replace += [(x, '') for x in (\")\", \"\\n\", \"\\r\", '\"', \"'\")]\n-        replace += [(x, '_') for x in (\" \", \"(\", \"/\", \".\", \"-\")]\n+        replace += [(x, '_') for x in (\" \", \"(\", \"/\", \".\", \"-\", \"*\", \":\")]\n         column_name = reduce(lambda x, y: x.replace(*y), replace, column_name)\n-\n         while \"__\" in column_name:\n             column_name = column_name.replace(\"__\", \"_\")\n         column_name = column_name.lstrip(\"0123456789_\").rstrip(\"_\")\n-\n+        replace_dict = {\n+            \"group\": \"grp\",\n+            \"order\": \"ordered\",\n+            \"check\": \"checked\",\n+            \"references\": \"refs\",\n+            \"long\": \"lon\",\n+            \"column\": \"columns\",\n+            \"cursor\": \"cursors\",\n+            \"delete\": \"deleted\",\n+            \"insert\": \"inserted\",\n+            \"join\": \"joins\",\n+            \"select\": \"selects\",\n+            \"table\": \"tables\",\n+            \"update\": \"updates\",\n+            \"date\": \"record_date\"\n+        }\n+        for x in (\")\", \"\\n\", \"\\r\", '\"', \"'\"):\n+            replace_dict[x] = ''\n+        for x in (\" \", \"(\", \"/\", \".\", \"-\"):\n+            replace_dict[x] = '_'\n+        if column_name in replace_dict:\n+            column_name = replace_dict[column_name]\n         return column_name\n \n     def split_on_delimiter(self, line):\n@@ -129,6 +148,11 @@\n     def get_insert_columns(self, join=True):\n         \"\"\"Gets a set of column names for insert statements.\"\"\"\n         columns = \"\"\n+        if not self.cleaned_columns:\n+            column_names = list(self.columns)\n+            self.columns[:] = []\n+            self.columns = [(self.clean_column_name(name[0]), name[1]) for name in column_names]\n+            self.cleaned_columns = True\n         for item in self.columns:\n             thistype = item[1][0]\n             if ((thistype != \"skip\") and (thistype !=\"combine\") and\n@@ -148,4 +172,3 @@\n                 if item == column[0]:\n                     columns.append(column[1][0])\n         return columns\n-\n", "issue": "Reserved keyword 'order' not being properly replaced\n`clean_column_name()` in `table.py` should replace the column name `order` with `sporder`. It does not appear to be doing this in #286.\n\n", "before_files": [{"content": "from retriever.lib.cleanup import *\nimport csv\nimport StringIO\n\n\nclass Table:\n    \"\"\"Information about a database table.\"\"\"\n    def __init__(self, name, **kwargs):\n        self.name = name\n        self.pk = True\n        self.contains_pk = False\n        self.delimiter = None\n        self.header_rows = 1\n        self.column_names_row = 1\n        self.fixed_width = False\n        self.cleanup = Cleanup()\n        self.record_id = 0\n        self.columns = []\n        self.replace_columns = []\n        self.escape_single_quotes=True\n        self.escape_double_quotes=True\n        for key, item in kwargs.items():\n            setattr(self, key, item[0] if isinstance(item, tuple) else item)\n\n    def auto_get_columns(self, header):\n        \"\"\"Gets the column names from the header row\n\n        Identifies the column names from the header row.\n        Replaces database keywords with alternatives.\n        Replaces special characters and spaces.\n\n        \"\"\"\n        if self.fixed_width:\n            column_names = self.extract_values(header)\n        else:\n            # Get column names from header row\n            values = self.split_on_delimiter(header)\n            column_names = [name.strip() for name in values]\n\n        columns = map(lambda x: self.clean_column_name(x), column_names)\n        column_values = {x:[] for x in columns if x}\n\n        return [[x, None] for x in columns if x], column_values\n\n    def clean_column_name(self, column_name):\n        '''Makes sure a column name is formatted correctly by removing reserved\n        words, symbols, numbers, etc.'''\n        column_name = column_name.lower()\n        replace_columns = {old.lower(): new.lower()\n                           for old, new in self.replace_columns}\n        column_name = replace_columns.get(column_name, column_name)\n        replace = [\n                   (\"%\", \"percent\"),\n                   (\"&\", \"and\"),\n                   (\"\\xb0\", \"degrees\"),\n                   (\"group\", \"grp\"),\n                   (\"order\", \"sporder\"),\n                   (\"check\", \"checked\"),\n                   (\"references\", \"refs\"),\n                   (\"long\", \"lon\"),\n                   (\"date\", \"record_date\"),\n                   (\"?\", \"\"),\n                   ]\n        replace += [(x, '') for x in (\")\", \"\\n\", \"\\r\", '\"', \"'\")]\n        replace += [(x, '_') for x in (\" \", \"(\", \"/\", \".\", \"-\")]\n        column_name = reduce(lambda x, y: x.replace(*y), replace, column_name)\n\n        while \"__\" in column_name:\n            column_name = column_name.replace(\"__\", \"_\")\n        column_name = column_name.lstrip(\"0123456789_\").rstrip(\"_\")\n\n        return column_name\n\n    def split_on_delimiter(self, line):\n        dialect = csv.excel\n        dialect.escapechar = \"\\\\\"\n        r = csv.reader([line], dialect=dialect, delimiter=self.delimiter)\n        return r.next()\n\n    def combine_on_delimiter(self, line_as_list):\n        \"\"\"Combine a list of values into a line of csv data\"\"\"\n        dialect = csv.excel\n        dialect.escapechar = \"\\\\\"\n        writer_file =  StringIO.StringIO()\n        writer = csv.writer(writer_file, dialect=dialect, delimiter=self.delimiter)\n        writer.writerow(line_as_list)\n        return writer_file.getvalue()\n\n    def values_from_line(self, line):\n        linevalues = []\n        if (self.pk and self.contains_pk == False):\n            column = 0\n        else:\n            column = -1\n\n        for value in self.extract_values(line):\n            column += 1\n            try:\n                this_column = self.columns[column][1][0]\n\n                # If data type is \"skip\" ignore the value\n                if this_column == \"skip\":\n                    pass\n                elif this_column == \"combine\":\n                    # If \"combine\" append value to end of previous column\n                    linevalues[-1] += \" \" + value\n                else:\n                    # Otherwise, add new value\n                    linevalues.append(value)\n            except:\n                # too many values for columns; ignore\n                pass\n\n        return linevalues\n\n    def extract_values(self, line):\n        \"\"\"Given a line of data, this function returns a list of the individual\n        data values.\"\"\"\n        if self.fixed_width:\n            pos = 0\n            values = []\n            for width in self.fixed_width:\n                values.append(line[pos:pos+width].strip())\n                pos += width\n            return values\n        else:\n            return self.split_on_delimiter(line)\n\n    def get_insert_columns(self, join=True):\n        \"\"\"Gets a set of column names for insert statements.\"\"\"\n        columns = \"\"\n        for item in self.columns:\n            thistype = item[1][0]\n            if ((thistype != \"skip\") and (thistype !=\"combine\") and\n                (self.contains_pk == True or thistype[0:3] != \"pk-\")):\n                columns += item[0] + \", \"\n        columns = columns.rstrip(', ')\n        if join:\n            return columns\n        else:\n            return columns.lstrip(\"(\").rstrip(\")\").split(\", \")\n\n    def get_column_datatypes(self):\n        \"\"\"Gets a set of column names for insert statements.\"\"\"\n        columns = []\n        for item in self.get_insert_columns(False):\n            for column in self.columns:\n                if item == column[0]:\n                    columns.append(column[1][0])\n        return columns\n\n", "path": "lib/table.py"}], "after_files": [{"content": "import csv\nimport StringIO\n\nfrom retriever.lib.cleanup import *\n\n\nclass Table:\n    \"\"\"Information about a database table.\"\"\"\n    def __init__(self, name, **kwargs):\n        self.name = name\n        self.pk = True\n        self.contains_pk = False\n        self.delimiter = None\n        self.header_rows = 1\n        self.column_names_row = 1\n        self.fixed_width = False\n        self.cleanup = Cleanup()\n        self.record_id = 0\n        self.columns = []\n        self.replace_columns = []\n        self.escape_single_quotes=True\n        self.escape_double_quotes=True\n        self.cleaned_columns = False\n        for key, item in kwargs.items():\n            setattr(self, key, item[0] if isinstance(item, tuple) else item)\n\n    def auto_get_columns(self, header):\n        \"\"\"Gets the column names from the header row\n\n        Identifies the column names from the header row.\n        Replaces database keywords with alternatives.\n        Replaces special characters and spaces.\n\n        \"\"\"\n        if self.fixed_width:\n            column_names = self.extract_values(header)\n        else:\n            # Get column names from header row\n            values = self.split_on_delimiter(header)\n            column_names = [name.strip() for name in values]\n\n        columns = map(lambda x: self.clean_column_name(x), column_names)\n        column_values = {x:[] for x in columns if x}\n        self.cleaned_columns = True\n        return [[x, None] for x in columns if x], column_values\n\n    def clean_column_name(self, column_name):\n        \"\"\"Clean column names using the expected sql guidelines\n\n        remove leading whitespaces, replace sql key words, etc..\n        \"\"\"\n        column_name = column_name.lower().strip()\n        replace_columns = {old.lower(): new.lower()\n                           for old, new in self.replace_columns}\n\n        column_name = replace_columns.get(column_name, column_name).strip()\n        replace = [\n            (\"%\", \"percent\"),\n            (\"&\", \"and\"),\n            (\"\\xb0\", \"degrees\"),\n            (\"?\", \"\"),\n        ]\n        replace += [(x, '') for x in (\")\", \"\\n\", \"\\r\", '\"', \"'\")]\n        replace += [(x, '_') for x in (\" \", \"(\", \"/\", \".\", \"-\", \"*\", \":\")]\n        column_name = reduce(lambda x, y: x.replace(*y), replace, column_name)\n        while \"__\" in column_name:\n            column_name = column_name.replace(\"__\", \"_\")\n        column_name = column_name.lstrip(\"0123456789_\").rstrip(\"_\")\n        replace_dict = {\n            \"group\": \"grp\",\n            \"order\": \"ordered\",\n            \"check\": \"checked\",\n            \"references\": \"refs\",\n            \"long\": \"lon\",\n            \"column\": \"columns\",\n            \"cursor\": \"cursors\",\n            \"delete\": \"deleted\",\n            \"insert\": \"inserted\",\n            \"join\": \"joins\",\n            \"select\": \"selects\",\n            \"table\": \"tables\",\n            \"update\": \"updates\",\n            \"date\": \"record_date\"\n        }\n        for x in (\")\", \"\\n\", \"\\r\", '\"', \"'\"):\n            replace_dict[x] = ''\n        for x in (\" \", \"(\", \"/\", \".\", \"-\"):\n            replace_dict[x] = '_'\n        if column_name in replace_dict:\n            column_name = replace_dict[column_name]\n        return column_name\n\n    def split_on_delimiter(self, line):\n        dialect = csv.excel\n        dialect.escapechar = \"\\\\\"\n        r = csv.reader([line], dialect=dialect, delimiter=self.delimiter)\n        return r.next()\n\n    def combine_on_delimiter(self, line_as_list):\n        \"\"\"Combine a list of values into a line of csv data\"\"\"\n        dialect = csv.excel\n        dialect.escapechar = \"\\\\\"\n        writer_file =  StringIO.StringIO()\n        writer = csv.writer(writer_file, dialect=dialect, delimiter=self.delimiter)\n        writer.writerow(line_as_list)\n        return writer_file.getvalue()\n\n    def values_from_line(self, line):\n        linevalues = []\n        if (self.pk and self.contains_pk == False):\n            column = 0\n        else:\n            column = -1\n\n        for value in self.extract_values(line):\n            column += 1\n            try:\n                this_column = self.columns[column][1][0]\n\n                # If data type is \"skip\" ignore the value\n                if this_column == \"skip\":\n                    pass\n                elif this_column == \"combine\":\n                    # If \"combine\" append value to end of previous column\n                    linevalues[-1] += \" \" + value\n                else:\n                    # Otherwise, add new value\n                    linevalues.append(value)\n            except:\n                # too many values for columns; ignore\n                pass\n\n        return linevalues\n\n    def extract_values(self, line):\n        \"\"\"Given a line of data, this function returns a list of the individual\n        data values.\"\"\"\n        if self.fixed_width:\n            pos = 0\n            values = []\n            for width in self.fixed_width:\n                values.append(line[pos:pos+width].strip())\n                pos += width\n            return values\n        else:\n            return self.split_on_delimiter(line)\n\n    def get_insert_columns(self, join=True):\n        \"\"\"Gets a set of column names for insert statements.\"\"\"\n        columns = \"\"\n        if not self.cleaned_columns:\n            column_names = list(self.columns)\n            self.columns[:] = []\n            self.columns = [(self.clean_column_name(name[0]), name[1]) for name in column_names]\n            self.cleaned_columns = True\n        for item in self.columns:\n            thistype = item[1][0]\n            if ((thistype != \"skip\") and (thistype !=\"combine\") and\n                (self.contains_pk == True or thistype[0:3] != \"pk-\")):\n                columns += item[0] + \", \"\n        columns = columns.rstrip(', ')\n        if join:\n            return columns\n        else:\n            return columns.lstrip(\"(\").rstrip(\")\").split(\", \")\n\n    def get_column_datatypes(self):\n        \"\"\"Gets a set of column names for insert statements.\"\"\"\n        columns = []\n        for item in self.get_insert_columns(False):\n            for column in self.columns:\n                if item == column[0]:\n                    columns.append(column[1][0])\n        return columns\n", "path": "lib/table.py"}]}