prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  consolidation: add simplemodls to __all__
  # Description
  
  It would be nice if the snippet in the README could be shorter:
  
  right now this is needed
  ```
  import pyhf
  import pyhf.simplemodels
  pdf = pyhf.simplemodels.hepdata_like(signal_data=[12.0], bkg_data=[50.0], bkg_uncerts=[3.0])
  CLs_obs = pyhf.utils.hypotest(1.0, [51] + pdf.config.auxdata, pdf)
  ```
  
  whereas if we pre-import `simplemodels` it could be 
  ```
  import pyhf
  pdf = pyhf.simplemodels.hepdata_like(signal_data=[12.0], bkg_data=[50.0], bkg_uncerts=[3.0])
  CLs_obs = pyhf.utils.hypotest(1.0, [51] + pdf.config.auxdata, pdf)
  ```
  
  since `simplemodels.py` doesn't add much code, i don't think it would slow down things a lot
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pyhf/__init__.py`
  Content:
  ```
  1 from .tensor import BackendRetriever as tensor
  2 from .optimize import OptimizerRetriever as optimize
  3 from .version import __version__
  4 from . import events
  5 
  6 tensorlib = tensor.numpy_backend()
  7 default_backend = tensorlib
  8 optimizer = optimize.scipy_optimizer()
  9 default_optimizer = optimizer
  10 
  11 
  12 def get_backend():
  13     """
  14     Get the current backend and the associated optimizer
  15 
  16     Example:
  17         >>> import pyhf
  18         >>> pyhf.get_backend()
  19         (<pyhf.tensor.numpy_backend.numpy_backend object at 0x...>, <pyhf.optimize.opt_scipy.scipy_optimizer object at 0x...>)
  20 
  21     Returns:
  22         backend, optimizer
  23     """
  24     global tensorlib
  25     global optimizer
  26     return tensorlib, optimizer
  27 
  28 
  29 @events.register('change_backend')
  30 def set_backend(backend, custom_optimizer=None):
  31     """
  32     Set the backend and the associated optimizer
  33 
  34     Example:
  35         >>> import pyhf
  36         >>> import tensorflow as tf
  37         >>> pyhf.set_backend(pyhf.tensor.tensorflow_backend(session=tf.Session()))
  38 
  39     Args:
  40         backend: One of the supported pyhf backends: NumPy,
  41                  TensorFlow, PyTorch, and MXNet
  42 
  43     Returns:
  44         None
  45     """
  46     global tensorlib
  47     global optimizer
  48 
  49     # need to determine if the tensorlib changed or the optimizer changed for events
  50     tensorlib_changed = bool(backend.name != tensorlib.name)
  51     optimizer_changed = False
  52 
  53     if backend.name == 'tensorflow':
  54         new_optimizer = (
  55             custom_optimizer if custom_optimizer else optimize.tflow_optimizer(backend)
  56         )
  57         if tensorlib.name == 'tensorflow':
  58             tensorlib_changed |= bool(backend.session != tensorlib.session)
  59     elif backend.name == 'pytorch':
  60         new_optimizer = (
  61             custom_optimizer
  62             if custom_optimizer
  63             else optimize.pytorch_optimizer(tensorlib=backend)
  64         )
  65     # TODO: Add support for mxnet_optimizer()
  66     # elif tensorlib.name == 'mxnet':
  67     #     new_optimizer = custom_optimizer if custom_optimizer else mxnet_optimizer()
  68     else:
  69         new_optimizer = (
  70             custom_optimizer if custom_optimizer else optimize.scipy_optimizer()
  71         )
  72 
  73     optimizer_changed = bool(optimizer != new_optimizer)
  74     # set new backend
  75     tensorlib = backend
  76     optimizer = new_optimizer
  77     # trigger events
  78     if tensorlib_changed:
  79         events.trigger("tensorlib_changed")()
  80     if optimizer_changed:
  81         events.trigger("optimizer_changed")()
  82 
  83 
  84 from .pdf import Model
  85 
  86 __all__ = ['Model', 'utils', 'modifiers', '__version__']
  87
  ```
  --- 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/pyhf/__init__.py b/pyhf/__init__.py
  --- a/pyhf/__init__.py
  +++ b/pyhf/__init__.py
  @@ -82,5 +82,6 @@
   
   
   from .pdf import Model
  +from . import simplemodels
   
  -__all__ = ['Model', 'utils', 'modifiers', '__version__']
  +__all__ = ['Model', 'utils', 'modifiers', 'simplemodels', '__version__']
  
verification_info: {"golden_diff": "diff --git a/pyhf/__init__.py b/pyhf/__init__.py\n--- a/pyhf/__init__.py\n+++ b/pyhf/__init__.py\n@@ -82,5 +82,6 @@\n \n \n from .pdf import Model\n+from . import simplemodels\n \n-__all__ = ['Model', 'utils', 'modifiers', '__version__']\n+__all__ = ['Model', 'utils', 'modifiers', 'simplemodels', '__version__']\n", "issue": "consolidation: add simplemodls to __all__\n# Description\r\n\r\nIt would be nice if the snippet in the README could be shorter:\r\n\r\nright now this is needed\r\n```\r\nimport pyhf\r\nimport pyhf.simplemodels\r\npdf = pyhf.simplemodels.hepdata_like(signal_data=[12.0], bkg_data=[50.0], bkg_uncerts=[3.0])\r\nCLs_obs = pyhf.utils.hypotest(1.0, [51] + pdf.config.auxdata, pdf)\r\n```\r\n\r\nwhereas if we pre-import `simplemodels` it could be \r\n```\r\nimport pyhf\r\npdf = pyhf.simplemodels.hepdata_like(signal_data=[12.0], bkg_data=[50.0], bkg_uncerts=[3.0])\r\nCLs_obs = pyhf.utils.hypotest(1.0, [51] + pdf.config.auxdata, pdf)\r\n```\r\n\r\nsince `simplemodels.py` doesn't add much code, i don't think it would slow down things a lot\n", "before_files": [{"content": "from .tensor import BackendRetriever as tensor\nfrom .optimize import OptimizerRetriever as optimize\nfrom .version import __version__\nfrom . import events\n\ntensorlib = tensor.numpy_backend()\ndefault_backend = tensorlib\noptimizer = optimize.scipy_optimizer()\ndefault_optimizer = optimizer\n\n\ndef get_backend():\n    \"\"\"\n    Get the current backend and the associated optimizer\n\n    Example:\n        >>> import pyhf\n        >>> pyhf.get_backend()\n        (<pyhf.tensor.numpy_backend.numpy_backend object at 0x...>, <pyhf.optimize.opt_scipy.scipy_optimizer object at 0x...>)\n\n    Returns:\n        backend, optimizer\n    \"\"\"\n    global tensorlib\n    global optimizer\n    return tensorlib, optimizer\n\n\n@events.register('change_backend')\ndef set_backend(backend, custom_optimizer=None):\n    \"\"\"\n    Set the backend and the associated optimizer\n\n    Example:\n        >>> import pyhf\n        >>> import tensorflow as tf\n        >>> pyhf.set_backend(pyhf.tensor.tensorflow_backend(session=tf.Session()))\n\n    Args:\n        backend: One of the supported pyhf backends: NumPy,\n                 TensorFlow, PyTorch, and MXNet\n\n    Returns:\n        None\n    \"\"\"\n    global tensorlib\n    global optimizer\n\n    # need to determine if the tensorlib changed or the optimizer changed for events\n    tensorlib_changed = bool(backend.name != tensorlib.name)\n    optimizer_changed = False\n\n    if backend.name == 'tensorflow':\n        new_optimizer = (\n            custom_optimizer if custom_optimizer else optimize.tflow_optimizer(backend)\n        )\n        if tensorlib.name == 'tensorflow':\n            tensorlib_changed |= bool(backend.session != tensorlib.session)\n    elif backend.name == 'pytorch':\n        new_optimizer = (\n            custom_optimizer\n            if custom_optimizer\n            else optimize.pytorch_optimizer(tensorlib=backend)\n        )\n    # TODO: Add support for mxnet_optimizer()\n    # elif tensorlib.name == 'mxnet':\n    #     new_optimizer = custom_optimizer if custom_optimizer else mxnet_optimizer()\n    else:\n        new_optimizer = (\n            custom_optimizer if custom_optimizer else optimize.scipy_optimizer()\n        )\n\n    optimizer_changed = bool(optimizer != new_optimizer)\n    # set new backend\n    tensorlib = backend\n    optimizer = new_optimizer\n    # trigger events\n    if tensorlib_changed:\n        events.trigger(\"tensorlib_changed\")()\n    if optimizer_changed:\n        events.trigger(\"optimizer_changed\")()\n\n\nfrom .pdf import Model\n\n__all__ = ['Model', 'utils', 'modifiers', '__version__']\n", "path": "pyhf/__init__.py"}], "after_files": [{"content": "from .tensor import BackendRetriever as tensor\nfrom .optimize import OptimizerRetriever as optimize\nfrom .version import __version__\nfrom . import events\n\ntensorlib = tensor.numpy_backend()\ndefault_backend = tensorlib\noptimizer = optimize.scipy_optimizer()\ndefault_optimizer = optimizer\n\n\ndef get_backend():\n    \"\"\"\n    Get the current backend and the associated optimizer\n\n    Example:\n        >>> import pyhf\n        >>> pyhf.get_backend()\n        (<pyhf.tensor.numpy_backend.numpy_backend object at 0x...>, <pyhf.optimize.opt_scipy.scipy_optimizer object at 0x...>)\n\n    Returns:\n        backend, optimizer\n    \"\"\"\n    global tensorlib\n    global optimizer\n    return tensorlib, optimizer\n\n\n@events.register('change_backend')\ndef set_backend(backend, custom_optimizer=None):\n    \"\"\"\n    Set the backend and the associated optimizer\n\n    Example:\n        >>> import pyhf\n        >>> import tensorflow as tf\n        >>> pyhf.set_backend(pyhf.tensor.tensorflow_backend(session=tf.Session()))\n\n    Args:\n        backend: One of the supported pyhf backends: NumPy,\n                 TensorFlow, PyTorch, and MXNet\n\n    Returns:\n        None\n    \"\"\"\n    global tensorlib\n    global optimizer\n\n    # need to determine if the tensorlib changed or the optimizer changed for events\n    tensorlib_changed = bool(backend.name != tensorlib.name)\n    optimizer_changed = False\n\n    if backend.name == 'tensorflow':\n        new_optimizer = (\n            custom_optimizer if custom_optimizer else optimize.tflow_optimizer(backend)\n        )\n        if tensorlib.name == 'tensorflow':\n            tensorlib_changed |= bool(backend.session != tensorlib.session)\n    elif backend.name == 'pytorch':\n        new_optimizer = (\n            custom_optimizer\n            if custom_optimizer\n            else optimize.pytorch_optimizer(tensorlib=backend)\n        )\n    # TODO: Add support for mxnet_optimizer()\n    # elif tensorlib.name == 'mxnet':\n    #     new_optimizer = custom_optimizer if custom_optimizer else mxnet_optimizer()\n    else:\n        new_optimizer = (\n            custom_optimizer if custom_optimizer else optimize.scipy_optimizer()\n        )\n\n    optimizer_changed = bool(optimizer != new_optimizer)\n    # set new backend\n    tensorlib = backend\n    optimizer = new_optimizer\n    # trigger events\n    if tensorlib_changed:\n        events.trigger(\"tensorlib_changed\")()\n    if optimizer_changed:\n        events.trigger(\"optimizer_changed\")()\n\n\nfrom .pdf import Model\nfrom . import simplemodels\n\n__all__ = ['Model', 'utils', 'modifiers', 'simplemodels', '__version__']\n", "path": "pyhf/__init__.py"}]}