'Given a dictionary of regex matches from a URLconf, removes
``api_name`` and/or ``resource_name`` if found.
This is useful for converting URLconf matches into something suitable
for data lookup. For example::
Model.objects.filter(**self.remove_api_resource_names(matches))'

def remove_api_resource_names(self, url_dict):

    kwargs_subset = url_dict.copy()
    for key in [u'api_name', u'resource_name']:
        try:
            del kwargs_subset[key]
        except KeyError:
            pass
    return kwargs_subset
