def__init__(self,field_pairs):fields=dict()fork,vinfield_pairs.items():ifisinstance(v,Field):fields[k]=velifisinstance(v,dict):fields[k]=Field(v)else:raiseTypeError(f"Expected Field or dict, got {type(v)}")self.fields=fields
defshow(self,**assignments):""" Interactive visualization of the Pulse Args: **assignments: assigning the instance value (literal) to the existing variables in the Pulse """display_ir(self,assignments)