returns a merged entryset containing within both the container and cache entrysets
330727
public Set<Entry<String, T>> entrySet() {
		// prepare the container
		HashSet<Entry<String, T>> set = new HashSet<Entry<String, T>>();
		// add the set from our container
		set.addAll(container.entrySet());
		// add the set from our cache
		set.addAll(cache.entrySet());
		
		return set;
	}
34047
public synchronized Set<java.util.Map.Entry<String, XAttribute>> entrySet() {
		if(backingStore != null) {
			return backingStore.entrySet();
		} else {
			return EMPTY_ENTRYSET;
		}
	}
196598
def containers(self):
        
        return [
            self.client.containers.get(cid) for cid in
            (self.attrs.get('Containers') or {}).keys()
        ]
525299
def merge(left, right):
    
    merged = {}

    left_keys = frozenset(left)
    right_keys = frozenset(right)

    # Items only in the left Mapping
    for key in left_keys - right_keys:
        merged[key] = left[key]

    # Items only in the right Mapping
    for key in right_keys - left_keys:
        merged[key] = right[key]

    # in both
    for key in left_keys & right_keys:
        left_value = left[key]
        right_value = right[key]

        if (isinstance(left_value, Mapping) and
                isinstance(right_value, Mapping)):  # recursive merge
            merged[key] = merge(left_value, right_value)
        else:  # overwrite with right value
            merged[key] = right_value

    return merged
429791
def entries(self):
        """"""
        def add(x, y):
            return x + y
        try:
            return reduce(add, list(self.cache.values()))
        except:
            return []
1046031
def cache_key(self):
        
        return '%s:%s' % (super(EntryPublishedVectorBuilder, self).cache_key,
                          Site.objects.get_current().pk)
585477
def merge_duplicates(self):
        
        if len(self.entries) == 0:
            self.log.error("WARNING: `entries` is empty, loading stubs")
            if self.args.update:
                self.log.warning(
                    "No sources changed, entry files unchanged in update."
                    "  Skipping merge.")
                return
            self.entries = self.load_stubs()

        task_str = self.get_current_task_str()

        keys = list(sorted(self.entries.keys()))
        n1 = 0
        mainpbar = tqdm(total=len(keys), desc=task_str)
        while n1 < len(keys):
            name1 = keys[n1]
            if name1 not in self.entries:
                self.log.info("Entry for {} not found, likely already "
                              "deleted in merging process.".format(name1))
                n1 = n1 + 1
                mainpbar.update(1)
                continue
            allnames1 = set(self.entries[name1].get_aliases() + self.entries[
                name1].extra_aliases())

            # Search all later names
            for name2 in keys[n1 + 1:]:
                if name1 == name2:
                    continue
                if name1 not in self.entries:
                    self.log.info("Entry for {} not found, likely already "
                                  "deleted in merging process.".format(name1))
                    continue
                if name2 not in self.entries:
                    self.log.info("Entry for {} not found, likely already "
                                  "deleted in merging process.".format(name2))
                    continue

                allnames2 = set(self.entries[name2].get_aliases() +
                                self.entries[name2].extra_aliases())

                # If there are any common names or aliases, merge
                if len(allnames1 & allnames2):
                    self.log.warning("Found two entries with common aliases "
                                     "('{}' and '{}'), merging.".format(name1,
                                                                        name2))

                    load1 = self.proto.init_from_file(self, name=name1)
                    load2 = self.proto.init_from_file(self, name=name2)
                    if load1 is not None and load2 is not None:
                        # Delete old files
                        self._delete_entry_file(entry=load1)
                        self._delete_entry_file(entry=load2)
                        self.entries[name1] = load1
                        self.entries[name2] = load2
                        priority1 = 0
                        priority2 = 0
                        for an in allnames1:
                            if an.startswith(self.entries[name1]
                                             .priority_prefixes()):
                                priority1 += 1
                        for an in allnames2:
                            if an.startswith(self.entries[name2]
                                             .priority_prefixes()):
                                priority2 += 1

                        if priority1 > priority2:
                            self.copy_to_entry_in_catalog(name2, name1)
                            keys.append(name1)
                            del self.entries[name2]
                        else:
                            self.copy_to_entry_in_catalog(name1, name2)
                            keys.append(name2)
                            del self.entries[name1]
                    else:
                        self.log.warning('Duplicate already deleted')

                    # if len(self.entries) != 1:
                    #     self.log.error(
                    #         "WARNING: len(entries) = {}, expected 1.  "
                    #         "Still journaling...".format(len(self.entries)))
                    self.journal_entries()

            if self.args.travis and n1 > self.TRAVIS_QUERY_LIMIT:
                break
            n1 = n1 + 1
            mainpbar.update(1)
        mainpbar.close()
736354
def get_cache(self, decorated_function, *args, **kwargs):
		
		has_value = self.has(decorated_function, *args, **kwargs)
		cached_value = None
		if has_value is True:
			cached_value = self.get_result(decorated_function, *args, **kwargs)
		return WCacheStorage.CacheEntry(has_value=has_value, cached_value=cached_value)
177534
def mergeCombiners(self, iterator, limit=None):
        
        if limit is None:
            limit = self.memory_limit
        # speedup attribute lookup
        comb, hfun, objsize = self.agg.mergeCombiners, self._partition, self._object_size
        c, data, pdata, batch = 0, self.data, self.pdata, self.batch
        for k, v in iterator:
            d = pdata[hfun(k)] if pdata else data
            d[k] = comb(d[k], v) if k in d else v
            if not limit:
                continue

            c += objsize(v)
            if c > batch:
                if get_used_memory() > limit:
                    self._spill()
                    limit = self._next_limit()
                    batch /= 2
                    c = 0
                else:
                    batch *= 1.5

        if limit and get_used_memory() >= limit:
            self._spill()
280517
def _merge_cdicts(self, clut, exdict, separator):
    """"""
    if not self._full_cname:
        return
    # Find all callables that are not in self exceptions dictionary
    # and create new tokens for them
    repl_dict = {}
    for key, value in _sorted_keys_items(clut):
        otoken = self._clut.get(key, None)
        if not otoken:
            otoken = str(len(self._clut))
            self._clut[key] = otoken
        repl_dict[value] = otoken
    # Update other dictionaries to the mapping to self
    # exceptions dictionary
    for fdict in exdict.values():
        for entry in fdict.values():
            olist = []
            for item in entry["function"]:
                if item is None:
                    # Callable name is None when callable is
                    # part of exclude list
                    olist.append(None)
                else:
                    itokens = item.split(separator)
                    itokens = [repl_dict.get(itoken) for itoken in itokens]
                    olist.append(separator.join(itokens))
            entry["function"] = olist
391412
public Set<Map.Entry<E,Double>> entrySet() {
    return new AbstractSet<Map.Entry<E,Double>>() {
      @Override
      public Iterator<Entry<E, Double>> iterator() {
        return new Iterator<Entry<E,Double>>() {
          final Iterator<Entry<E,MutableInteger>> inner = map.entrySet().iterator();

          public boolean hasNext() {
            return inner.hasNext();
          }

          public Entry<E, Double> next() {
            return new Map.Entry<E,Double>() {
              final Entry<E,MutableInteger> e = inner.next();

              public E getKey() {
                return e.getKey();
              }

              public Double getValue() {
                return e.getValue().doubleValue();
              }

              public Double setValue(Double value) {
                final double old = e.getValue().doubleValue();
                e.getValue().set(value.intValue());
                totalCount = totalCount - (int)old + value.intValue();
                return old;
              }
            };
          }

          public void remove() {
            throw new UnsupportedOperationException();
          }
        };
      }

      @Override
      public int size() {
        return map.size();
      }
    };
  }
162234
final protected Set common_entrySet() {
        HashSet hs = new HashSet();
        Enumeration vEnum = cache.getAllIds();
        while (vEnum.hasMoreElements()) {
            Object key = vEnum.nextElement();
            hs.add(new DMIEntry(key, get(key)));
        }
        return hs;
    }
20078
@Override
  public Iterable<K> keys() {
    return new Iterable<K>() {
      @Override
      public Iterator<K> iterator() {
        final Iterator<CacheEntry<K,V>> it = BaseCache.this.iterator();
        return new Iterator<K>() {
          @Override
          public boolean hasNext() {
            return it.hasNext();
          }

          @Override
          public K next() {
            return it.next().getKey();
          }

          @Override
          public void remove() {
            throw new UnsupportedOperationException();
          }
        };
      }
    };
  }
846840
public CacheEntry getEntryDisk(Object cacheId) {
		CacheEntry cacheEntry = new CacheEntry(cacheInstance.getEntryDisk(cacheId));	 
		return cacheEntry;
	}
760930
public final Set<Map.Entry<K,V>> entrySet() {

	return new AbstractSet<Map.Entry<K,V>>() {
	    public Iterator<Map.Entry<K,V>> iterator() {
		return entryIterator();
	    }
	    public int size() {
		return size;
	    }
	};
    }
196228
@Override
  public Set<Entry<K, V>> entrySet() {
    expungeStaleEntries();
    Set<Entry<K, V>> result = new LinkedHashSet<>();
    for (final Entry<K, SoftReference<V>> entry : hash.entrySet()) {
      final V value = entry.getValue().get();
      if (value != null) {
        result.add(new Entry<K, V>() {
          @Override
          public K getKey() {
            return entry.getKey();
          }

          @Override
          public V getValue() {
            return value;
          }

          @Override
          public V setValue(V v) {
            entry.setValue(new SoftReference<>(v, queue));
            return value;
          }
        });
      }
    }
    return result;
  }
1025808
def _get_containers(self):
        """"""
        buckets = self.native_conn.get_all_buckets()
        return [self.cont_cls.from_bucket(self, b) for b in buckets]