prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Use string form for type checking until Python 3.7 dropped
  What the if here? The string form is fine until you drop Pythons that don’t support it.
  
  _Originally posted by @henryiii in https://github.com/scikit-hep/pyhf/pull/1909#discussion_r944456765_
  
  This was in reference to 
  
  ```python
  if T.TYPE_CHECKING:
      PathOrStr = T.Union[str, os.PathLike[str]]
  else:
      PathOrStr = T.Union[str, "os.PathLike[str]"]
  ```
  
  in PR #190 now in 
  
  https://github.com/scikit-hep/pyhf/blob/ad1dd86f1d7c1bcbf737805b6821e07c4ef75fca/src/pyhf/typing.py#L30-L33
  
  So until Python 3.7 is dropped (I think this is the version I am not very up to date with my type checking knowledge) we could instead just drop the `if TYPE_CHECKING` and use
  
  ```python
  #TODO: Switch to os.PathLike[str] once Python 3.7 dropped
  PathOrStr = Union[str, "os.PathLike[str]"]
  ```
  
  This would also allow for reverting PR #1937.
  
  --- 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/typing.py`
  Content:
  ```
  1 import os
  2 import sys
  3 from typing import TYPE_CHECKING, MutableSequence, Sequence, Union
  4 
  5 if sys.version_info >= (3, 8):
  6     from typing import Literal, TypedDict
  7 else:
  8     from typing_extensions import Literal, TypedDict
  9 
  10 __all__ = (
  11     "PathOrStr",
  12     "ParameterBase",
  13     "Parameter",
  14     "Measurement",
  15     "ModifierBase",
  16     "NormSys",
  17     "NormFactor",
  18     "HistoSys",
  19     "StatError",
  20     "ShapeSys",
  21     "ShapeFactor",
  22     "LumiSys",
  23     "Modifier",
  24     "Sample",
  25     "Channel",
  26     "Observation",
  27     "Workspace",
  28 )
  29 
  30 if TYPE_CHECKING:
  31     PathOrStr = Union[str, os.PathLike[str]]
  32 else:
  33     PathOrStr = Union[str, "os.PathLike[str]"]
  34 
  35 
  36 class ParameterBase(TypedDict, total=False):
  37     auxdata: Sequence[float]
  38     bounds: Sequence[Sequence[float]]
  39     inits: Sequence[float]
  40     sigmas: Sequence[float]
  41     fixed: bool
  42 
  43 
  44 class Parameter(ParameterBase):
  45     name: str
  46 
  47 
  48 class Config(TypedDict):
  49     poi: str
  50     parameters: MutableSequence[Parameter]
  51 
  52 
  53 class Measurement(TypedDict):
  54     name: str
  55     config: Config
  56 
  57 
  58 class ModifierBase(TypedDict):
  59     name: str
  60 
  61 
  62 class NormSysData(TypedDict):
  63     lo: float
  64     hi: float
  65 
  66 
  67 class NormSys(ModifierBase):
  68     type: Literal['normsys']
  69     data: NormSysData
  70 
  71 
  72 class NormFactor(ModifierBase):
  73     type: Literal['normfactor']
  74     data: None
  75 
  76 
  77 class HistoSysData(TypedDict):
  78     lo_data: Sequence[float]
  79     hi_data: Sequence[float]
  80 
  81 
  82 class HistoSys(ModifierBase):
  83     type: Literal['histosys']
  84     data: HistoSysData
  85 
  86 
  87 class StatError(ModifierBase):
  88     type: Literal['staterror']
  89     data: Sequence[float]
  90 
  91 
  92 class ShapeSys(ModifierBase):
  93     type: Literal['shapesys']
  94     data: Sequence[float]
  95 
  96 
  97 class ShapeFactor(ModifierBase):
  98     type: Literal['shapefactor']
  99     data: None
  100 
  101 
  102 class LumiSys(TypedDict):
  103     name: Literal['lumi']
  104     type: Literal['lumi']
  105     data: None
  106 
  107 
  108 Modifier = Union[
  109     NormSys, NormFactor, HistoSys, StatError, ShapeSys, ShapeFactor, LumiSys
  110 ]
  111 
  112 
  113 class SampleBase(TypedDict, total=False):
  114     parameter_configs: Sequence[Parameter]
  115 
  116 
  117 class Sample(SampleBase):
  118     name: str
  119     data: Sequence[float]
  120     modifiers: Sequence[Modifier]
  121 
  122 
  123 class Channel(TypedDict):
  124     name: str
  125     samples: Sequence[Sample]
  126 
  127 
  128 class Observation(TypedDict):
  129     name: str
  130     data: Sequence[float]
  131 
  132 
  133 class Workspace(TypedDict):
  134     measurements: Sequence[Measurement]
  135     channels: Sequence[Channel]
  136     observations: Sequence[Observation]
  137
  ```
  --- 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/typing.py b/src/pyhf/typing.py
  --- a/src/pyhf/typing.py
  +++ b/src/pyhf/typing.py
  @@ -1,6 +1,6 @@
   import os
   import sys
  -from typing import TYPE_CHECKING, MutableSequence, Sequence, Union
  +from typing import MutableSequence, Sequence, Union
   
   if sys.version_info >= (3, 8):
       from typing import Literal, TypedDict
  @@ -27,10 +27,8 @@
       "Workspace",
   )
   
  -if TYPE_CHECKING:
  -    PathOrStr = Union[str, os.PathLike[str]]
  -else:
  -    PathOrStr = Union[str, "os.PathLike[str]"]
  +# TODO: Switch to os.PathLike[str] once Python 3.8 support dropped
  +PathOrStr = Union[str, "os.PathLike[str]"]
   
   
   class ParameterBase(TypedDict, total=False):
  
verification_info: {"golden_diff": "diff --git a/src/pyhf/typing.py b/src/pyhf/typing.py\n--- a/src/pyhf/typing.py\n+++ b/src/pyhf/typing.py\n@@ -1,6 +1,6 @@\n import os\n import sys\n-from typing import TYPE_CHECKING, MutableSequence, Sequence, Union\n+from typing import MutableSequence, Sequence, Union\n \n if sys.version_info >= (3, 8):\n     from typing import Literal, TypedDict\n@@ -27,10 +27,8 @@\n     \"Workspace\",\n )\n \n-if TYPE_CHECKING:\n-    PathOrStr = Union[str, os.PathLike[str]]\n-else:\n-    PathOrStr = Union[str, \"os.PathLike[str]\"]\n+# TODO: Switch to os.PathLike[str] once Python 3.8 support dropped\n+PathOrStr = Union[str, \"os.PathLike[str]\"]\n \n \n class ParameterBase(TypedDict, total=False):\n", "issue": "Use string form for type checking until Python 3.7 dropped\nWhat the if here? The string form is fine until you drop Pythons that don\u2019t support it.\r\n\r\n_Originally posted by @henryiii in https://github.com/scikit-hep/pyhf/pull/1909#discussion_r944456765_\r\n\r\nThis was in reference to \r\n\r\n```python\r\nif T.TYPE_CHECKING:\r\n    PathOrStr = T.Union[str, os.PathLike[str]]\r\nelse:\r\n    PathOrStr = T.Union[str, \"os.PathLike[str]\"]\r\n```\r\n\r\nin PR #190 now in \r\n\r\nhttps://github.com/scikit-hep/pyhf/blob/ad1dd86f1d7c1bcbf737805b6821e07c4ef75fca/src/pyhf/typing.py#L30-L33\r\n\r\nSo until Python 3.7 is dropped (I think this is the version I am not very up to date with my type checking knowledge) we could instead just drop the `if TYPE_CHECKING` and use\r\n\r\n```python\r\n#TODO: Switch to os.PathLike[str] once Python 3.7 dropped\r\nPathOrStr = Union[str, \"os.PathLike[str]\"]\r\n```\r\n\r\nThis would also allow for reverting PR #1937.\n", "before_files": [{"content": "import os\nimport sys\nfrom typing import TYPE_CHECKING, MutableSequence, Sequence, Union\n\nif sys.version_info >= (3, 8):\n    from typing import Literal, TypedDict\nelse:\n    from typing_extensions import Literal, TypedDict\n\n__all__ = (\n    \"PathOrStr\",\n    \"ParameterBase\",\n    \"Parameter\",\n    \"Measurement\",\n    \"ModifierBase\",\n    \"NormSys\",\n    \"NormFactor\",\n    \"HistoSys\",\n    \"StatError\",\n    \"ShapeSys\",\n    \"ShapeFactor\",\n    \"LumiSys\",\n    \"Modifier\",\n    \"Sample\",\n    \"Channel\",\n    \"Observation\",\n    \"Workspace\",\n)\n\nif TYPE_CHECKING:\n    PathOrStr = Union[str, os.PathLike[str]]\nelse:\n    PathOrStr = Union[str, \"os.PathLike[str]\"]\n\n\nclass ParameterBase(TypedDict, total=False):\n    auxdata: Sequence[float]\n    bounds: Sequence[Sequence[float]]\n    inits: Sequence[float]\n    sigmas: Sequence[float]\n    fixed: bool\n\n\nclass Parameter(ParameterBase):\n    name: str\n\n\nclass Config(TypedDict):\n    poi: str\n    parameters: MutableSequence[Parameter]\n\n\nclass Measurement(TypedDict):\n    name: str\n    config: Config\n\n\nclass ModifierBase(TypedDict):\n    name: str\n\n\nclass NormSysData(TypedDict):\n    lo: float\n    hi: float\n\n\nclass NormSys(ModifierBase):\n    type: Literal['normsys']\n    data: NormSysData\n\n\nclass NormFactor(ModifierBase):\n    type: Literal['normfactor']\n    data: None\n\n\nclass HistoSysData(TypedDict):\n    lo_data: Sequence[float]\n    hi_data: Sequence[float]\n\n\nclass HistoSys(ModifierBase):\n    type: Literal['histosys']\n    data: HistoSysData\n\n\nclass StatError(ModifierBase):\n    type: Literal['staterror']\n    data: Sequence[float]\n\n\nclass ShapeSys(ModifierBase):\n    type: Literal['shapesys']\n    data: Sequence[float]\n\n\nclass ShapeFactor(ModifierBase):\n    type: Literal['shapefactor']\n    data: None\n\n\nclass LumiSys(TypedDict):\n    name: Literal['lumi']\n    type: Literal['lumi']\n    data: None\n\n\nModifier = Union[\n    NormSys, NormFactor, HistoSys, StatError, ShapeSys, ShapeFactor, LumiSys\n]\n\n\nclass SampleBase(TypedDict, total=False):\n    parameter_configs: Sequence[Parameter]\n\n\nclass Sample(SampleBase):\n    name: str\n    data: Sequence[float]\n    modifiers: Sequence[Modifier]\n\n\nclass Channel(TypedDict):\n    name: str\n    samples: Sequence[Sample]\n\n\nclass Observation(TypedDict):\n    name: str\n    data: Sequence[float]\n\n\nclass Workspace(TypedDict):\n    measurements: Sequence[Measurement]\n    channels: Sequence[Channel]\n    observations: Sequence[Observation]\n", "path": "src/pyhf/typing.py"}], "after_files": [{"content": "import os\nimport sys\nfrom typing import MutableSequence, Sequence, Union\n\nif sys.version_info >= (3, 8):\n    from typing import Literal, TypedDict\nelse:\n    from typing_extensions import Literal, TypedDict\n\n__all__ = (\n    \"PathOrStr\",\n    \"ParameterBase\",\n    \"Parameter\",\n    \"Measurement\",\n    \"ModifierBase\",\n    \"NormSys\",\n    \"NormFactor\",\n    \"HistoSys\",\n    \"StatError\",\n    \"ShapeSys\",\n    \"ShapeFactor\",\n    \"LumiSys\",\n    \"Modifier\",\n    \"Sample\",\n    \"Channel\",\n    \"Observation\",\n    \"Workspace\",\n)\n\n# TODO: Switch to os.PathLike[str] once Python 3.8 support dropped\nPathOrStr = Union[str, \"os.PathLike[str]\"]\n\n\nclass ParameterBase(TypedDict, total=False):\n    auxdata: Sequence[float]\n    bounds: Sequence[Sequence[float]]\n    inits: Sequence[float]\n    sigmas: Sequence[float]\n    fixed: bool\n\n\nclass Parameter(ParameterBase):\n    name: str\n\n\nclass Config(TypedDict):\n    poi: str\n    parameters: MutableSequence[Parameter]\n\n\nclass Measurement(TypedDict):\n    name: str\n    config: Config\n\n\nclass ModifierBase(TypedDict):\n    name: str\n\n\nclass NormSysData(TypedDict):\n    lo: float\n    hi: float\n\n\nclass NormSys(ModifierBase):\n    type: Literal['normsys']\n    data: NormSysData\n\n\nclass NormFactor(ModifierBase):\n    type: Literal['normfactor']\n    data: None\n\n\nclass HistoSysData(TypedDict):\n    lo_data: Sequence[float]\n    hi_data: Sequence[float]\n\n\nclass HistoSys(ModifierBase):\n    type: Literal['histosys']\n    data: HistoSysData\n\n\nclass StatError(ModifierBase):\n    type: Literal['staterror']\n    data: Sequence[float]\n\n\nclass ShapeSys(ModifierBase):\n    type: Literal['shapesys']\n    data: Sequence[float]\n\n\nclass ShapeFactor(ModifierBase):\n    type: Literal['shapefactor']\n    data: None\n\n\nclass LumiSys(TypedDict):\n    name: Literal['lumi']\n    type: Literal['lumi']\n    data: None\n\n\nModifier = Union[\n    NormSys, NormFactor, HistoSys, StatError, ShapeSys, ShapeFactor, LumiSys\n]\n\n\nclass SampleBase(TypedDict, total=False):\n    parameter_configs: Sequence[Parameter]\n\n\nclass Sample(SampleBase):\n    name: str\n    data: Sequence[float]\n    modifiers: Sequence[Modifier]\n\n\nclass Channel(TypedDict):\n    name: str\n    samples: Sequence[Sample]\n\n\nclass Observation(TypedDict):\n    name: str\n    data: Sequence[float]\n\n\nclass Workspace(TypedDict):\n    measurements: Sequence[Measurement]\n    channels: Sequence[Channel]\n    observations: Sequence[Observation]\n", "path": "src/pyhf/typing.py"}]}