'Get a resource by ID cached under the given resource name.
Allow an API extension to get a previously stored object
within the same API request. This is basically a convenience method
to lookup by ID on the dictionary of all cached resources.
Note that the object data will be slightly stale.
:returns: the cached resource or None if the item is not in the cache'

def cached_resource_by_id(self, resource_id, name=None):

    resources = self.cached_resource(name)
    if (not resources):
        return None
    return resources.get(resource_id)
