Create a registry object that stores/manages bids while be held in queue for Prebid Cache.
@returns registry object with defined accessor functions
967328
function createBidCacheRegistry() {
  let registry = {};

  function setupRegistrySlot(auctionId) {
    registry[auctionId] = {};
    registry[auctionId].bidStorage = new Set();
    registry[auctionId].queueDispatcher = createDispatcher(queueTimeDelay);
    registry[auctionId].initialCacheKey = utils.generateUUID();
  }

  return {
    addBid: function (bid) {
      // create parent level object based on auction ID (in case there are concurrent auctions running) to store objects for that auction
      if (!registry[bid.auctionId]) {
        setupRegistrySlot(bid.auctionId);
      }
      registry[bid.auctionId].bidStorage.add(bid);
    },
    removeBid: function (bid) {
      registry[bid.auctionId].bidStorage.delete(bid);
    },
    getBids: function (bid) {
      return registry[bid.auctionId] && registry[bid.auctionId].bidStorage.values();
    },
    getQueueDispatcher: function(bid) {
      return registry[bid.auctionId] && registry[bid.auctionId].queueDispatcher;
    },
    setupInitialCacheKey: function(bid) {
      if (!registry[bid.auctionId]) {
        registry[bid.auctionId] = {};
        registry[bid.auctionId].initialCacheKey = utils.generateUUID();
      }
    },
    getInitialCacheKey: function(bid) {
      return registry[bid.auctionId] && registry[bid.auctionId].initialCacheKey;
    }
  }
}
752906
function Registry(opt_options) {
  if (!(this instanceof Registry)) {
    return new Registry(opt_options);
  }
  opt_options = opt_options || {};

  this.breakOnError = opt_options.breakOnError || false;
  this.depth = opt_options.depth || 10;

  // regex to match "$schema.*"
  this._match = /"\$id:[a-z0-9_-]*"/ig;
  // regex to escape strings for usage as regex
  this._escape = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;

  this.schemas = {};
}
379468
protected function setModelRegistryCriteria()
    {
        $prefix = $this->query->getModelRegistry('primary_prefix', 'a');

        $this->setModelRegistryCatalogTypeIdCriteria($prefix);
        $this->setModelRegistryExtensionInstanceIdCriteria($prefix);
        $this->setModelRegistryMenuIdCriteria($prefix);
        $this->setModelRegistryStatusCriteria($prefix);

        return $this;
    }
481079
private function buildRegistryFromObject()
    {
        if (!($this->entity instanceof DomainObjectInterface)) {
            throw new \Exception('EntityRegistry have to implement DomainObjectInterface', 1);
        }
        $this->classname = get_class($this->entity);

        $identifier = new Registry();
        $this->registries[] = $identifier->setType($this->classname)->setKey('identifier')->setValue($this->entity->getObjectIdentifier());

        foreach ($this->entity->getObjectProperties() as $key => $value) {
            $registry = new Registry();
            $this->registries[] = $registry->setType($this->classname)->setKey($key)->setValue($value)->setScope($this->entity->getObjectIdentifier());
        }
    }
148162
protected function registerRegistry()
    {
        $app = app();

		$this->app->singleton('registry', function ($app) {

			$config = $app->config->get('registry', array());

			return new Registry($app['db'], $app['registry.cache'], $config);

		});

    }
422275
public PropertyEditorRegistry getPropertyEditorRegistry() {
        final HttpServletRequest servletRequest = getCurrentRequest();
        PropertyEditorRegistry registry = (PropertyEditorRegistry) servletRequest.getAttribute(GrailsApplicationAttributes.PROPERTY_REGISTRY);
        if (registry == null) {
            registry = new PropertyEditorRegistrySupport();
            PropertyEditorRegistryUtils.registerCustomEditors(this, registry, RequestContextUtils.getLocale(servletRequest));
            servletRequest.setAttribute(GrailsApplicationAttributes.PROPERTY_REGISTRY, registry);
        }
        return registry;
    }
1087850
@Override
    public RegistrationManager getRegistrationManager(){
        if(registrationManager == null){
            synchronized(this){
                if(registrationManager == null){
                    RegistrationManagerImpl registration = new RegistrationManagerImpl(getDirectoryServiceClientManager());
                    registration.start();
                    registrationManager = registration;
                }
            }
        }
        return registrationManager;
    }
571399
function downloadRegistry() {
        if (pendingDownloadRegistry) {
            return pendingDownloadRegistry.promise();
        }

        pendingDownloadRegistry = new $.Deferred();

        $.ajax({
            url: brackets.config.extension_registry,
            dataType: "json",
            cache: false
        })
            .done(function (data) {
                exports.hasDownloadedRegistry = true;
                Object.keys(data).forEach(function (id) {
                    if (!extensions[id]) {
                        extensions[id] = {};
                    }
                    extensions[id].registryInfo = data[id];
                    synchronizeEntry(id);
                });
                exports.trigger("registryDownload");
                pendingDownloadRegistry.resolve();
            })
            .fail(function () {
                pendingDownloadRegistry.reject();
            })
            .always(function () {
                // Make sure to clean up the pending registry so that new requests can be made.
                pendingDownloadRegistry = null;
            });

        return pendingDownloadRegistry.promise();
    }
1015451
def register(cls):
    
    definition_name = make_definition_name(cls.__name__)
    REGISTRY[definition_name] = cls
    return cls
136166
public Registry getRegistry() throws RemoteException {
        if (registry == null) {
            if (StringUtils.hasText(host)) {
                registry = LocateRegistry.getRegistry(host, port);
            } else {
                registry = LocateRegistry.getRegistry(port);
            }
        }

        return registry;
    }
329691
function CacheManager() {
  var self = this;
  self.caches = {};

  Object.defineProperty(self, 'stats', {
    get: function () {
      return Object.keys(self.caches).reduce(function(a,region){
        a[region] = self.caches[region].stats;
        return a;
      },{});
    }
  });
}
24526
protected function generateRegistryItemKey() {
		
		if (!count($this->filteredBy)) {
			return null;
		}
		return md5($this->grid->id . CJSON::encode($this->filteredBy));
	}
961872
@SuppressWarnings("unchecked")
    public static <E> ServiceRegistry<E> getInstance() {
        if (instance == null) {
            synchronized (ServiceRegistry.class) {
                if (instance == null) {
                    instance = new ServiceRegistry<E>();
                }
            }
        }
        return instance;
    }
212463
private function buildStdClass()
    {
        foreach ($this->registries as $registry) {
            $this->entity->{$registry->getKey()} = $registry->getValue();
        }
    }
708000
def create_from_registration(cls, reg, **kwargs):
        '''
        
        '''
        submissionUser = kwargs.pop('submissionUser', None)
        collectedByUser = kwargs.pop('collectedByUser', None)
        status = kwargs.pop('status',Invoice.PaymentStatus.unpaid)

        new_invoice = cls(
            firstName=reg.firstName,
            lastName=reg.lastName,
            email=reg.email,
            grossTotal=reg.totalPrice,
            total=reg.priceWithDiscount,
            submissionUser=submissionUser,
            collectedByUser=collectedByUser,
            buyerPaysSalesTax=getConstant('registration__buyerPaysSalesTax'),
            status=status,
            data=kwargs,
        )

        if isinstance(reg, Registration):
            new_invoice.finalRegistration = reg
            ter_set = reg.eventregistration_set.all()
        elif isinstance(reg, TemporaryRegistration):
            new_invoice.temporaryRegistration = reg
            ter_set = reg.temporaryeventregistration_set.all()
        else:
            raise ValueError('Object passed is not a registration.')

        new_invoice.calculateTaxes()
        new_invoice.save()

        # Now, create InvoiceItem records for each EventRegistration
        for ter in ter_set:
            # Discounts and vouchers are always applied equally to all items at initial
            # invoice creation.
            item_kwargs = {
                'invoice': new_invoice,
                'grossTotal': ter.price,
            }

            if new_invoice.grossTotal > 0:
                item_kwargs.update({
                    'total': ter.price * (new_invoice.total / new_invoice.grossTotal),
                    'taxes': new_invoice.taxes * (ter.price / new_invoice.grossTotal),
                    'fees': new_invoice.fees * (ter.price / new_invoice.grossTotal),
                })
            else:
                item_kwargs.update({
                    'total': ter.price,
                    'taxes': new_invoice.taxes,
                    'fees': new_invoice.fees,
                })

            if isinstance(ter,TemporaryEventRegistration):
                item_kwargs['temporaryEventRegistration'] = ter
            elif isinstance(ter,EventRegistration):
                item_kwargs['finalEventRegistration'] = ter

            this_item = InvoiceItem(**item_kwargs)
            this_item.save()

        return new_invoice
699573
function injectRegistry(entry) {
  const extraFiles = [registryFile, actBuildInfoFile, actMetaData];
  // build also the registry
  if (typeof entry === 'string') {
    return extraFiles.concat(entry);
  }
  const transformed = {};
  Object.keys(entry).forEach((eentry) => {
    transformed[eentry] = extraFiles.concat(entry[eentry]);
  });
  return transformed;
}
591194
CapabilityRegistry createShadowCopy() {
        CapabilityRegistry result = new CapabilityRegistry(forServer, this);
        readLock.lock();
        try {
            try {
                result.writeLock.lock();
                copy(this, result);
            } finally {
                result.writeLock.unlock();
            }
        } finally {
            readLock.unlock();
        }
        return result;
    }