prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  use short URL for better help message
  The current help msg has a long url, but this includes line breaks
  which makes it hard to copy. 
  
  ```
  pyhf cls --help 
  Usage: pyhf cls [OPTIONS] [WORKSPACE]
  
    Compute CLs value(s) for a given pyhf workspace.
  
    Example:
  
    .. code-block:: shell
  
        $ curl -sL https://raw.githubusercontent.com/scikit-
        hep/pyhf/master/docs/examples/json/2-bin_1-channel.json | pyhf cls
        {         "CLs_exp": [             0.07807427911686156,
        0.17472571775474618,             0.35998495263681285,
        0.6343568235898907,             0.8809947004472013         ],
        "CLs_obs": 0.3599845631401915     }
  
  Options:
    --output-file TEXT              The location of the output json file. If not
                                    specified, prints to screen.
  
    --measurement TEXT
    -p, --patch TEXT
    --testpoi FLOAT
    --teststat [q|qtilde]
    --backend [numpy|pytorch|tensorflow|jax|np|torch|tf]
                                    The tensor backend used for the calculation.
    --optimizer TEXT
    --optconf EQUAL-DELIMITED OPTION
    -h, --help                      Show this message and exit.
  
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/pyhf/cli/infer.py`
  Content:
  ```
  1 """The inference CLI group."""
  2 import logging
  3 
  4 import click
  5 import json
  6 
  7 from ..utils import EqDelimStringParamType
  8 from ..infer import hypotest
  9 from ..workspace import Workspace
  10 from .. import tensor, get_backend, set_backend, optimize
  11 
  12 log = logging.getLogger(__name__)
  13 
  14 
  15 @click.group(name='infer')
  16 def cli():
  17     """Infererence CLI group."""
  18 
  19 
  20 @cli.command()
  21 @click.argument('workspace', default='-')
  22 @click.option(
  23     '--output-file',
  24     help='The location of the output json file. If not specified, prints to screen.',
  25     default=None,
  26 )
  27 @click.option('--measurement', default=None)
  28 @click.option('-p', '--patch', multiple=True)
  29 @click.option('--testpoi', default=1.0)
  30 @click.option('--teststat', type=click.Choice(['q', 'qtilde']), default='qtilde')
  31 @click.option(
  32     '--backend',
  33     type=click.Choice(['numpy', 'pytorch', 'tensorflow', 'jax', 'np', 'torch', 'tf']),
  34     help='The tensor backend used for the calculation.',
  35     default='numpy',
  36 )
  37 @click.option('--optimizer')
  38 @click.option('--optconf', type=EqDelimStringParamType(), multiple=True)
  39 def cls(
  40     workspace,
  41     output_file,
  42     measurement,
  43     patch,
  44     testpoi,
  45     teststat,
  46     backend,
  47     optimizer,
  48     optconf,
  49 ):
  50     """
  51     Compute CLs value(s) for a given pyhf workspace.
  52 
  53     Example:
  54 
  55     .. code-block:: shell
  56 
  57         $ curl -sL https://raw.githubusercontent.com/scikit-hep/pyhf/master/docs/examples/json/2-bin_1-channel.json | pyhf cls
  58         {
  59             "CLs_exp": [
  60                 0.07807427911686156,
  61                 0.17472571775474618,
  62                 0.35998495263681285,
  63                 0.6343568235898907,
  64                 0.8809947004472013
  65             ],
  66             "CLs_obs": 0.3599845631401915
  67         }
  68     """
  69     with click.open_file(workspace, 'r') as specstream:
  70         spec = json.load(specstream)
  71 
  72     ws = Workspace(spec)
  73 
  74     is_qtilde = teststat == 'qtilde'
  75 
  76     patches = [json.loads(click.open_file(pfile, 'r').read()) for pfile in patch]
  77     model = ws.model(
  78         measurement_name=measurement,
  79         patches=patches,
  80         modifier_settings={
  81             'normsys': {'interpcode': 'code4'},
  82             'histosys': {'interpcode': 'code4p'},
  83         },
  84     )
  85 
  86     # set the backend if not NumPy
  87     if backend in ['pytorch', 'torch']:
  88         set_backend(tensor.pytorch_backend(precision='64b'))
  89     elif backend in ['tensorflow', 'tf']:
  90         set_backend(tensor.tensorflow_backend(precision='64b'))
  91     elif backend in ['jax']:
  92         set_backend(tensor.jax_backend())
  93     tensorlib, _ = get_backend()
  94 
  95     optconf = {k: v for item in optconf for k, v in item.items()}
  96 
  97     # set the new optimizer
  98     if optimizer:
  99         new_optimizer = getattr(optimize, optimizer)
  100         set_backend(tensorlib, new_optimizer(**optconf))
  101 
  102     result = hypotest(
  103         testpoi, ws.data(model), model, qtilde=is_qtilde, return_expected_set=True
  104     )
  105     result = {
  106         'CLs_obs': tensorlib.tolist(result[0])[0],
  107         'CLs_exp': tensorlib.tolist(tensorlib.reshape(result[-1], [-1])),
  108     }
  109 
  110     if output_file is None:
  111         click.echo(json.dumps(result, indent=4, sort_keys=True))
  112     else:
  113         with open(output_file, 'w+') as out_file:
  114             json.dump(result, out_file, indent=4, sort_keys=True)
  115         log.debug("Written to {0:s}".format(output_file))
  116
  ```
  --- 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/src/pyhf/cli/infer.py b/src/pyhf/cli/infer.py
  --- a/src/pyhf/cli/infer.py
  +++ b/src/pyhf/cli/infer.py
  @@ -54,7 +54,9 @@
   
       .. code-block:: shell
   
  -        $ curl -sL https://raw.githubusercontent.com/scikit-hep/pyhf/master/docs/examples/json/2-bin_1-channel.json | pyhf cls
  +        $ curl -sL https://git.io/JJYDE | pyhf cls
  +
  +        \b
           {
               "CLs_exp": [
                   0.07807427911686156,
  
verification_info: {"golden_diff": "diff --git a/src/pyhf/cli/infer.py b/src/pyhf/cli/infer.py\n--- a/src/pyhf/cli/infer.py\n+++ b/src/pyhf/cli/infer.py\n@@ -54,7 +54,9 @@\n \n     .. code-block:: shell\n \n-        $ curl -sL https://raw.githubusercontent.com/scikit-hep/pyhf/master/docs/examples/json/2-bin_1-channel.json | pyhf cls\n+        $ curl -sL https://git.io/JJYDE | pyhf cls\n+\n+        \\b\n         {\n             \"CLs_exp\": [\n                 0.07807427911686156,\n", "issue": "use short URL for better help message\nThe current help msg has a long url, but this includes line breaks\r\nwhich makes it hard to copy. \r\n\r\n```\r\npyhf cls --help \r\nUsage: pyhf cls [OPTIONS] [WORKSPACE]\r\n\r\n  Compute CLs value(s) for a given pyhf workspace.\r\n\r\n  Example:\r\n\r\n  .. code-block:: shell\r\n\r\n      $ curl -sL https://raw.githubusercontent.com/scikit-\r\n      hep/pyhf/master/docs/examples/json/2-bin_1-channel.json | pyhf cls\r\n      {         \"CLs_exp\": [             0.07807427911686156,\r\n      0.17472571775474618,             0.35998495263681285,\r\n      0.6343568235898907,             0.8809947004472013         ],\r\n      \"CLs_obs\": 0.3599845631401915     }\r\n\r\nOptions:\r\n  --output-file TEXT              The location of the output json file. If not\r\n                                  specified, prints to screen.\r\n\r\n  --measurement TEXT\r\n  -p, --patch TEXT\r\n  --testpoi FLOAT\r\n  --teststat [q|qtilde]\r\n  --backend [numpy|pytorch|tensorflow|jax|np|torch|tf]\r\n                                  The tensor backend used for the calculation.\r\n  --optimizer TEXT\r\n  --optconf EQUAL-DELIMITED OPTION\r\n  -h, --help                      Show this message and exit.\r\n\r\n```\n", "before_files": [{"content": "\"\"\"The inference CLI group.\"\"\"\nimport logging\n\nimport click\nimport json\n\nfrom ..utils import EqDelimStringParamType\nfrom ..infer import hypotest\nfrom ..workspace import Workspace\nfrom .. import tensor, get_backend, set_backend, optimize\n\nlog = logging.getLogger(__name__)\n\n\n@click.group(name='infer')\ndef cli():\n    \"\"\"Infererence CLI group.\"\"\"\n\n\n@cli.command()\n@click.argument('workspace', default='-')\n@click.option(\n    '--output-file',\n    help='The location of the output json file. If not specified, prints to screen.',\n    default=None,\n)\n@click.option('--measurement', default=None)\n@click.option('-p', '--patch', multiple=True)\n@click.option('--testpoi', default=1.0)\n@click.option('--teststat', type=click.Choice(['q', 'qtilde']), default='qtilde')\n@click.option(\n    '--backend',\n    type=click.Choice(['numpy', 'pytorch', 'tensorflow', 'jax', 'np', 'torch', 'tf']),\n    help='The tensor backend used for the calculation.',\n    default='numpy',\n)\n@click.option('--optimizer')\n@click.option('--optconf', type=EqDelimStringParamType(), multiple=True)\ndef cls(\n    workspace,\n    output_file,\n    measurement,\n    patch,\n    testpoi,\n    teststat,\n    backend,\n    optimizer,\n    optconf,\n):\n    \"\"\"\n    Compute CLs value(s) for a given pyhf workspace.\n\n    Example:\n\n    .. code-block:: shell\n\n        $ curl -sL https://raw.githubusercontent.com/scikit-hep/pyhf/master/docs/examples/json/2-bin_1-channel.json | pyhf cls\n        {\n            \"CLs_exp\": [\n                0.07807427911686156,\n                0.17472571775474618,\n                0.35998495263681285,\n                0.6343568235898907,\n                0.8809947004472013\n            ],\n            \"CLs_obs\": 0.3599845631401915\n        }\n    \"\"\"\n    with click.open_file(workspace, 'r') as specstream:\n        spec = json.load(specstream)\n\n    ws = Workspace(spec)\n\n    is_qtilde = teststat == 'qtilde'\n\n    patches = [json.loads(click.open_file(pfile, 'r').read()) for pfile in patch]\n    model = ws.model(\n        measurement_name=measurement,\n        patches=patches,\n        modifier_settings={\n            'normsys': {'interpcode': 'code4'},\n            'histosys': {'interpcode': 'code4p'},\n        },\n    )\n\n    # set the backend if not NumPy\n    if backend in ['pytorch', 'torch']:\n        set_backend(tensor.pytorch_backend(precision='64b'))\n    elif backend in ['tensorflow', 'tf']:\n        set_backend(tensor.tensorflow_backend(precision='64b'))\n    elif backend in ['jax']:\n        set_backend(tensor.jax_backend())\n    tensorlib, _ = get_backend()\n\n    optconf = {k: v for item in optconf for k, v in item.items()}\n\n    # set the new optimizer\n    if optimizer:\n        new_optimizer = getattr(optimize, optimizer)\n        set_backend(tensorlib, new_optimizer(**optconf))\n\n    result = hypotest(\n        testpoi, ws.data(model), model, qtilde=is_qtilde, return_expected_set=True\n    )\n    result = {\n        'CLs_obs': tensorlib.tolist(result[0])[0],\n        'CLs_exp': tensorlib.tolist(tensorlib.reshape(result[-1], [-1])),\n    }\n\n    if output_file is None:\n        click.echo(json.dumps(result, indent=4, sort_keys=True))\n    else:\n        with open(output_file, 'w+') as out_file:\n            json.dump(result, out_file, indent=4, sort_keys=True)\n        log.debug(\"Written to {0:s}\".format(output_file))\n", "path": "src/pyhf/cli/infer.py"}], "after_files": [{"content": "\"\"\"The inference CLI group.\"\"\"\nimport logging\n\nimport click\nimport json\n\nfrom ..utils import EqDelimStringParamType\nfrom ..infer import hypotest\nfrom ..workspace import Workspace\nfrom .. import tensor, get_backend, set_backend, optimize\n\nlog = logging.getLogger(__name__)\n\n\n@click.group(name='infer')\ndef cli():\n    \"\"\"Infererence CLI group.\"\"\"\n\n\n@cli.command()\n@click.argument('workspace', default='-')\n@click.option(\n    '--output-file',\n    help='The location of the output json file. If not specified, prints to screen.',\n    default=None,\n)\n@click.option('--measurement', default=None)\n@click.option('-p', '--patch', multiple=True)\n@click.option('--testpoi', default=1.0)\n@click.option('--teststat', type=click.Choice(['q', 'qtilde']), default='qtilde')\n@click.option(\n    '--backend',\n    type=click.Choice(['numpy', 'pytorch', 'tensorflow', 'jax', 'np', 'torch', 'tf']),\n    help='The tensor backend used for the calculation.',\n    default='numpy',\n)\n@click.option('--optimizer')\n@click.option('--optconf', type=EqDelimStringParamType(), multiple=True)\ndef cls(\n    workspace,\n    output_file,\n    measurement,\n    patch,\n    testpoi,\n    teststat,\n    backend,\n    optimizer,\n    optconf,\n):\n    \"\"\"\n    Compute CLs value(s) for a given pyhf workspace.\n\n    Example:\n\n    .. code-block:: shell\n\n        $ curl -sL https://git.io/JJYDE | pyhf cls\n\n        \\b\n        {\n            \"CLs_exp\": [\n                0.07807427911686156,\n                0.17472571775474618,\n                0.35998495263681285,\n                0.6343568235898907,\n                0.8809947004472013\n            ],\n            \"CLs_obs\": 0.3599845631401915\n        }\n    \"\"\"\n    with click.open_file(workspace, 'r') as specstream:\n        spec = json.load(specstream)\n\n    ws = Workspace(spec)\n\n    is_qtilde = teststat == 'qtilde'\n\n    patches = [json.loads(click.open_file(pfile, 'r').read()) for pfile in patch]\n    model = ws.model(\n        measurement_name=measurement,\n        patches=patches,\n        modifier_settings={\n            'normsys': {'interpcode': 'code4'},\n            'histosys': {'interpcode': 'code4p'},\n        },\n    )\n\n    # set the backend if not NumPy\n    if backend in ['pytorch', 'torch']:\n        set_backend(tensor.pytorch_backend(precision='64b'))\n    elif backend in ['tensorflow', 'tf']:\n        set_backend(tensor.tensorflow_backend(precision='64b'))\n    elif backend in ['jax']:\n        set_backend(tensor.jax_backend())\n    tensorlib, _ = get_backend()\n\n    optconf = {k: v for item in optconf for k, v in item.items()}\n\n    # set the new optimizer\n    if optimizer:\n        new_optimizer = getattr(optimize, optimizer)\n        set_backend(tensorlib, new_optimizer(**optconf))\n\n    result = hypotest(\n        testpoi, ws.data(model), model, qtilde=is_qtilde, return_expected_set=True\n    )\n    result = {\n        'CLs_obs': tensorlib.tolist(result[0])[0],\n        'CLs_exp': tensorlib.tolist(tensorlib.reshape(result[-1], [-1])),\n    }\n\n    if output_file is None:\n        click.echo(json.dumps(result, indent=4, sort_keys=True))\n    else:\n        with open(output_file, 'w+') as out_file:\n            json.dump(result, out_file, indent=4, sort_keys=True)\n        log.debug(\"Written to {0:s}\".format(output_file))\n", "path": "src/pyhf/cli/infer.py"}]}