Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def from_gst_gate(gst_gate: Union[str, LabelTup]) -> str:
if isinstance(gst_gate, LabelTup):
gst_gate = gst_gate.name
try:
return __from_gst_gate_map[gst_gate]
except KeyError:
raise RuntimeError('pyGSTi gate ' + gst_gate + ' not supported')