def _system_parameters ( * * kwargs ) : return { key : value for key , value in kwargs . items ( ) if ( value is not None or value == { } ) }
how to test if a kwarg was supplied in python
Returns system keyword arguments removing Nones .
def _system_parameters(**kwargs):
    """
    Returns system keyword arguments removing Nones.

    Args:
        kwargs: system keyword arguments.

    Returns:
        dict: system keyword arguments.
    """
    return {key: value for key, value in kwargs.items()
            if (value is not None or value == {})}