prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  SyntaxWarning in pwnlib.util.web
  This line generates a `SyntaxWarning`: https://github.com/Gallopsled/pwntools/blob/master/pwnlib/util/web.py#L27
  
  Either we should use qualified names or only import the names that we need.  My votes goes toward the former.
  
  SyntaxWarning in pwnlib.util.web
  This line generates a `SyntaxWarning`: https://github.com/Gallopsled/pwntools/blob/master/pwnlib/util/web.py#L27
  
  Either we should use qualified names or only import the names that we need.  My votes goes toward the former.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pwnlib/util/web.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 import os, tempfile, logging
  3 from .misc import size
  4 log = logging.getLogger(__name__)
  5 
  6 def wget(url, save=None, timeout=5, **kwargs):
  7     """wget(url, save=None, timeout=5) -> str
  8 
  9     Downloads a file via HTTP/HTTPS.
  10 
  11     Args:
  12       url (str): URL to download
  13       save (str or bool): Name to save as.  Any truthy value
  14             will auto-generate a name based on the URL.
  15       timeout (int): Timeout, in seconds
  16 
  17     Example:
  18 
  19       >>> url    = 'http://httpbin.org/robots.txt'
  20       >>> with context.local(log_level='ERROR'): result = wget(url)
  21       >>> result
  22       'User-agent: *\nDisallow: /deny\n'
  23       >>> with context.local(log_level='ERROR'): wget(url, True)
  24       >>> result == file('robots.txt').read()
  25       True
  26     """
  27     from requests import *
  28 
  29     with log.progress("Downloading '%s'" % url) as w:
  30         w.status("Making request...")
  31 
  32         response = get(url, stream=True, **kwargs)
  33 
  34         if not response.ok:
  35             w.failure("Got code %s" % response.status_code)
  36             return
  37 
  38         total_size = int(response.headers.get('content-length',0))
  39 
  40         w.status('0 / %s' % size(total_size))
  41 
  42         # Find out the next largest size we can represent as
  43         chunk_size = 1
  44         while chunk_size < (total_size/10):
  45             chunk_size *= 1000
  46 
  47         # Count chunks as they're received
  48         total_data    = ''
  49 
  50         # Loop until we have all of the data
  51         for chunk in response.iter_content(chunk_size = 2**10):
  52             total_data    += chunk
  53             if total_size:
  54                 w.status('%s / %s' % (size(total_data), size(total_size)))
  55             else:
  56                 w.status('%s' % size(total_data))
  57 
  58         # Save to the target file if provided
  59         if save:
  60             if not isinstance(save, (str, unicode)):
  61                 save = os.path.basename(url)
  62                 save = save or tempfile.NamedTemporaryFile(dir='.', delete=False).name
  63             with file(save,'wb+') as f:
  64                 f.write(total_data)
  65                 w.success('Saved %r (%s)' % (f.name, size(total_data)))
  66         else:
  67             w.success('%s' % size(total_data))
  68 
  69         return total_data
  70 
  71
  ```
  --- 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/pwnlib/util/web.py b/pwnlib/util/web.py
  --- a/pwnlib/util/web.py
  +++ b/pwnlib/util/web.py
  @@ -24,12 +24,12 @@
         >>> result == file('robots.txt').read()
         True
       """
  -    from requests import *
  +    import requests
   
       with log.progress("Downloading '%s'" % url) as w:
           w.status("Making request...")
   
  -        response = get(url, stream=True, **kwargs)
  +        response = requests.get(url, stream=True, **kwargs)
   
           if not response.ok:
               w.failure("Got code %s" % response.status_code)
  
verification_info: {"golden_diff": "diff --git a/pwnlib/util/web.py b/pwnlib/util/web.py\n--- a/pwnlib/util/web.py\n+++ b/pwnlib/util/web.py\n@@ -24,12 +24,12 @@\n       >>> result == file('robots.txt').read()\n       True\n     \"\"\"\n-    from requests import *\n+    import requests\n \n     with log.progress(\"Downloading '%s'\" % url) as w:\n         w.status(\"Making request...\")\n \n-        response = get(url, stream=True, **kwargs)\n+        response = requests.get(url, stream=True, **kwargs)\n \n         if not response.ok:\n             w.failure(\"Got code %s\" % response.status_code)\n", "issue": "SyntaxWarning in pwnlib.util.web\nThis line generates a `SyntaxWarning`: https://github.com/Gallopsled/pwntools/blob/master/pwnlib/util/web.py#L27\n\nEither we should use qualified names or only import the names that we need.  My votes goes toward the former.\n\nSyntaxWarning in pwnlib.util.web\nThis line generates a `SyntaxWarning`: https://github.com/Gallopsled/pwntools/blob/master/pwnlib/util/web.py#L27\n\nEither we should use qualified names or only import the names that we need.  My votes goes toward the former.\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport os, tempfile, logging\nfrom .misc import size\nlog = logging.getLogger(__name__)\n\ndef wget(url, save=None, timeout=5, **kwargs):\n    \"\"\"wget(url, save=None, timeout=5) -> str\n\n    Downloads a file via HTTP/HTTPS.\n\n    Args:\n      url (str): URL to download\n      save (str or bool): Name to save as.  Any truthy value\n            will auto-generate a name based on the URL.\n      timeout (int): Timeout, in seconds\n\n    Example:\n\n      >>> url    = 'http://httpbin.org/robots.txt'\n      >>> with context.local(log_level='ERROR'): result = wget(url)\n      >>> result\n      'User-agent: *\\nDisallow: /deny\\n'\n      >>> with context.local(log_level='ERROR'): wget(url, True)\n      >>> result == file('robots.txt').read()\n      True\n    \"\"\"\n    from requests import *\n\n    with log.progress(\"Downloading '%s'\" % url) as w:\n        w.status(\"Making request...\")\n\n        response = get(url, stream=True, **kwargs)\n\n        if not response.ok:\n            w.failure(\"Got code %s\" % response.status_code)\n            return\n\n        total_size = int(response.headers.get('content-length',0))\n\n        w.status('0 / %s' % size(total_size))\n\n        # Find out the next largest size we can represent as\n        chunk_size = 1\n        while chunk_size < (total_size/10):\n            chunk_size *= 1000\n\n        # Count chunks as they're received\n        total_data    = ''\n\n        # Loop until we have all of the data\n        for chunk in response.iter_content(chunk_size = 2**10):\n            total_data    += chunk\n            if total_size:\n                w.status('%s / %s' % (size(total_data), size(total_size)))\n            else:\n                w.status('%s' % size(total_data))\n\n        # Save to the target file if provided\n        if save:\n            if not isinstance(save, (str, unicode)):\n                save = os.path.basename(url)\n                save = save or tempfile.NamedTemporaryFile(dir='.', delete=False).name\n            with file(save,'wb+') as f:\n                f.write(total_data)\n                w.success('Saved %r (%s)' % (f.name, size(total_data)))\n        else:\n            w.success('%s' % size(total_data))\n\n        return total_data\n\n", "path": "pwnlib/util/web.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nimport os, tempfile, logging\nfrom .misc import size\nlog = logging.getLogger(__name__)\n\ndef wget(url, save=None, timeout=5, **kwargs):\n    \"\"\"wget(url, save=None, timeout=5) -> str\n\n    Downloads a file via HTTP/HTTPS.\n\n    Args:\n      url (str): URL to download\n      save (str or bool): Name to save as.  Any truthy value\n            will auto-generate a name based on the URL.\n      timeout (int): Timeout, in seconds\n\n    Example:\n\n      >>> url    = 'http://httpbin.org/robots.txt'\n      >>> with context.local(log_level='ERROR'): result = wget(url)\n      >>> result\n      'User-agent: *\\nDisallow: /deny\\n'\n      >>> with context.local(log_level='ERROR'): wget(url, True)\n      >>> result == file('robots.txt').read()\n      True\n    \"\"\"\n    import requests\n\n    with log.progress(\"Downloading '%s'\" % url) as w:\n        w.status(\"Making request...\")\n\n        response = requests.get(url, stream=True, **kwargs)\n\n        if not response.ok:\n            w.failure(\"Got code %s\" % response.status_code)\n            return\n\n        total_size = int(response.headers.get('content-length',0))\n\n        w.status('0 / %s' % size(total_size))\n\n        # Find out the next largest size we can represent as\n        chunk_size = 1\n        while chunk_size < (total_size/10):\n            chunk_size *= 1000\n\n        # Count chunks as they're received\n        total_data    = ''\n\n        # Loop until we have all of the data\n        for chunk in response.iter_content(chunk_size = 2**10):\n            total_data    += chunk\n            if total_size:\n                w.status('%s / %s' % (size(total_data), size(total_size)))\n            else:\n                w.status('%s' % size(total_data))\n\n        # Save to the target file if provided\n        if save:\n            if not isinstance(save, (str, unicode)):\n                save = os.path.basename(url)\n                save = save or tempfile.NamedTemporaryFile(dir='.', delete=False).name\n            with file(save,'wb+') as f:\n                f.write(total_data)\n                w.success('Saved %r (%s)' % (f.name, size(total_data)))\n        else:\n            w.success('%s' % size(total_data))\n\n        return total_data\n\n", "path": "pwnlib/util/web.py"}]}