def get_reference_source(lockin):
    """Get the reference source. Return either internal (1) or external (0).

    args:
            lockin (pyvisa.resources.gpib.GPIBInstrument): SRS830

    returns:
            (int): 1 for internal, 0 for external.


    """
    return int(lockin.query("fmod?").split("\n")[0])