prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Remove ZSTD
  **Is your feature request related to a problem? Please describe.**
  ZSTD is used for compression in our serde process. However we don't need extra compression as we move to Protobuf.
  ZSTD is usually a source of problems when installing PySyft with different hacks to solve it.
  
  **Describe the solution you'd like**
  Remove ZSTD dependency.
  This will require removing the tests and its use in serde.
  
  **Describe alternatives you've considered**
  Protobuf covers compression.
  
  **Additional context**
  
  
  </issue>
  <code>
  [start of syft/serde/compression.py]
  1 """
  2 This file exists to provide one common place for all compression methods used in
  3 simplifying and serializing PySyft objects.
  4 """
  5 
  6 import lz4
  7 from lz4 import (  # noqa: F401
  8     frame,
  9 )  # needed as otherwise we will get: module 'lz4' has no attribute 'frame'
  10 import zstd
  11 
  12 from syft.exceptions import CompressionNotFoundException
  13 
  14 # COMPRESSION SCHEME INT CODES
  15 NO_COMPRESSION = 40
  16 LZ4 = 41
  17 ZSTD = 42
  18 scheme_to_bytes = {
  19     NO_COMPRESSION: NO_COMPRESSION.to_bytes(1, byteorder="big"),
  20     LZ4: LZ4.to_bytes(1, byteorder="big"),
  21     ZSTD: ZSTD.to_bytes(1, byteorder="big"),
  22 }
  23 
  24 ## SECTION: chosen Compression Algorithm
  25 
  26 
  27 def _apply_compress_scheme(decompressed_input_bin) -> tuple:
  28     """
  29     Apply the selected compression scheme.
  30     By default is used LZ4
  31 
  32     Args:
  33         decompressed_input_bin: the binary to be compressed
  34     """
  35     return apply_lz4_compression(decompressed_input_bin)
  36 
  37 
  38 def apply_lz4_compression(decompressed_input_bin) -> tuple:
  39     """
  40     Apply LZ4 compression to the input
  41 
  42     Args:
  43         decompressed_input_bin: the binary to be compressed
  44 
  45     Returns:
  46         a tuple (compressed_result, LZ4)
  47     """
  48     return lz4.frame.compress(decompressed_input_bin), LZ4
  49 
  50 
  51 def apply_zstd_compression(decompressed_input_bin) -> tuple:
  52     """
  53     Apply ZSTD compression to the input
  54 
  55     Args:
  56         decompressed_input_bin: the binary to be compressed
  57 
  58     Returns:
  59         a tuple (compressed_result, ZSTD)
  60     """
  61 
  62     return zstd.compress(decompressed_input_bin), ZSTD
  63 
  64 
  65 def apply_no_compression(decompressed_input_bin) -> tuple:
  66     """
  67     No compression is applied to the input
  68 
  69     Args:
  70         decompressed_input_bin: the binary
  71 
  72     Returns:
  73         a tuple (the binary, LZ4)
  74     """
  75 
  76     return decompressed_input_bin, NO_COMPRESSION
  77 
  78 
  79 def _compress(decompressed_input_bin: bin) -> bin:
  80     """
  81     This function compresses a binary using the function _apply_compress_scheme
  82     if the input has been already compressed in some step, it will return it as it is
  83 
  84     Args:
  85         decompressed_input_bin (bin): binary to be compressed
  86 
  87     Returns:
  88         bin: a compressed binary
  89 
  90     """
  91     compress_stream, compress_scheme = _apply_compress_scheme(decompressed_input_bin)
  92     try:
  93         z = scheme_to_bytes[compress_scheme] + compress_stream
  94         return z
  95     except KeyError:
  96         raise CompressionNotFoundException(
  97             f"Compression scheme not found for compression code: {str(compress_scheme)}"
  98         )
  99 
  100 
  101 def _decompress(binary: bin) -> bin:
  102     """
  103     This function decompresses a binary using the scheme defined in the first byte of the input
  104 
  105     Args:
  106         binary (bin): a compressed binary
  107 
  108     Returns:
  109         bin: decompressed binary
  110 
  111     """
  112 
  113     # check the 1-byte header to check the compression scheme used
  114     compress_scheme = binary[0]
  115 
  116     # remove the 1-byte header from the input stream
  117     binary = binary[1:]
  118     # 1)  Decompress or return the original stream
  119     if compress_scheme == LZ4:
  120         return lz4.frame.decompress(binary)
  121     elif compress_scheme == ZSTD:
  122         return zstd.decompress(binary)
  123     elif compress_scheme == NO_COMPRESSION:
  124         return binary
  125     else:
  126         raise CompressionNotFoundException(
  127             f"Compression scheme not found for compression code: {str(compress_scheme)}"
  128         )
  129
  [end of syft/serde/compression.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/syft/serde/compression.py b/syft/serde/compression.py
  --- a/syft/serde/compression.py
  +++ b/syft/serde/compression.py
  @@ -7,18 +7,15 @@
   from lz4 import (  # noqa: F401
       frame,
   )  # needed as otherwise we will get: module 'lz4' has no attribute 'frame'
  -import zstd
   
   from syft.exceptions import CompressionNotFoundException
   
   # COMPRESSION SCHEME INT CODES
   NO_COMPRESSION = 40
   LZ4 = 41
  -ZSTD = 42
   scheme_to_bytes = {
       NO_COMPRESSION: NO_COMPRESSION.to_bytes(1, byteorder="big"),
       LZ4: LZ4.to_bytes(1, byteorder="big"),
  -    ZSTD: ZSTD.to_bytes(1, byteorder="big"),
   }
   
   ## SECTION: chosen Compression Algorithm
  @@ -48,20 +45,6 @@
       return lz4.frame.compress(decompressed_input_bin), LZ4
   
   
  -def apply_zstd_compression(decompressed_input_bin) -> tuple:
  -    """
  -    Apply ZSTD compression to the input
  -
  -    Args:
  -        decompressed_input_bin: the binary to be compressed
  -
  -    Returns:
  -        a tuple (compressed_result, ZSTD)
  -    """
  -
  -    return zstd.compress(decompressed_input_bin), ZSTD
  -
  -
   def apply_no_compression(decompressed_input_bin) -> tuple:
       """
       No compression is applied to the input
  @@ -118,8 +101,6 @@
       # 1)  Decompress or return the original stream
       if compress_scheme == LZ4:
           return lz4.frame.decompress(binary)
  -    elif compress_scheme == ZSTD:
  -        return zstd.decompress(binary)
       elif compress_scheme == NO_COMPRESSION:
           return binary
       else:
  
verification_info: {"golden_diff": "diff --git a/syft/serde/compression.py b/syft/serde/compression.py\n--- a/syft/serde/compression.py\n+++ b/syft/serde/compression.py\n@@ -7,18 +7,15 @@\n from lz4 import (  # noqa: F401\n     frame,\n )  # needed as otherwise we will get: module 'lz4' has no attribute 'frame'\n-import zstd\n \n from syft.exceptions import CompressionNotFoundException\n \n # COMPRESSION SCHEME INT CODES\n NO_COMPRESSION = 40\n LZ4 = 41\n-ZSTD = 42\n scheme_to_bytes = {\n     NO_COMPRESSION: NO_COMPRESSION.to_bytes(1, byteorder=\"big\"),\n     LZ4: LZ4.to_bytes(1, byteorder=\"big\"),\n-    ZSTD: ZSTD.to_bytes(1, byteorder=\"big\"),\n }\n \n ## SECTION: chosen Compression Algorithm\n@@ -48,20 +45,6 @@\n     return lz4.frame.compress(decompressed_input_bin), LZ4\n \n \n-def apply_zstd_compression(decompressed_input_bin) -> tuple:\n-    \"\"\"\n-    Apply ZSTD compression to the input\n-\n-    Args:\n-        decompressed_input_bin: the binary to be compressed\n-\n-    Returns:\n-        a tuple (compressed_result, ZSTD)\n-    \"\"\"\n-\n-    return zstd.compress(decompressed_input_bin), ZSTD\n-\n-\n def apply_no_compression(decompressed_input_bin) -> tuple:\n     \"\"\"\n     No compression is applied to the input\n@@ -118,8 +101,6 @@\n     # 1)  Decompress or return the original stream\n     if compress_scheme == LZ4:\n         return lz4.frame.decompress(binary)\n-    elif compress_scheme == ZSTD:\n-        return zstd.decompress(binary)\n     elif compress_scheme == NO_COMPRESSION:\n         return binary\n     else:\n", "issue": "Remove ZSTD\n**Is your feature request related to a problem? Please describe.**\r\nZSTD is used for compression in our serde process. However we don't need extra compression as we move to Protobuf.\r\nZSTD is usually a source of problems when installing PySyft with different hacks to solve it.\r\n\r\n**Describe the solution you'd like**\r\nRemove ZSTD dependency.\r\nThis will require removing the tests and its use in serde.\r\n\r\n**Describe alternatives you've considered**\r\nProtobuf covers compression.\r\n\r\n**Additional context**\r\n\n", "before_files": [{"content": "\"\"\"\nThis file exists to provide one common place for all compression methods used in\nsimplifying and serializing PySyft objects.\n\"\"\"\n\nimport lz4\nfrom lz4 import (  # noqa: F401\n    frame,\n)  # needed as otherwise we will get: module 'lz4' has no attribute 'frame'\nimport zstd\n\nfrom syft.exceptions import CompressionNotFoundException\n\n# COMPRESSION SCHEME INT CODES\nNO_COMPRESSION = 40\nLZ4 = 41\nZSTD = 42\nscheme_to_bytes = {\n    NO_COMPRESSION: NO_COMPRESSION.to_bytes(1, byteorder=\"big\"),\n    LZ4: LZ4.to_bytes(1, byteorder=\"big\"),\n    ZSTD: ZSTD.to_bytes(1, byteorder=\"big\"),\n}\n\n## SECTION: chosen Compression Algorithm\n\n\ndef _apply_compress_scheme(decompressed_input_bin) -> tuple:\n    \"\"\"\n    Apply the selected compression scheme.\n    By default is used LZ4\n\n    Args:\n        decompressed_input_bin: the binary to be compressed\n    \"\"\"\n    return apply_lz4_compression(decompressed_input_bin)\n\n\ndef apply_lz4_compression(decompressed_input_bin) -> tuple:\n    \"\"\"\n    Apply LZ4 compression to the input\n\n    Args:\n        decompressed_input_bin: the binary to be compressed\n\n    Returns:\n        a tuple (compressed_result, LZ4)\n    \"\"\"\n    return lz4.frame.compress(decompressed_input_bin), LZ4\n\n\ndef apply_zstd_compression(decompressed_input_bin) -> tuple:\n    \"\"\"\n    Apply ZSTD compression to the input\n\n    Args:\n        decompressed_input_bin: the binary to be compressed\n\n    Returns:\n        a tuple (compressed_result, ZSTD)\n    \"\"\"\n\n    return zstd.compress(decompressed_input_bin), ZSTD\n\n\ndef apply_no_compression(decompressed_input_bin) -> tuple:\n    \"\"\"\n    No compression is applied to the input\n\n    Args:\n        decompressed_input_bin: the binary\n\n    Returns:\n        a tuple (the binary, LZ4)\n    \"\"\"\n\n    return decompressed_input_bin, NO_COMPRESSION\n\n\ndef _compress(decompressed_input_bin: bin) -> bin:\n    \"\"\"\n    This function compresses a binary using the function _apply_compress_scheme\n    if the input has been already compressed in some step, it will return it as it is\n\n    Args:\n        decompressed_input_bin (bin): binary to be compressed\n\n    Returns:\n        bin: a compressed binary\n\n    \"\"\"\n    compress_stream, compress_scheme = _apply_compress_scheme(decompressed_input_bin)\n    try:\n        z = scheme_to_bytes[compress_scheme] + compress_stream\n        return z\n    except KeyError:\n        raise CompressionNotFoundException(\n            f\"Compression scheme not found for compression code: {str(compress_scheme)}\"\n        )\n\n\ndef _decompress(binary: bin) -> bin:\n    \"\"\"\n    This function decompresses a binary using the scheme defined in the first byte of the input\n\n    Args:\n        binary (bin): a compressed binary\n\n    Returns:\n        bin: decompressed binary\n\n    \"\"\"\n\n    # check the 1-byte header to check the compression scheme used\n    compress_scheme = binary[0]\n\n    # remove the 1-byte header from the input stream\n    binary = binary[1:]\n    # 1)  Decompress or return the original stream\n    if compress_scheme == LZ4:\n        return lz4.frame.decompress(binary)\n    elif compress_scheme == ZSTD:\n        return zstd.decompress(binary)\n    elif compress_scheme == NO_COMPRESSION:\n        return binary\n    else:\n        raise CompressionNotFoundException(\n            f\"Compression scheme not found for compression code: {str(compress_scheme)}\"\n        )\n", "path": "syft/serde/compression.py"}]}