prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  web._generate_url returns ValueError--> intentional?
  ```
              return ValueError('Input not understood')
  ```
  seems like it should be `raise` instead of `return`.  Am I missing something?
  
  </issue>
  <code>
  [start of statsmodels/tools/web.py]
  1 """
  2 Provides a function to open the system browser to either search or go directly
  3 to a function's reference
  4 """
  5 import webbrowser
  6 
  7 from statsmodels.compat.python import urlencode
  8 from statsmodels import __version__
  9 
  10 BASE_URL = 'https://www.statsmodels.org/'
  11 
  12 
  13 def _generate_url(arg, stable):
  14     """
  15     Parse inputs and return a correctly formatted URL or an error if the input
  16     is not understandable
  17     """
  18     url = BASE_URL
  19     if stable:
  20         url += 'stable/'
  21     else:
  22         url += 'devel/'
  23 
  24     if arg is None:
  25         return url
  26     elif type(arg) is str:
  27         url += 'search.html?'
  28         url += urlencode({'q': arg})
  29         url += '&check_keywords=yes&area=default'
  30     else:
  31         try:
  32             func = arg
  33             func_name = func.__name__
  34             func_module = func.__module__
  35             if not func_module.startswith('statsmodels.'):
  36                 return ValueError('Function must be from statsmodels')
  37             url += 'generated/'
  38             url += func_module + '.' + func_name + '.html'
  39         except:
  40             return ValueError('Input not understood')
  41     return url
  42 
  43 
  44 def webdoc(arg=None, stable=None):
  45     """
  46     Opens a browser and displays online documentation
  47 
  48     Parameters
  49     ----------
  50     arg, optional : string or statsmodels function
  51         Either a string to search the documentation or a function
  52     stable, optional : bool
  53         Flag indicating whether to use the stable documentation (True) or
  54         the development documentation (False).  If not provided, opens
  55         the stable documentation if the current version of statsmodels is a
  56         release
  57 
  58     Examples
  59     --------
  60     >>> import statsmodels.api as sm
  61     >>> sm.webdoc()  # Documention site
  62     >>> sm.webdoc('glm')  # Search for glm in docs
  63     >>> sm.webdoc(sm.OLS, stable=False)  # Go to generated help for OLS, devel
  64 
  65     Notes
  66     -----
  67     By default, open stable documentation if the current version of statsmodels
  68     is a release.  Otherwise opens the development documentation.
  69 
  70     Uses the default system browser.
  71     """
  72     stable = __version__ if 'dev' not in __version__ else stable
  73     url_or_error = _generate_url(arg, stable)
  74     if isinstance(url_or_error, ValueError):
  75         raise url_or_error
  76     webbrowser.open(url_or_error)
  77     return None
  78
  [end of statsmodels/tools/web.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/statsmodels/tools/web.py b/statsmodels/tools/web.py
  --- a/statsmodels/tools/web.py
  +++ b/statsmodels/tools/web.py
  @@ -4,7 +4,7 @@
   """
   import webbrowser
   
  -from statsmodels.compat.python import urlencode
  +from statsmodels.compat.python import urlencode, string_types
   from statsmodels import __version__
   
   BASE_URL = 'https://www.statsmodels.org/'
  @@ -12,8 +12,8 @@
   
   def _generate_url(arg, stable):
       """
  -    Parse inputs and return a correctly formatted URL or an error if the input
  -    is not understandable
  +    Parse inputs and return a correctly formatted URL or raises ValueError
  +    if the input is not understandable
       """
       url = BASE_URL
       if stable:
  @@ -23,7 +23,7 @@
   
       if arg is None:
           return url
  -    elif type(arg) is str:
  +    elif isinstance(arg, string_types):
           url += 'search.html?'
           url += urlencode({'q': arg})
           url += '&check_keywords=yes&area=default'
  @@ -33,11 +33,11 @@
               func_name = func.__name__
               func_module = func.__module__
               if not func_module.startswith('statsmodels.'):
  -                return ValueError('Function must be from statsmodels')
  +                raise ValueError('Function must be from statsmodels')
               url += 'generated/'
               url += func_module + '.' + func_name + '.html'
  -        except:
  -            return ValueError('Input not understood')
  +        except AttributeError:
  +            raise ValueError('Input not understood')
       return url
   
   
  @@ -71,7 +71,5 @@
       """
       stable = __version__ if 'dev' not in __version__ else stable
       url_or_error = _generate_url(arg, stable)
  -    if isinstance(url_or_error, ValueError):
  -        raise url_or_error
       webbrowser.open(url_or_error)
       return None
  
verification_info: {"golden_diff": "diff --git a/statsmodels/tools/web.py b/statsmodels/tools/web.py\n--- a/statsmodels/tools/web.py\n+++ b/statsmodels/tools/web.py\n@@ -4,7 +4,7 @@\n \"\"\"\n import webbrowser\n \n-from statsmodels.compat.python import urlencode\n+from statsmodels.compat.python import urlencode, string_types\n from statsmodels import __version__\n \n BASE_URL = 'https://www.statsmodels.org/'\n@@ -12,8 +12,8 @@\n \n def _generate_url(arg, stable):\n     \"\"\"\n-    Parse inputs and return a correctly formatted URL or an error if the input\n-    is not understandable\n+    Parse inputs and return a correctly formatted URL or raises ValueError\n+    if the input is not understandable\n     \"\"\"\n     url = BASE_URL\n     if stable:\n@@ -23,7 +23,7 @@\n \n     if arg is None:\n         return url\n-    elif type(arg) is str:\n+    elif isinstance(arg, string_types):\n         url += 'search.html?'\n         url += urlencode({'q': arg})\n         url += '&check_keywords=yes&area=default'\n@@ -33,11 +33,11 @@\n             func_name = func.__name__\n             func_module = func.__module__\n             if not func_module.startswith('statsmodels.'):\n-                return ValueError('Function must be from statsmodels')\n+                raise ValueError('Function must be from statsmodels')\n             url += 'generated/'\n             url += func_module + '.' + func_name + '.html'\n-        except:\n-            return ValueError('Input not understood')\n+        except AttributeError:\n+            raise ValueError('Input not understood')\n     return url\n \n \n@@ -71,7 +71,5 @@\n     \"\"\"\n     stable = __version__ if 'dev' not in __version__ else stable\n     url_or_error = _generate_url(arg, stable)\n-    if isinstance(url_or_error, ValueError):\n-        raise url_or_error\n     webbrowser.open(url_or_error)\n     return None\n", "issue": "web._generate_url returns ValueError--> intentional?\n```\r\n            return ValueError('Input not understood')\r\n```\r\nseems like it should be `raise` instead of `return`.  Am I missing something?\n", "before_files": [{"content": "\"\"\"\nProvides a function to open the system browser to either search or go directly\nto a function's reference\n\"\"\"\nimport webbrowser\n\nfrom statsmodels.compat.python import urlencode\nfrom statsmodels import __version__\n\nBASE_URL = 'https://www.statsmodels.org/'\n\n\ndef _generate_url(arg, stable):\n    \"\"\"\n    Parse inputs and return a correctly formatted URL or an error if the input\n    is not understandable\n    \"\"\"\n    url = BASE_URL\n    if stable:\n        url += 'stable/'\n    else:\n        url += 'devel/'\n\n    if arg is None:\n        return url\n    elif type(arg) is str:\n        url += 'search.html?'\n        url += urlencode({'q': arg})\n        url += '&check_keywords=yes&area=default'\n    else:\n        try:\n            func = arg\n            func_name = func.__name__\n            func_module = func.__module__\n            if not func_module.startswith('statsmodels.'):\n                return ValueError('Function must be from statsmodels')\n            url += 'generated/'\n            url += func_module + '.' + func_name + '.html'\n        except:\n            return ValueError('Input not understood')\n    return url\n\n\ndef webdoc(arg=None, stable=None):\n    \"\"\"\n    Opens a browser and displays online documentation\n\n    Parameters\n    ----------\n    arg, optional : string or statsmodels function\n        Either a string to search the documentation or a function\n    stable, optional : bool\n        Flag indicating whether to use the stable documentation (True) or\n        the development documentation (False).  If not provided, opens\n        the stable documentation if the current version of statsmodels is a\n        release\n\n    Examples\n    --------\n    >>> import statsmodels.api as sm\n    >>> sm.webdoc()  # Documention site\n    >>> sm.webdoc('glm')  # Search for glm in docs\n    >>> sm.webdoc(sm.OLS, stable=False)  # Go to generated help for OLS, devel\n\n    Notes\n    -----\n    By default, open stable documentation if the current version of statsmodels\n    is a release.  Otherwise opens the development documentation.\n\n    Uses the default system browser.\n    \"\"\"\n    stable = __version__ if 'dev' not in __version__ else stable\n    url_or_error = _generate_url(arg, stable)\n    if isinstance(url_or_error, ValueError):\n        raise url_or_error\n    webbrowser.open(url_or_error)\n    return None\n", "path": "statsmodels/tools/web.py"}]}