prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  aws ec2 replace-network-acl-entry --protocol ?
  How can I specify a protocol? When I specify --protocol tcp or --protocol udp, the command fails:
  
  A client error (InvalidParameterValue) occurred when calling the ReplaceNetworkAclEntry operation: Invalid value 'tcp' for IP protocol. Unknown protocol.
  
  A client error (InvalidParameterValue) occurred when calling the ReplaceNetworkAclEntry operation: Invalid value 'udp' for IP protocol. Unknown protocol.
  
  The command create-network-acl-entry accepts --protocol tcp or --protocol udp.
  
  
  </issue>
  <code>
  [start of awscli/customizations/ec2protocolarg.py]
  1 # Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License"). You
  4 # may not use this file except in compliance with the License. A copy of
  5 # the License is located at
  6 #
  7 #     http://aws.amazon.com/apache2.0/
  8 #
  9 # or in the "license" file accompanying this file. This file is
  10 # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
  11 # ANY KIND, either express or implied. See the License for the specific
  12 # language governing permissions and limitations under the License.
  13 """
  14 This customization allows the user to specify the values "tcp", "udp",
  15 or "icmp" as values for the --protocol parameter.  The actual Protocol
  16 parameter of the operation accepts only integer protocol numbers.
  17 """
  18 
  19 def _fix_args(operation, endpoint, params, **kwargs):
  20     if 'protocol' in params:
  21         if params['protocol'] == 'tcp':
  22             params['protocol'] = '6'
  23         elif params['protocol'] == 'udp':
  24             params['protocol'] = '17'
  25         elif params['protocol'] == 'icmp':
  26             params['protocol'] = '1'
  27         elif params['protocol'] == 'all':
  28             params['protocol'] = '-1'
  29 
  30 
  31 def register_protocol_args(cli):
  32     ('before-parameter-build.ec2.RunInstances', _fix_args),
  33     cli.register('before-parameter-build.ec2.CreateNetworkAclEntry',
  34                  _fix_args)
  35     
  36
  [end of awscli/customizations/ec2protocolarg.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/awscli/customizations/ec2protocolarg.py b/awscli/customizations/ec2protocolarg.py
  --- a/awscli/customizations/ec2protocolarg.py
  +++ b/awscli/customizations/ec2protocolarg.py
  @@ -29,7 +29,8 @@
   
   
   def register_protocol_args(cli):
  -    ('before-parameter-build.ec2.RunInstances', _fix_args),
       cli.register('before-parameter-build.ec2.CreateNetworkAclEntry',
                    _fix_args)
  +    cli.register('before-parameter-build.ec2.ReplaceNetworkAclEntry',
  +                 _fix_args)
  
verification_info: {"golden_diff": "diff --git a/awscli/customizations/ec2protocolarg.py b/awscli/customizations/ec2protocolarg.py\n--- a/awscli/customizations/ec2protocolarg.py\n+++ b/awscli/customizations/ec2protocolarg.py\n@@ -29,7 +29,8 @@\n \n \n def register_protocol_args(cli):\n-    ('before-parameter-build.ec2.RunInstances', _fix_args),\n     cli.register('before-parameter-build.ec2.CreateNetworkAclEntry',\n                  _fix_args)\n+    cli.register('before-parameter-build.ec2.ReplaceNetworkAclEntry',\n+                 _fix_args)\n", "issue": "aws ec2 replace-network-acl-entry --protocol ?\nHow can I specify a protocol? When I specify --protocol tcp or --protocol udp, the command fails:\n\nA client error (InvalidParameterValue) occurred when calling the ReplaceNetworkAclEntry operation: Invalid value 'tcp' for IP protocol. Unknown protocol.\n\nA client error (InvalidParameterValue) occurred when calling the ReplaceNetworkAclEntry operation: Invalid value 'udp' for IP protocol. Unknown protocol.\n\nThe command create-network-acl-entry accepts --protocol tcp or --protocol udp.\n\n", "before_files": [{"content": "# Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n#     http://aws.amazon.com/apache2.0/\n#\n# or in the \"license\" file accompanying this file. This file is\n# distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n# ANY KIND, either express or implied. See the License for the specific\n# language governing permissions and limitations under the License.\n\"\"\"\nThis customization allows the user to specify the values \"tcp\", \"udp\",\nor \"icmp\" as values for the --protocol parameter.  The actual Protocol\nparameter of the operation accepts only integer protocol numbers.\n\"\"\"\n\ndef _fix_args(operation, endpoint, params, **kwargs):\n    if 'protocol' in params:\n        if params['protocol'] == 'tcp':\n            params['protocol'] = '6'\n        elif params['protocol'] == 'udp':\n            params['protocol'] = '17'\n        elif params['protocol'] == 'icmp':\n            params['protocol'] = '1'\n        elif params['protocol'] == 'all':\n            params['protocol'] = '-1'\n\n\ndef register_protocol_args(cli):\n    ('before-parameter-build.ec2.RunInstances', _fix_args),\n    cli.register('before-parameter-build.ec2.CreateNetworkAclEntry',\n                 _fix_args)\n    \n", "path": "awscli/customizations/ec2protocolarg.py"}]}