def clean_locals(params):
    """
    Clean up locals dict, remove empty and self params.

    :param params: locals dicts from a function.
    :type params: dict
    :returns: cleaned locals dict to use as params for functions
    :rtype: dict
    """
    return dict((k, v) for k, v in params.items() if v is not None and k != 'self')