@param Map     $map
@param Event[] $domEventsOnce

@return Event[]
357354
public function collect(Map $map, array $domEventsOnce = [])
    {
        return $this->collectValues($map->getEventManager()->getDomEventsOnce(), $domEventsOnce);
    }
889759
public static <K, E> List<E> getAndPutListIfAbsent(final Map<K, List<E>> map, final K key) {
        List<E> v = map.get(key);

        if (v == null) {
            v = new ArrayList<>();
            v = map.put(key, v);
        }

        return v;
    }
59064
@Override
    public synchronized List<EntityAuditEvent> listEvents(String entityId, String startKey, short maxResults)
            throws AtlasException {
        List<EntityAuditEvent> events = new ArrayList<>();
        String myStartKey = startKey;
        if (myStartKey == null) {
            myStartKey = entityId;
        }
        SortedMap<String, EntityAuditEvent> subMap = auditEvents.tailMap(myStartKey);
        for (EntityAuditEvent event : subMap.values()) {
            if (events.size() < maxResults && event.getEntityId().equals(entityId)) {
                events.add(event);
            }
        }
        return events;
    }
757449
public function showAction(Map $map = null)
    {
        $categoriesArray = [];

        // get current map
        /* @var Map $map */
        $map = $map ?? $this->mapRepository->findByUid($this->settings['map']);

        // find addresses
        $addresses = $map->getAddresses();

        // no addresses related to the map, try to find some from the storagePid
        if($addresses->count() === 0 && $this->settings['storagePid']) {
            $pid = str_ireplace('this', $GLOBALS['TSFE']->id, $this->settings['storagePid']);
            $addresses = $this->addressRepository->findAllAddresses($map, $pid);
        }

        // get categories
        if ($map->isShowCategories()) {
            foreach ($addresses as $address) {
                /* @var \Clickstorm\GoMapsExt\Domain\Model\Address $address */
                $addressCategories = $address->getCategories();
                /* @var \Clickstorm\GoMapsExt\Domain\Model\Category $addressCategory */
                foreach ($addressCategories as $addressCategory) {
                    $categoriesArray[$addressCategory->getUid()] = $addressCategory;
                }
            }
        }

        $this->view->assignMultiple([
            'request' => $this->request->getArguments(),
            'map' => $map, 'addresses' => $addresses,
            'categories' => $categoriesArray,
            'googleMapsLibrary' => $this->googleMapsLibrary
        ]);
    }
889864
public function onEndMap(Map $map)
    {
        $jbmap = $this->jukeboxService->getFirst();
        if ($jbmap) {
            try {
                $this->factory->getConnection()->chooseNextMap($jbmap->getMap()->fileName);
                $this->jukeboxService->removeMap($jbmap->getMap(), null, true);
            } catch (\Exception $e) {
                $this->jukeboxService->removeMap($jbmap->getMap(), null, true);
            }
        }
    }
249461
public function collect(Map $map, array $circles = [])
    {
        return $this->collectValues($map->getOverlayManager()->getCircles(), $circles);
    }
330769
public static function map(array $object, array $map)
    {
        $result = [];

        foreach ($map as $from => $to) {
            if ( ! isset($object[$from])) {
                continue;
            }

            $result[$to] = $object[$from];
        }

        return $result;
    }
796691
function getEvent(context, eventName) {
  if (!eventsMap.has(context)) {
    eventsMap.set(context, {});
  }
  const events = eventsMap.get(context);
  if (!events[eventName]) {
    events[eventName] = {
      listeners: [],
      meta: new WeakMap()
    };
  }
  return events[eventName];
}
1291797
protected Set<AggregatedGroupMapping> getGroupsForEvent(PortalEvent event) {
        final Set<AggregatedGroupMapping> groupMappings =
                new LinkedHashSet<AggregatedGroupMapping>();

        if (event instanceof LoginEvent) {
            for (final String groupKey : ((LoginEvent) event).getGroups()) {
                final AggregatedGroupMapping groupMapping =
                        this.aggregatedGroupLookupDao.getGroupMapping(groupKey);
                if (groupMapping != null) {
                    groupMappings.add(groupMapping);
                }
            }
        } else {
            final String userName = event.getUserName();
            final IGroupMember groupMember =
                    this.compositeGroupService.getGroupMember(userName, IPerson.class);
            for (@SuppressWarnings("unchecked")
                    final Iterator<IEntityGroup> containingGroups =
                            this.compositeGroupService.findParentGroups(groupMember);
                    containingGroups.hasNext(); ) {
                final IEntityGroup group = containingGroups.next();
                final AggregatedGroupMapping groupMapping =
                        this.aggregatedGroupLookupDao.getGroupMapping(
                                group.getServiceName().toString(), group.getName());
                groupMappings.add(groupMapping);
            }
        }

        return groupMappings;
    }
650406
public function collect(Map $map, array $coordinates = [])
    {
        if (!$map->isAutoZoom()) {
            $coordinates = $this->collectValue($map->getCenter(), $coordinates);
        }

        foreach ($this->boundCollector->collect($map) as $bound) {
            if ($bound->hasCoordinates()) {
                $coordinates = $this->collectValue($bound->getSouthWest(), $coordinates);
                $coordinates = $this->collectValue($bound->getNorthEast(), $coordinates);
            }
        }

        foreach ($this->circleCollector->collect($map) as $circle) {
            $coordinates = $this->collectValue($circle->getCenter(), $coordinates);
        }

        foreach ($this->infoWindowCollector->collect($map) as $infoWindow) {
            if ($infoWindow->hasPosition()) {
                $coordinates = $this->collectValue($infoWindow->getPosition(), $coordinates);
            }
        }

        foreach ($this->markerCollector->collect($map) as $marker) {
            $coordinates = $this->collectValue($marker->getPosition(), $coordinates);
        }

        foreach ($this->polygonCollector->collect($map) as $polygon) {
            $coordinates = $this->collectValues($polygon->getCoordinates(), $coordinates);
        }

        foreach ($this->polylineCollector->collect($map) as $polyline) {
            $coordinates = $this->collectValues($polyline->getCoordinates(), $coordinates);
        }

        foreach ($this->heatmapLayerCollector->collect($map) as $heatmapLayer) {
            $coordinates = $this->collectValues($heatmapLayer->getCoordinates(), $coordinates);
        }

        return $coordinates;
    }
1338628
@Override
  public void from(Map<KEY, VALUE> map) {
    getMap().putAll(nullSafeMap(map));
  }
222221
protected function buildJsonAttributes(array $map): array
    {
        $result = [];

        foreach ($map as $jsonKey => $value) {
            if ($value !== null) {
                $result[$jsonKey] = $value;
            }
        }

        return $result;
    }
637460
def get_event_list(config):
    """"""
    eventinstances = session_request(
        config.session.post, device_event_url.format(
            proto=config.web_proto, host=config.host, port=config.port),
        auth=config.session.auth, headers=headers, data=request_xml)

    raw_event_list = _prepare_event(eventinstances)

    event_list = {}
    for entry in MAP + METAMAP:
        instance = raw_event_list
        try:
            for item in sum(entry[MAP_BASE].values(), []):
                instance = instance[item]
        except KeyError:
            continue
        event_list[entry[MAP_TYPE]] = instance

    return event_list
268371
private static List<Parameter> convert(Map<String, Object> map) {
		Set<Entry<String, Object>> entries = map.entrySet();
		List<Parameter> parameters = new ArrayList<>(entries.size());
		for (Entry<String, Object> entry : entries) {
			if (entry.getValue() != null) {
				parameters.add(new Parameter(entry.getKey(), entry.getValue().toString()));
			}
		}
		return parameters;
	}
446439
@SuppressWarnings("unchecked")
  public Map<BsonValue, ChangeEvent<BsonDocument>> getEvents() {
    nsLock.readLock().lock();
    final Map<BsonValue, ChangeEvent<BsonDocument>> events;
    try {
      events = new HashMap<>(this.events);
    } finally {
      nsLock.readLock().unlock();
    }

    nsLock.writeLock().lock();
    try {
      this.events.clear();
      return events;
    } finally {
      nsLock.writeLock().unlock();
    }
  }
390873
public void setMap(Map<String, Object> map) {
        eventMap.clear();
        eventMap.putAll(map);
    }
579162
public function collect(Map $map, array $polygons = [])
    {
        return $this->collectValues($map->getOverlayManager()->getPolygons(), $polygons);
    }