def filter_and_rename_dict(indict, filterdict):
    """
    Renames the  keys of the input  dict using the filterdict.
    Keys not present in the filterdict will be removed.

    Example:
        >>> import pprint
        >>> outdict =filter_and_rename_dict({'a': 1, 'b':[2,2]}, {'a': 'c', 'b': 'd', 'e': 'f'})
        >>> pprint.pprint(outdict)
        {'c': 1, 'd': [2, 2]}

    """
    outdict = {
        filterdict[k]: v
        for k, v in indict.items()
        if ((v is not None) and (k in filterdict.keys()))
    }

    return outdict