from qcodes.instrument.base import Instrument as QcodesInstrument


class Instrument(QcodesInstrument):
    """
    Class for all QCodes instruments.
    """

    def get_idn(self):
        """
        Required as a standard interface for QCoDeS instruments.
        """
        return {'driver': str(self.__class__), 'name': self.name}
    
@@ -330,12 +330,1124 @@
 f.name%7D%0A
+%0A
     
+def get(self, param_name, *args):%0A        %22%22%22Shortcut for getting a parameter from its name or a default value.%0A%0A        Extends the super method to allow specifying a default value as%0A        second argument, which is returned if the parameter does not exist.%0A%0A        Args:%0A            param_name: The name of a parameter of this instrument.%0A            *args: accepts a single unnamed argument, which, if provided, is%0A                used as default value if the parameter does not exist.%0A%0A        Returns:%0A            The current value of the parameter.%0A%0A        Examples:%0A        %3E%3E%3E # returns 'default_value'%0A        %3E%3E%3E instr.get('nonexistent_parameter', 'default_value')%0A        %3E%3E%3E # raises a KeyError%0A        %3E%3E%3E instr.get('nonexistent_parameter')%0A        %22%22%22%0A        if len(args) %3E 1:%0A            raise ValueError(f'Pulsar.get accepts 1 or 2 arguments, but '%0A                             f'%7Blen(args) + 1%7D were provided.')%0A        if param_name not in self.parameters and len(args) == 1:%0A            return args%5B0%5D  # interpret second argument as default value%0A        return super().get(param_name)%0A

allow providing a default value