prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add SCP support
  The ssh_client fixture supports running a rake command. Some of these commands presuppose a local file exists on the appliance, such as when importing an Automate custom namespace. Extending ssh_client would be ideal.
  
  Here's my os.system hack:
  
  ```
  import os
  ...
  os.system("sshpass -p '%s' scp %s@%s:/root/" % \
              (mozwebqa.credentials['ssh']['password'],      
               mozwebqa.credentials['ssh']['username'], 
               soap_client.evm_server_hostname))
  ```
  
  
  </issue>
  <code>
  [start of utils/ssh.py]
  1 import paramiko
  2 
  3 class SSHClient(paramiko.SSHClient):
  4     """paramiko.SSHClient wrapper
  5 
  6     Allows copying/overriding and use as a context manager
  7     Constructor kwargs are handed directly to paramiko.SSHClient.connect()
  8     """
  9     def __init__(self, **connect_kwargs):
  10         super(SSHClient, self).__init__()
  11         self.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  12 
  13         # Set up some sane defaults
  14         if 'timeout' not in connect_kwargs:
  15             connect_kwargs['timeout'] = 10
  16         if 'allow_agent' not in connect_kwargs:
  17             connect_kwargs['allow_agent'] = False
  18         self._connect_kwargs = connect_kwargs
  19 
  20     def __call__(self, **connect_kwargs):
  21         # Update a copy of this instance's connect kwargs with passed in kwargs,
  22         # then return a new instance with the updated kwargs
  23         new_connect_kwargs = dict(self._connect_kwargs)
  24         new_connect_kwargs.update(connect_kwargs)
  25         new_client = SSHClient(**new_connect_kwargs)
  26         return new_client
  27 
  28     def __enter__(self):
  29         self.connect(**self._connect_kwargs)
  30         return self
  31 
  32     def __exit__(self, *args, **kwargs):
  33         self.close()
  34 
  35     def run_command(self, command):
  36         return command_runner(self, command)
  37 
  38     def run_rails_command(self, command):
  39         return rails_runner(self, command)
  40 
  41     def run_rake_command(self, command):
  42         return rake_runner(self, command)
  43 
  44 
  45 def command_runner(client, command):
  46     template = '%s\n'
  47     command = template % command
  48     with client as ctx:
  49         transport = ctx.get_transport()
  50         session = transport.open_session()
  51         session.set_combine_stderr(True)
  52         session.exec_command(command)
  53         exit_status = session.recv_exit_status()
  54         output = session.recv(-1)
  55         return exit_status, output
  56 
  57     # Returning two things so tuple unpacking the return works even if the ssh client fails
  58     return None, None
  59 
  60 def rails_runner(client, command):
  61     template = '/var/www/miq/vmdb/script/rails runner %s'
  62     return command_runner(client, template % command)
  63 
  64 def rake_runner(client, command):
  65     template = '/var/www/miq/vmdb/script/rake -f /var/www/miq/vmdb/Rakefile %s'
  66     return rails_runner(client, template % command)
  67 
  68
  [end of utils/ssh.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/utils/ssh.py b/utils/ssh.py
  --- a/utils/ssh.py
  +++ b/utils/ssh.py
  @@ -1,4 +1,5 @@
   import paramiko
  +from scp import SCPClient
   
   class SSHClient(paramiko.SSHClient):
       """paramiko.SSHClient wrapper
  @@ -15,6 +16,8 @@
               connect_kwargs['timeout'] = 10
           if 'allow_agent' not in connect_kwargs:
               connect_kwargs['allow_agent'] = False
  +        if 'look_for_keys' not in connect_kwargs:
  +            connect_kwargs['look_for_keys'] = False
           self._connect_kwargs = connect_kwargs
   
       def __call__(self, **connect_kwargs):
  @@ -41,6 +44,11 @@
       def run_rake_command(self, command):
           return rake_runner(self, command)
   
  +    def put_file(self, local_file, remote_file = '.'):
  +        return scp_putter(self, local_file, remote_file)
  +
  +    def get_file(self, remote_file, local_path = ''):
  +        return scp_getter(self, remote_file, local_path)
   
   def command_runner(client, command):
       template = '%s\n'
  @@ -65,3 +73,13 @@
       template = '/var/www/miq/vmdb/script/rake -f /var/www/miq/vmdb/Rakefile %s'
       return rails_runner(client, template % command)
   
  +def scp_putter(client, local_file, remote_file):
  +    with client as ctx:
  +        transport = ctx.get_transport()
  +        SCPClient(transport).put(local_file, remote_file)
  +
  +def scp_getter(client, remote_file, local_path):
  +    with client as ctx:
  +        transport = ctx.get_transport()
  +        SCPClient(transport).get(remote_file, local_path)
  +
  
verification_info: {"golden_diff": "diff --git a/utils/ssh.py b/utils/ssh.py\n--- a/utils/ssh.py\n+++ b/utils/ssh.py\n@@ -1,4 +1,5 @@\n import paramiko\n+from scp import SCPClient\n \n class SSHClient(paramiko.SSHClient):\n     \"\"\"paramiko.SSHClient wrapper\n@@ -15,6 +16,8 @@\n             connect_kwargs['timeout'] = 10\n         if 'allow_agent' not in connect_kwargs:\n             connect_kwargs['allow_agent'] = False\n+        if 'look_for_keys' not in connect_kwargs:\n+            connect_kwargs['look_for_keys'] = False\n         self._connect_kwargs = connect_kwargs\n \n     def __call__(self, **connect_kwargs):\n@@ -41,6 +44,11 @@\n     def run_rake_command(self, command):\n         return rake_runner(self, command)\n \n+    def put_file(self, local_file, remote_file = '.'):\n+        return scp_putter(self, local_file, remote_file)\n+\n+    def get_file(self, remote_file, local_path = ''):\n+        return scp_getter(self, remote_file, local_path)\n \n def command_runner(client, command):\n     template = '%s\\n'\n@@ -65,3 +73,13 @@\n     template = '/var/www/miq/vmdb/script/rake -f /var/www/miq/vmdb/Rakefile %s'\n     return rails_runner(client, template % command)\n \n+def scp_putter(client, local_file, remote_file):\n+    with client as ctx:\n+        transport = ctx.get_transport()\n+        SCPClient(transport).put(local_file, remote_file)\n+\n+def scp_getter(client, remote_file, local_path):\n+    with client as ctx:\n+        transport = ctx.get_transport()\n+        SCPClient(transport).get(remote_file, local_path)\n+\n", "issue": "Add SCP support\nThe ssh_client fixture supports running a rake command. Some of these commands presuppose a local file exists on the appliance, such as when importing an Automate custom namespace. Extending ssh_client would be ideal.\n\nHere's my os.system hack:\n\n```\nimport os\n...\nos.system(\"sshpass -p '%s' scp %s@%s:/root/\" % \\\n            (mozwebqa.credentials['ssh']['password'],      \n             mozwebqa.credentials['ssh']['username'], \n             soap_client.evm_server_hostname))\n```\n\n", "before_files": [{"content": "import paramiko\n\nclass SSHClient(paramiko.SSHClient):\n    \"\"\"paramiko.SSHClient wrapper\n\n    Allows copying/overriding and use as a context manager\n    Constructor kwargs are handed directly to paramiko.SSHClient.connect()\n    \"\"\"\n    def __init__(self, **connect_kwargs):\n        super(SSHClient, self).__init__()\n        self.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n\n        # Set up some sane defaults\n        if 'timeout' not in connect_kwargs:\n            connect_kwargs['timeout'] = 10\n        if 'allow_agent' not in connect_kwargs:\n            connect_kwargs['allow_agent'] = False\n        self._connect_kwargs = connect_kwargs\n\n    def __call__(self, **connect_kwargs):\n        # Update a copy of this instance's connect kwargs with passed in kwargs,\n        # then return a new instance with the updated kwargs\n        new_connect_kwargs = dict(self._connect_kwargs)\n        new_connect_kwargs.update(connect_kwargs)\n        new_client = SSHClient(**new_connect_kwargs)\n        return new_client\n\n    def __enter__(self):\n        self.connect(**self._connect_kwargs)\n        return self\n\n    def __exit__(self, *args, **kwargs):\n        self.close()\n\n    def run_command(self, command):\n        return command_runner(self, command)\n\n    def run_rails_command(self, command):\n        return rails_runner(self, command)\n\n    def run_rake_command(self, command):\n        return rake_runner(self, command)\n\n\ndef command_runner(client, command):\n    template = '%s\\n'\n    command = template % command\n    with client as ctx:\n        transport = ctx.get_transport()\n        session = transport.open_session()\n        session.set_combine_stderr(True)\n        session.exec_command(command)\n        exit_status = session.recv_exit_status()\n        output = session.recv(-1)\n        return exit_status, output\n\n    # Returning two things so tuple unpacking the return works even if the ssh client fails\n    return None, None\n\ndef rails_runner(client, command):\n    template = '/var/www/miq/vmdb/script/rails runner %s'\n    return command_runner(client, template % command)\n\ndef rake_runner(client, command):\n    template = '/var/www/miq/vmdb/script/rake -f /var/www/miq/vmdb/Rakefile %s'\n    return rails_runner(client, template % command)\n\n", "path": "utils/ssh.py"}]}