def METHOD_NAME(self, time=None, averages=1):
    """
    Set and get aperture.
    :param time: integration time as string: SHORT, MED, LONG (case insensitive);
        if None, get values
    :param averages: number of averages, numeric
    """
    if time is None:
        read_values = self.ask(":APER?").split(',')
        return read_values[0], int(read_values[1])
    else:
        if time.upper() in ["SHORT", "MED", "LONG"]:
            self.write(f":APER {time}, {averages}")
        else:
            raise Exception("Time must be a string: SHORT, MED, LONG")