prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [Bug-Candidate]: --disable-color ignored, printer produces colored outputs
  ### Describe the issue:
  
  Flag `--disable-color` seem to be ignored and printer produces colored output with ASCII escape characters not suitable to capture into plaintext files
  
  ```
  slither --help   
  usage: slither target [flag]
  Additional options:
  ...
    --disable-color       Disable output colorization
  ```
  
  Workaround: pass the output through the following sed script:
  ```
  slither . --print function-summary 2>&1 | sed 's/\x1b\[[0-9;]*m//g'
  ```
  
  ### Code example to reproduce the issue:
  
  <img width="1192" alt="image" src="https://github.com/crytic/slither/assets/7992612/850e41d6-e60e-4383-bdb4-c6d6a385c320">
  
  
  ### Version:
  
  slither --version
  0.10.0
  
  From docker image `ghcr.io/trailofbits/eth-security-toolbox:nightly`
  
  ### Relevant log output:
  
  _No response_
  
  </issue>
  <code>
  [start of slither/utils/myprettytable.py]
  1 from typing import List, Dict, Union
  2 
  3 from prettytable.colortable import ColorTable, Themes
  4 
  5 
  6 class MyPrettyTable:
  7     def __init__(self, field_names: List[str], pretty_align: bool = True):  # TODO: True by default?
  8         self._field_names = field_names
  9         self._rows: List = []
  10         self._options: Dict = {}
  11         if pretty_align:
  12             self._options["set_alignment"] = []
  13             self._options["set_alignment"] += [(field_names[0], "l")]
  14             for field_name in field_names[1:]:
  15                 self._options["set_alignment"] += [(field_name, "r")]
  16         else:
  17             self._options["set_alignment"] = []
  18 
  19     def add_row(self, row: List[Union[str, List[str]]]) -> None:
  20         self._rows.append(row)
  21 
  22     def to_pretty_table(self) -> ColorTable:
  23         table = ColorTable(self._field_names, theme=Themes.OCEAN)
  24         for row in self._rows:
  25             table.add_row(row)
  26         if len(self._options["set_alignment"]):
  27             for column_header, value in self._options["set_alignment"]:
  28                 table.align[column_header] = value
  29         return table
  30 
  31     def to_json(self) -> Dict:
  32         return {"fields_names": self._field_names, "rows": self._rows}
  33 
  34     def __str__(self) -> str:
  35         return str(self.to_pretty_table())
  36 
  37 
  38 # UTILITY FUNCTIONS
  39 
  40 
  41 def make_pretty_table(
  42     headers: list, body: dict, totals: bool = False, total_header="TOTAL"
  43 ) -> MyPrettyTable:
  44     """
  45     Converts a dict to a MyPrettyTable.  Dict keys are the row headers.
  46     Args:
  47         headers: str[] of column names
  48         body: dict of row headers with a dict of the values
  49         totals: bool optional add Totals row
  50         total_header: str optional if totals is set to True this will override the default "TOTAL" header
  51     Returns:
  52         MyPrettyTable
  53     """
  54     table = MyPrettyTable(headers)
  55     for row in body:
  56         table_row = [row] + [body[row][key] for key in headers[1:]]
  57         table.add_row(table_row)
  58     if totals:
  59         table.add_row(
  60             [total_header] + [sum([body[row][key] for row in body]) for key in headers[1:]]
  61         )
  62     return table
  63
  [end of slither/utils/myprettytable.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/slither/utils/myprettytable.py b/slither/utils/myprettytable.py
  --- a/slither/utils/myprettytable.py
  +++ b/slither/utils/myprettytable.py
  @@ -1,7 +1,10 @@
   from typing import List, Dict, Union
   
  +from prettytable import PrettyTable
   from prettytable.colortable import ColorTable, Themes
   
  +from slither.utils.colors import Colors
  +
   
   class MyPrettyTable:
       def __init__(self, field_names: List[str], pretty_align: bool = True):  # TODO: True by default?
  @@ -19,8 +22,12 @@
       def add_row(self, row: List[Union[str, List[str]]]) -> None:
           self._rows.append(row)
   
  -    def to_pretty_table(self) -> ColorTable:
  -        table = ColorTable(self._field_names, theme=Themes.OCEAN)
  +    def to_pretty_table(self) -> PrettyTable:
  +        if Colors.COLORIZATION_ENABLED:
  +            table = ColorTable(self._field_names, theme=Themes.OCEAN)
  +        else:
  +            table = PrettyTable(self._field_names)
  +
           for row in self._rows:
               table.add_row(row)
           if len(self._options["set_alignment"]):
  
verification_info: {"golden_diff": "diff --git a/slither/utils/myprettytable.py b/slither/utils/myprettytable.py\n--- a/slither/utils/myprettytable.py\n+++ b/slither/utils/myprettytable.py\n@@ -1,7 +1,10 @@\n from typing import List, Dict, Union\n \n+from prettytable import PrettyTable\n from prettytable.colortable import ColorTable, Themes\n \n+from slither.utils.colors import Colors\n+\n \n class MyPrettyTable:\n     def __init__(self, field_names: List[str], pretty_align: bool = True):  # TODO: True by default?\n@@ -19,8 +22,12 @@\n     def add_row(self, row: List[Union[str, List[str]]]) -> None:\n         self._rows.append(row)\n \n-    def to_pretty_table(self) -> ColorTable:\n-        table = ColorTable(self._field_names, theme=Themes.OCEAN)\n+    def to_pretty_table(self) -> PrettyTable:\n+        if Colors.COLORIZATION_ENABLED:\n+            table = ColorTable(self._field_names, theme=Themes.OCEAN)\n+        else:\n+            table = PrettyTable(self._field_names)\n+\n         for row in self._rows:\n             table.add_row(row)\n         if len(self._options[\"set_alignment\"]):\n", "issue": "[Bug-Candidate]: --disable-color ignored, printer produces colored outputs\n### Describe the issue:\n\nFlag `--disable-color` seem to be ignored and printer produces colored output with ASCII escape characters not suitable to capture into plaintext files\r\n\r\n```\r\nslither --help   \r\nusage: slither target [flag]\r\nAdditional options:\r\n...\r\n  --disable-color       Disable output colorization\r\n```\r\n\r\nWorkaround: pass the output through the following sed script:\r\n```\r\nslither . --print function-summary 2>&1 | sed 's/\\x1b\\[[0-9;]*m//g'\r\n```\n\n### Code example to reproduce the issue:\n\n<img width=\"1192\" alt=\"image\" src=\"https://github.com/crytic/slither/assets/7992612/850e41d6-e60e-4383-bdb4-c6d6a385c320\">\r\n\n\n### Version:\n\nslither --version\r\n0.10.0\r\n\r\nFrom docker image `ghcr.io/trailofbits/eth-security-toolbox:nightly`\n\n### Relevant log output:\n\n_No response_\n", "before_files": [{"content": "from typing import List, Dict, Union\n\nfrom prettytable.colortable import ColorTable, Themes\n\n\nclass MyPrettyTable:\n    def __init__(self, field_names: List[str], pretty_align: bool = True):  # TODO: True by default?\n        self._field_names = field_names\n        self._rows: List = []\n        self._options: Dict = {}\n        if pretty_align:\n            self._options[\"set_alignment\"] = []\n            self._options[\"set_alignment\"] += [(field_names[0], \"l\")]\n            for field_name in field_names[1:]:\n                self._options[\"set_alignment\"] += [(field_name, \"r\")]\n        else:\n            self._options[\"set_alignment\"] = []\n\n    def add_row(self, row: List[Union[str, List[str]]]) -> None:\n        self._rows.append(row)\n\n    def to_pretty_table(self) -> ColorTable:\n        table = ColorTable(self._field_names, theme=Themes.OCEAN)\n        for row in self._rows:\n            table.add_row(row)\n        if len(self._options[\"set_alignment\"]):\n            for column_header, value in self._options[\"set_alignment\"]:\n                table.align[column_header] = value\n        return table\n\n    def to_json(self) -> Dict:\n        return {\"fields_names\": self._field_names, \"rows\": self._rows}\n\n    def __str__(self) -> str:\n        return str(self.to_pretty_table())\n\n\n# UTILITY FUNCTIONS\n\n\ndef make_pretty_table(\n    headers: list, body: dict, totals: bool = False, total_header=\"TOTAL\"\n) -> MyPrettyTable:\n    \"\"\"\n    Converts a dict to a MyPrettyTable.  Dict keys are the row headers.\n    Args:\n        headers: str[] of column names\n        body: dict of row headers with a dict of the values\n        totals: bool optional add Totals row\n        total_header: str optional if totals is set to True this will override the default \"TOTAL\" header\n    Returns:\n        MyPrettyTable\n    \"\"\"\n    table = MyPrettyTable(headers)\n    for row in body:\n        table_row = [row] + [body[row][key] for key in headers[1:]]\n        table.add_row(table_row)\n    if totals:\n        table.add_row(\n            [total_header] + [sum([body[row][key] for row in body]) for key in headers[1:]]\n        )\n    return table\n", "path": "slither/utils/myprettytable.py"}]}