Returns a list of cached instances.
774415
def all(self):
        
        class_list = list(self.get_class_list())
        if not class_list:
            self.cache = []
            return []

        if self.cache is not None:
            return self.cache

        results = []
        for cls_path in class_list:
            module_name, class_name = cls_path.rsplit('.', 1)
            try:
                module = __import__(module_name, {}, {}, class_name)
                cls = getattr(module, class_name)
                if self.instances:
                    results.append(cls())
                else:
                    results.append(cls)
            except Exception:
                logger.exception('Unable to import {cls}'.format(cls=cls_path))
                continue
        self.cache = results

        return results
876260
def cached_per_instance():
    

    def cache_fun(fun):
        argspec = inspect2.getfullargspec(fun)
        arg_names = argspec.args[1:] + argspec.kwonlyargs  # remove self
        kwargs_defaults = get_kwargs_defaults(argspec)
        cache = {}

        def cache_key(args, kwargs):
            return get_args_tuple(args, kwargs, arg_names, kwargs_defaults)

        def clear_cache(instance_key, ref):
            del cache[instance_key]

        @functools.wraps(fun)
        def new_fun(self, *args, **kwargs):
            instance_key = id(self)
            if instance_key not in cache:
                ref = weakref.ref(self, functools.partial(clear_cache, instance_key))
                cache[instance_key] = (ref, {})
            instance_cache = cache[instance_key][1]

            k = cache_key(args, kwargs)
            if k not in instance_cache:
                instance_cache[k] = fun(self, *args, **kwargs)
            return instance_cache[k]

        # just so unit tests can check that this is cleaned up correctly
        new_fun.__cached_per_instance_cache__ = cache
        return new_fun

    return cache_fun
394826
static synchronized CacheInstanceInfo [] getCacheInstanceInfo( CacheServiceImpl cacheService ) {
		CacheInstanceInfo infoOut [] = currentCacheInstanceInfoOut;
		if ( System.currentTimeMillis() - lastPopulate > populateInterval ) {
			if (cacheService!=null) {
				if ( cacheInstanceInfo == null ) {
					cacheInstanceInfo = new CacheInstanceInfo();
				}
				cacheService.populateCacheInstanceInfo( cacheInstanceInfo );
				CacheInstanceInfo.cacheService = cacheService;
				infoOut = new CacheInstanceInfo[allConfigured.size()];
				Iterator i = allConfigured.iterator();
				int x=0;
				while ( i.hasNext() ) {
					String cacheName =  (String)i.next();
					CacheInstanceInfo info = new CacheInstanceInfo();

					info.cacheName      = cacheName;
					info.isActive       = CacheInstanceInfo.allActive.contains(cacheName);
					info.isFactory      = CacheInstanceInfo.allFactory.contains(cacheName);
					info.isFile         = CacheInstanceInfo.allFile.contains(cacheName);
					info.isObjectCache  = CacheInstanceInfo.objectConfigured.contains(cacheName);
					info.isServletCache = CacheInstanceInfo.servletConfigured.contains(cacheName);

					infoOut[x++] = info;
				}
				currentCacheInstanceInfoOut = infoOut;
				CacheInstanceInfo.allConfigured.clear();
				CacheInstanceInfo.allActive.clear();
				CacheInstanceInfo.allFactory.clear();
				CacheInstanceInfo.allFile.clear();
				CacheInstanceInfo.objectConfigured.clear();
				CacheInstanceInfo.servletConfigured.clear();

			}
			lastPopulate = System.currentTimeMillis();
		}
		return infoOut;
	}
1360531
def cached_instance(model, timeout=None, **filters):
    
    if isinstance(model, basestring):
        model = _str_to_model(model)

    cache_key = generate_cache_key(model, **filters)
    return get_cached(cache_key, model.objects.select_related().get, kwargs=filters)
1334381
public <T> List<T> getInstances(Class<T> type) {
		return getInstances(Key.get(type));
	}
238729
def list_instance_profiles(path_prefix='/', region=None, key=None,
                           keyid=None, profile=None):
    '''
    
    '''
    p = get_all_instance_profiles(path_prefix, region, key, keyid, profile)
    return [i['instance_profile_name'] for i in p]
1109794
public java.util.List<com.google.appengine.v1.Instance> getInstancesList() {
    return instances_;
  }
398825
def instances(cls):
        
        l = [i for i in cls.allinstances() if isinstance(i, cls)]
        return l
502405
@Override
    public List<T> getList() {
        if (isCacheEnabled) {
            if (cachedResult == null) {
                cachedResult = makeUnmodifiableUniqueList();
            }
            return cachedResult;
        } else {
            return makeUnmodifiableUniqueList();
        }
    }
552758
def get_vm_instances(instance_id=None):
    """"""
    return get_instances(device_owners=[n_const.DEVICE_OWNER_COMPUTE_PREFIX],
                         vnic_type=portbindings.VNIC_NORMAL,
                         instance_id=instance_id)
1069851
def list(self):
        """"""
        mask = """mask[availableInstanceCount, occupiedInstanceCount,
instances[id, billingItem[description, hourlyRecurringFee]], instanceCount, backendRouter[datacenter]]"""
        results = self.client.call('Account', 'getReservedCapacityGroups', mask=mask)
        return results
155470
public List<T> findAll() {
        if (cache && cachedObjects != null) {
            return cachedObjects;
        }

        List<String> ids = getObjectList();

        List<T> listT = new ArrayList<>();

        for (String id : ids) {
            listT.add(find(id));
        }

        if (cache) {
            cachedObjects = listT;
        }

        return listT;
    }
695078
def iter_instances(self):
        
        for wrkey in set(self.keys()):
            obj = self.get(wrkey)
            if obj is None:
                continue
            yield wrkey, obj
1349057
public static ArrayList getServletCacheInstanceNames() {
        ArrayList list = null;
        if (ServerCache.servletCacheEnabled == false) {
            list = new ArrayList();
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "CacheMonitor: Servlet Cache Service has not been started.");

        } else {
            list = getCacheService().getServletCacheInstanceNames();
        }
        return list;
    }
967848
def list_domain_cache():
    '''
    
    '''
    cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR)
    return cache.list('venafi/domains')
367238
def cached(func, instance, args, kwargs):
    """"""
    cache = getattr(instance, "__cache", None)
    if cache is None:
        instance.__cache = cache = {}
    try:
        return cache[func]
    except KeyError:
        cache[func] = result = func(*args, **kwargs)
        return result
809797
def keys(cls):
        
        if cls._cache_keys is None:
            cls._cache_keys = [c.name for c in cls.__table__._columns]
        return cls._cache_keys