Guesses the variable_name of an open NetCDF file

def get_var_name(nc):
    """Guesses the variable_name of an open NetCDF file
    """

    non_variable_names = [
        'lat',
        'lat_bnds',
        'lon',
        'lon_bnds',
        'time',
        'latitude',
        'longitude',
        'bnds'
    ]

    _vars = set(nc.variables.keys())
    _vars.difference_update(set(non_variable_names))
    if len(_vars) == 1:
        return _vars.pop()
    return None