We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
consider using NumExpr as alternative to eval
Within the units library, we use eval.

https://github.com/wright-group/WrightTools/blob/master/WrightTools/units.py#L96-L135

We could use NumExpr... our usage case seems to be exactly what the package was made for.

https://numexpr.readthedocs.io/en/latest/user_guide.html

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `WrightTools/units.py`
Content:
```
1 """Unit and label handling in WrightTools."""
2 
3 
4 # --- import --------------------------------------------------------------------------------------
5 
6 
7 import collections
8 
9 import numpy as np
10 import warnings
11 
12 
13 # --- define --------------------------------------------------------------------------------------
14 
15 
16 # units are stored in dictionaries of like kind. format:
17 #     unit : to native, from native, units_symbol, units_label
18 
19 # angle units (native: rad)
20 angle = {"rad": ["x", "x", r"rad"], "deg": ["x/57.2958", "57.2958*x", r"deg"]}
21 
22 # delay units (native: fs)
23 fs_per_mm = 3336.
24 delay = {
25     "fs": ["x", "x", r"fs"],
26     "ps": ["x*1e3", "x/1e3", r"ps"],
27     "ns": ["x*1e6", "x/1e6", r"ns"],
28     "mm_delay": ["x*2*fs_per_mm", "x/(2*fs_per_mm)", r"mm"],
29 }
30 
31 # energy units (native: nm)
32 energy = {
33     "nm": ["x", "x", r"nm"],
34     "wn": ["1e7/x", "1e7/x", r"cm^{-1}"],
35     "eV": ["1240./x", "1240./x", r"eV"],
36     "meV": ["1240000./x", "1240000./x", r"meV"],
37     "Hz": ["2.99792458e17/x", "2.99792458e17/x", r"Hz"],
38     "THz": ["2.99792458e5/x", "2.99792458e5/x", r"THz"],
39     "GHz": ["2.99792458e8/x", "2.99792458e8/x", r"GHz"],
40 }
41 
42 # fluence units (native: uJ per sq. cm)
43 fluence = {"uJ per sq. cm": ["x", "x", r"\frac{\mu J}{cm^{2}}"]}
44 
45 # optical density units (native: od)
46 od = {"mOD": ["1e3*x", "x/1e3", r"mOD"], "OD": ["x", "x", r"OD"]}
47 
48 # position units (native: mm)
49 position = {
50     "nm_p": ["x/1e6", "1e6*x", r"nm"],
51     "um": ["x/1000.", "1000.*x", r"um"],
52     "mm": ["x", "x", r"mm"],
53     "cm": ["10.*x", "x/10.", r"cm"],
54     "in": ["x*0.039370", "0.039370*x", r"in"],
55 }
56 
57 # pulse width units (native: FWHM)
58 pulse_width = {"FWHM": ["x", "x", r"FWHM"]}
59 
60 # temperature units (native: K)
61 temperature = {
62     "K": ["x", "x", r"K"],
63     "deg_C": ["x+273.15", "x-273.15", r"^\circ C"],
64     "deg_F": ["(x+459.67)*5/9", "x*9/5-456.67", r"^\circ F"],
65     "deg_R": ["x*5/9", "x*9/5", r"^\circ R"],
66 }
67 
68 # time units (native: s)
69 time = {
70     "fs_t": ["x/1e15", "x*1e15", r"fs"],
71     "ps_t": ["x/1e12", "x*1e12", r"ps"],
72     "ns_t": ["x/1e9", "x*1e9", r"ns"],
73     "us_t": ["x/1e6", "x*1e6", r"us"],
74     "ms_t": ["x/1000.", "x*1000.", r"ms"],
75     "s_t": ["x", "x", r"s"],
76     "m_t": ["x*60.", "x/60.", r"m"],
77     "h_t": ["x*3600.", "x/3600.", r"h"],
78     "d_t": ["x*86400.", "x/86400.", r"d"],
79 }
80 
81 dicts = collections.OrderedDict()
82 dicts["angle"] = angle
83 dicts["delay"] = delay
84 dicts["energy"] = energy
85 dicts["time"] = time
86 dicts["position"] = position
87 dicts["pulse_width"] = pulse_width
88 dicts["fluence"] = fluence
89 dicts["od"] = od
90 dicts["temperature"] = temperature
91 
92 
93 # --- functions -----------------------------------------------------------------------------------
94 
95 
96 def converter(val, current_unit, destination_unit):
97     """Convert from one unit to another.
98 
99     Parameters
100     ----------
101     val : number
102         Number to convert.
103     current_unit : string
104         Current unit.
105     destination_unit : string
106         Destination unit.
107 
108     Returns
109     -------
110     number
111         Converted value.
112     """
113     x = val
114     for dic in dicts.values():
115         if current_unit in dic.keys() and destination_unit in dic.keys():
116             try:
117                 native = eval(dic[current_unit][0])
118             except ZeroDivisionError:
119                 native = np.inf
120             x = native  # noqa: F841
121             try:
122                 out = eval(dic[destination_unit][1])
123             except ZeroDivisionError:
124                 out = np.inf
125             return out
126     # if all dictionaries fail
127     if current_unit is None and destination_unit is None:
128         pass
129     else:
130         warnings.warn(
131             "conversion {0} to {1} not valid: returning input".format(
132                 current_unit, destination_unit
133             )
134         )
135     return val
136 
137 
138 convert = converter
139 
140 
141 def get_symbol(units) -> str:
142     """Get default symbol type.
143 
144     Parameters
145     ----------
146     units_str : string
147         Units.
148 
149     Returns
150     -------
151     string
152         LaTeX formatted symbol.
153     """
154     if kind(units) == "energy":
155         d = {}
156         d["nm"] = r"\lambda"
157         d["wn"] = r"\bar\nu"
158         d["eV"] = r"\hslash\omega"
159         d["Hz"] = r"f"
160         d["THz"] = r"f"
161         d["GHz"] = r"f"
162         return d.get(units, "E")
163     elif kind(units) == "delay":
164         return r"\tau"
165     elif kind(units) == "fluence":
166         return r"\mathcal{F}"
167     elif kind(units) == "pulse_width":
168         return r"\sigma"
169     elif kind(units) == "temperature":
170         return r"T"
171     else:
172         return kind(units)
173 
174 
175 def get_valid_conversions(units) -> tuple:
176     try:
177         valid = list(dicts[kind(units)])
178     except KeyError:
179         return ()
180     valid.remove(units)
181     return tuple(valid)
182 
183 
184 def is_valid_conversion(a, b) -> bool:
185     for dic in dicts.values():
186         if a in dic.keys() and b in dic.keys():
187             return True
188     if a is None and b is None:
189         return True
190     else:
191         return False
192 
193 
194 def kind(units):
195     """Find the kind of given units.
196 
197     Parameters
198     ----------
199     units : string
200         The units of interest
201 
202     Returns
203     -------
204     string
205         The kind of the given units. If no match is found, returns None.
206     """
207     for k, v in dicts.items():
208         if units in v.keys():
209             return k
210
```
--- 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()

```

diff --git a/WrightTools/units.py b/WrightTools/units.py
--- a/WrightTools/units.py
+++ b/WrightTools/units.py
@@ -5,9 +5,10 @@
 
 
 import collections
+import warnings
 
 import numpy as np
-import warnings
+import numexpr
 
 
 # --- define --------------------------------------------------------------------------------------
@@ -20,7 +21,7 @@
 angle = {"rad": ["x", "x", r"rad"], "deg": ["x/57.2958", "57.2958*x", r"deg"]}
 
 # delay units (native: fs)
-fs_per_mm = 3336.
+fs_per_mm = 3336.0
 delay = {
     "fs": ["x", "x", r"fs"],
     "ps": ["x*1e3", "x/1e3", r"ps"],
@@ -114,12 +115,12 @@
     for dic in dicts.values():
         if current_unit in dic.keys() and destination_unit in dic.keys():
             try:
-                native = eval(dic[current_unit][0])
+                native = numexpr.evaluate(dic[current_unit][0], {"x": x})
             except ZeroDivisionError:
                 native = np.inf
             x = native  # noqa: F841
             try:
-                out = eval(dic[destination_unit][1])
+                out = numexpr.evaluate(dic[destination_unit][1], {"x": x})
             except ZeroDivisionError:
                 out = np.inf
             return out

{"golden_diff": "diff --git a/WrightTools/units.py b/WrightTools/units.py\n--- a/WrightTools/units.py\n+++ b/WrightTools/units.py\n@@ -5,9 +5,10 @@\n \n \n import collections\n+import warnings\n \n import numpy as np\n-import warnings\n+import numexpr\n \n \n # --- define --------------------------------------------------------------------------------------\n@@ -20,7 +21,7 @@\n angle = {\"rad\": [\"x\", \"x\", r\"rad\"], \"deg\": [\"x/57.2958\", \"57.2958*x\", r\"deg\"]}\n \n # delay units (native: fs)\n-fs_per_mm = 3336.\n+fs_per_mm = 3336.0\n delay = {\n     \"fs\": [\"x\", \"x\", r\"fs\"],\n     \"ps\": [\"x*1e3\", \"x/1e3\", r\"ps\"],\n@@ -114,12 +115,12 @@\n     for dic in dicts.values():\n         if current_unit in dic.keys() and destination_unit in dic.keys():\n             try:\n-                native = eval(dic[current_unit][0])\n+                native = numexpr.evaluate(dic[current_unit][0], {\"x\": x})\n             except ZeroDivisionError:\n                 native = np.inf\n             x = native  # noqa: F841\n             try:\n-                out = eval(dic[destination_unit][1])\n+                out = numexpr.evaluate(dic[destination_unit][1], {\"x\": x})\n             except ZeroDivisionError:\n                 out = np.inf\n             return out\n", "issue": "consider using NumExpr as alternative to eval\nWithin the units library, we use eval.\r\n\r\nhttps://github.com/wright-group/WrightTools/blob/master/WrightTools/units.py#L96-L135\r\n\r\nWe could use NumExpr... our usage case seems to be exactly what the package was made for.\r\n\r\nhttps://numexpr.readthedocs.io/en/latest/user_guide.html\n", "before_files": [{"content": "\"\"\"Unit and label handling in WrightTools.\"\"\"\n\n\n# --- import --------------------------------------------------------------------------------------\n\n\nimport collections\n\nimport numpy as np\nimport warnings\n\n\n# --- define --------------------------------------------------------------------------------------\n\n\n# units are stored in dictionaries of like kind. format:\n#     unit : to native, from native, units_symbol, units_label\n\n# angle units (native: rad)\nangle = {\"rad\": [\"x\", \"x\", r\"rad\"], \"deg\": [\"x/57.2958\", \"57.2958*x\", r\"deg\"]}\n\n# delay units (native: fs)\nfs_per_mm = 3336.\ndelay = {\n    \"fs\": [\"x\", \"x\", r\"fs\"],\n    \"ps\": [\"x*1e3\", \"x/1e3\", r\"ps\"],\n    \"ns\": [\"x*1e6\", \"x/1e6\", r\"ns\"],\n    \"mm_delay\": [\"x*2*fs_per_mm\", \"x/(2*fs_per_mm)\", r\"mm\"],\n}\n\n# energy units (native: nm)\nenergy = {\n    \"nm\": [\"x\", \"x\", r\"nm\"],\n    \"wn\": [\"1e7/x\", \"1e7/x\", r\"cm^{-1}\"],\n    \"eV\": [\"1240./x\", \"1240./x\", r\"eV\"],\n    \"meV\": [\"1240000./x\", \"1240000./x\", r\"meV\"],\n    \"Hz\": [\"2.99792458e17/x\", \"2.99792458e17/x\", r\"Hz\"],\n    \"THz\": [\"2.99792458e5/x\", \"2.99792458e5/x\", r\"THz\"],\n    \"GHz\": [\"2.99792458e8/x\", \"2.99792458e8/x\", r\"GHz\"],\n}\n\n# fluence units (native: uJ per sq. cm)\nfluence = {\"uJ per sq. cm\": [\"x\", \"x\", r\"\\frac{\\mu J}{cm^{2}}\"]}\n\n# optical density units (native: od)\nod = {\"mOD\": [\"1e3*x\", \"x/1e3\", r\"mOD\"], \"OD\": [\"x\", \"x\", r\"OD\"]}\n\n# position units (native: mm)\nposition = {\n    \"nm_p\": [\"x/1e6\", \"1e6*x\", r\"nm\"],\n    \"um\": [\"x/1000.\", \"1000.*x\", r\"um\"],\n    \"mm\": [\"x\", \"x\", r\"mm\"],\n    \"cm\": [\"10.*x\", \"x/10.\", r\"cm\"],\n    \"in\": [\"x*0.039370\", \"0.039370*x\", r\"in\"],\n}\n\n# pulse width units (native: FWHM)\npulse_width = {\"FWHM\": [\"x\", \"x\", r\"FWHM\"]}\n\n# temperature units (native: K)\ntemperature = {\n    \"K\": [\"x\", \"x\", r\"K\"],\n    \"deg_C\": [\"x+273.15\", \"x-273.15\", r\"^\\circ C\"],\n    \"deg_F\": [\"(x+459.67)*5/9\", \"x*9/5-456.67\", r\"^\\circ F\"],\n    \"deg_R\": [\"x*5/9\", \"x*9/5\", r\"^\\circ R\"],\n}\n\n# time units (native: s)\ntime = {\n    \"fs_t\": [\"x/1e15\", \"x*1e15\", r\"fs\"],\n    \"ps_t\": [\"x/1e12\", \"x*1e12\", r\"ps\"],\n    \"ns_t\": [\"x/1e9\", \"x*1e9\", r\"ns\"],\n    \"us_t\": [\"x/1e6\", \"x*1e6\", r\"us\"],\n    \"ms_t\": [\"x/1000.\", \"x*1000.\", r\"ms\"],\n    \"s_t\": [\"x\", \"x\", r\"s\"],\n    \"m_t\": [\"x*60.\", \"x/60.\", r\"m\"],\n    \"h_t\": [\"x*3600.\", \"x/3600.\", r\"h\"],\n    \"d_t\": [\"x*86400.\", \"x/86400.\", r\"d\"],\n}\n\ndicts = collections.OrderedDict()\ndicts[\"angle\"] = angle\ndicts[\"delay\"] = delay\ndicts[\"energy\"] = energy\ndicts[\"time\"] = time\ndicts[\"position\"] = position\ndicts[\"pulse_width\"] = pulse_width\ndicts[\"fluence\"] = fluence\ndicts[\"od\"] = od\ndicts[\"temperature\"] = temperature\n\n\n# --- functions -----------------------------------------------------------------------------------\n\n\ndef converter(val, current_unit, destination_unit):\n    \"\"\"Convert from one unit to another.\n\n    Parameters\n    ----------\n    val : number\n        Number to convert.\n    current_unit : string\n        Current unit.\n    destination_unit : string\n        Destination unit.\n\n    Returns\n    -------\n    number\n        Converted value.\n    \"\"\"\n    x = val\n    for dic in dicts.values():\n        if current_unit in dic.keys() and destination_unit in dic.keys():\n            try:\n                native = eval(dic[current_unit][0])\n            except ZeroDivisionError:\n                native = np.inf\n            x = native  # noqa: F841\n            try:\n                out = eval(dic[destination_unit][1])\n            except ZeroDivisionError:\n                out = np.inf\n            return out\n    # if all dictionaries fail\n    if current_unit is None and destination_unit is None:\n        pass\n    else:\n        warnings.warn(\n            \"conversion {0} to {1} not valid: returning input\".format(\n                current_unit, destination_unit\n            )\n        )\n    return val\n\n\nconvert = converter\n\n\ndef get_symbol(units) -> str:\n    \"\"\"Get default symbol type.\n\n    Parameters\n    ----------\n    units_str : string\n        Units.\n\n    Returns\n    -------\n    string\n        LaTeX formatted symbol.\n    \"\"\"\n    if kind(units) == \"energy\":\n        d = {}\n        d[\"nm\"] = r\"\\lambda\"\n        d[\"wn\"] = r\"\\bar\\nu\"\n        d[\"eV\"] = r\"\\hslash\\omega\"\n        d[\"Hz\"] = r\"f\"\n        d[\"THz\"] = r\"f\"\n        d[\"GHz\"] = r\"f\"\n        return d.get(units, \"E\")\n    elif kind(units) == \"delay\":\n        return r\"\\tau\"\n    elif kind(units) == \"fluence\":\n        return r\"\\mathcal{F}\"\n    elif kind(units) == \"pulse_width\":\n        return r\"\\sigma\"\n    elif kind(units) == \"temperature\":\n        return r\"T\"\n    else:\n        return kind(units)\n\n\ndef get_valid_conversions(units) -> tuple:\n    try:\n        valid = list(dicts[kind(units)])\n    except KeyError:\n        return ()\n    valid.remove(units)\n    return tuple(valid)\n\n\ndef is_valid_conversion(a, b) -> bool:\n    for dic in dicts.values():\n        if a in dic.keys() and b in dic.keys():\n            return True\n    if a is None and b is None:\n        return True\n    else:\n        return False\n\n\ndef kind(units):\n    \"\"\"Find the kind of given units.\n\n    Parameters\n    ----------\n    units : string\n        The units of interest\n\n    Returns\n    -------\n    string\n        The kind of the given units. If no match is found, returns None.\n    \"\"\"\n    for k, v in dicts.items():\n        if units in v.keys():\n            return k\n", "path": "WrightTools/units.py"}], "after_files": [{"content": "\"\"\"Unit and label handling in WrightTools.\"\"\"\n\n\n# --- import --------------------------------------------------------------------------------------\n\n\nimport collections\nimport warnings\n\nimport numpy as np\nimport numexpr\n\n\n# --- define --------------------------------------------------------------------------------------\n\n\n# units are stored in dictionaries of like kind. format:\n#     unit : to native, from native, units_symbol, units_label\n\n# angle units (native: rad)\nangle = {\"rad\": [\"x\", \"x\", r\"rad\"], \"deg\": [\"x/57.2958\", \"57.2958*x\", r\"deg\"]}\n\n# delay units (native: fs)\nfs_per_mm = 3336.0\ndelay = {\n    \"fs\": [\"x\", \"x\", r\"fs\"],\n    \"ps\": [\"x*1e3\", \"x/1e3\", r\"ps\"],\n    \"ns\": [\"x*1e6\", \"x/1e6\", r\"ns\"],\n    \"mm_delay\": [\"x*2*fs_per_mm\", \"x/(2*fs_per_mm)\", r\"mm\"],\n}\n\n# energy units (native: nm)\nenergy = {\n    \"nm\": [\"x\", \"x\", r\"nm\"],\n    \"wn\": [\"1e7/x\", \"1e7/x\", r\"cm^{-1}\"],\n    \"eV\": [\"1240./x\", \"1240./x\", r\"eV\"],\n    \"meV\": [\"1240000./x\", \"1240000./x\", r\"meV\"],\n    \"Hz\": [\"2.99792458e17/x\", \"2.99792458e17/x\", r\"Hz\"],\n    \"THz\": [\"2.99792458e5/x\", \"2.99792458e5/x\", r\"THz\"],\n    \"GHz\": [\"2.99792458e8/x\", \"2.99792458e8/x\", r\"GHz\"],\n}\n\n# fluence units (native: uJ per sq. cm)\nfluence = {\"uJ per sq. cm\": [\"x\", \"x\", r\"\\frac{\\mu J}{cm^{2}}\"]}\n\n# optical density units (native: od)\nod = {\"mOD\": [\"1e3*x\", \"x/1e3\", r\"mOD\"], \"OD\": [\"x\", \"x\", r\"OD\"]}\n\n# position units (native: mm)\nposition = {\n    \"nm_p\": [\"x/1e6\", \"1e6*x\", r\"nm\"],\n    \"um\": [\"x/1000.\", \"1000.*x\", r\"um\"],\n    \"mm\": [\"x\", \"x\", r\"mm\"],\n    \"cm\": [\"10.*x\", \"x/10.\", r\"cm\"],\n    \"in\": [\"x*0.039370\", \"0.039370*x\", r\"in\"],\n}\n\n# pulse width units (native: FWHM)\npulse_width = {\"FWHM\": [\"x\", \"x\", r\"FWHM\"]}\n\n# temperature units (native: K)\ntemperature = {\n    \"K\": [\"x\", \"x\", r\"K\"],\n    \"deg_C\": [\"x+273.15\", \"x-273.15\", r\"^\\circ C\"],\n    \"deg_F\": [\"(x+459.67)*5/9\", \"x*9/5-456.67\", r\"^\\circ F\"],\n    \"deg_R\": [\"x*5/9\", \"x*9/5\", r\"^\\circ R\"],\n}\n\n# time units (native: s)\ntime = {\n    \"fs_t\": [\"x/1e15\", \"x*1e15\", r\"fs\"],\n    \"ps_t\": [\"x/1e12\", \"x*1e12\", r\"ps\"],\n    \"ns_t\": [\"x/1e9\", \"x*1e9\", r\"ns\"],\n    \"us_t\": [\"x/1e6\", \"x*1e6\", r\"us\"],\n    \"ms_t\": [\"x/1000.\", \"x*1000.\", r\"ms\"],\n    \"s_t\": [\"x\", \"x\", r\"s\"],\n    \"m_t\": [\"x*60.\", \"x/60.\", r\"m\"],\n    \"h_t\": [\"x*3600.\", \"x/3600.\", r\"h\"],\n    \"d_t\": [\"x*86400.\", \"x/86400.\", r\"d\"],\n}\n\ndicts = collections.OrderedDict()\ndicts[\"angle\"] = angle\ndicts[\"delay\"] = delay\ndicts[\"energy\"] = energy\ndicts[\"time\"] = time\ndicts[\"position\"] = position\ndicts[\"pulse_width\"] = pulse_width\ndicts[\"fluence\"] = fluence\ndicts[\"od\"] = od\ndicts[\"temperature\"] = temperature\n\n\n# --- functions -----------------------------------------------------------------------------------\n\n\ndef converter(val, current_unit, destination_unit):\n    \"\"\"Convert from one unit to another.\n\n    Parameters\n    ----------\n    val : number\n        Number to convert.\n    current_unit : string\n        Current unit.\n    destination_unit : string\n        Destination unit.\n\n    Returns\n    -------\n    number\n        Converted value.\n    \"\"\"\n    x = val\n    for dic in dicts.values():\n        if current_unit in dic.keys() and destination_unit in dic.keys():\n            try:\n                native = numexpr.evaluate(dic[current_unit][0], {\"x\": x})\n            except ZeroDivisionError:\n                native = np.inf\n            x = native  # noqa: F841\n            try:\n                out = numexpr.evaluate(dic[destination_unit][1], {\"x\": x})\n            except ZeroDivisionError:\n                out = np.inf\n            return out\n    # if all dictionaries fail\n    if current_unit is None and destination_unit is None:\n        pass\n    else:\n        warnings.warn(\n            \"conversion {0} to {1} not valid: returning input\".format(\n                current_unit, destination_unit\n            )\n        )\n    return val\n\n\nconvert = converter\n\n\ndef get_symbol(units) -> str:\n    \"\"\"Get default symbol type.\n\n    Parameters\n    ----------\n    units_str : string\n        Units.\n\n    Returns\n    -------\n    string\n        LaTeX formatted symbol.\n    \"\"\"\n    if kind(units) == \"energy\":\n        d = {}\n        d[\"nm\"] = r\"\\lambda\"\n        d[\"wn\"] = r\"\\bar\\nu\"\n        d[\"eV\"] = r\"\\hslash\\omega\"\n        d[\"Hz\"] = r\"f\"\n        d[\"THz\"] = r\"f\"\n        d[\"GHz\"] = r\"f\"\n        return d.get(units, \"E\")\n    elif kind(units) == \"delay\":\n        return r\"\\tau\"\n    elif kind(units) == \"fluence\":\n        return r\"\\mathcal{F}\"\n    elif kind(units) == \"pulse_width\":\n        return r\"\\sigma\"\n    elif kind(units) == \"temperature\":\n        return r\"T\"\n    else:\n        return kind(units)\n\n\ndef get_valid_conversions(units) -> tuple:\n    try:\n        valid = list(dicts[kind(units)])\n    except KeyError:\n        return ()\n    valid.remove(units)\n    return tuple(valid)\n\n\ndef is_valid_conversion(a, b) -> bool:\n    for dic in dicts.values():\n        if a in dic.keys() and b in dic.keys():\n            return True\n    if a is None and b is None:\n        return True\n    else:\n        return False\n\n\ndef kind(units):\n    \"\"\"Find the kind of given units.\n\n    Parameters\n    ----------\n    units : string\n        The units of interest\n\n    Returns\n    -------\n    string\n        The kind of the given units. If no match is found, returns None.\n    \"\"\"\n    for k, v in dicts.items():\n        if units in v.keys():\n            return k\n", "path": "WrightTools/units.py"}]}