Remove any keys not in 'keep'

def _filter(self, dict, keep):
        """ Remove any keys not in 'keep' """
        if not keep:
            return dict

        result = {}
        for key, value in dict.iteritems():
            if key in keep:
                result[key] = value
        return result