def check_kwargs(key, caller, **kwargs):
    """ Check if kwargs has a needed field 
    
    Parameters
    ---------- 
    key: `str`
        keyword to look for in kwargs
    
    Returns
    -------
    value
        The value of the kwargs[key]
    params: `dict``
        The params dictionary (without the returned key/value pair)
    
    Raises
    ------
    ValueError
        Raised if the key does not exist in kwargs
    
    """
    if not kwargs.get(key):
        raise ValueError('{} needs to be an argumentwhen instantating a {}.'
            .format(key, caller))
    else:
        value = kwargs.pop(key)
        return value, kwargs
