Gets or creates the container.
176603
def _get_container(self):
        
        if not hasattr(self, "_container"):
            if self.use_pyrax:
                self._container = self.connection.create_container(self.container_name)
            else:
                self._container = None
        return self._container
182117
public static function create()
    {
        $request = self::makeRequest();
        $response = self::makeResponse();

        return self::buildProvidersContainer($request, $response);
    }
717338
def container(self, cls, **kwargs):
        """"""
        self.start_container(cls, **kwargs)
        yield
        self.end_container()
1293776
private static function setUp(): Container
    {
        if (!self::$container) {
            //Create Your container
            self::$container = new Container();
        }
        $c = self::$container;

        //$c['settings'] = Configuration::SLIM_SETTINGS['settings'];
        // Not Found Configs
        $c['notFoundHandler'] = function ($c) {
            return function ($request, $response) use ($c) {
                return $c['response']
                        ->withStatus(404)
                        ->withJson([
                            "message" => "Route not found",
                            "status" => "error"
                ]);
            };
        };
        // Not Allowed Methods
        $c['notAllowedHandler'] = function ($c) {
            return function ($request, $response, $methods) use ($c) {
                return $c['response']
                        ->withStatus(405)
                        ->withHeader('Allow', implode(', ', $methods))
                        ->withJson([
                            "message" => 'Method must be one of: ' . implode(', ', $methods),
                            "status" => "error"]);
            };
        };
        // Error 500
        $c['errorHandler'] = function ($c) {
            return function ($request, $response, $exception) use ($c) {
                $dataError = [
                    "message" => 'Something went wrong!',
                    "status" => 'error'
                ];
                if (cfg::htrFileConfigs()->devmode ?? false) {
                    $dataError['error'] = $exception->getMessage();
                }
                return $c['response']
                        ->withStatus(500)
                        ->withJson($dataError);
            };
        };
        // Settings configs
        $c['settings']['addContentLengthHeader'] = false;
        $c['settings']['displayErrorDetails'] = cfg::htrFileConfigs()->devmode ?? false;
        // 
        return $c;
    }
927291
public function getContainer(): ?Container
    {
        if (!$this->hasContainer()) {
            $this->setContainer($this->getDefaultContainer());
        }
        return $this->container;
    }
291045
def get_container_for(self, instance):
        
        if IReferenceAnalysis.providedBy(instance):
            return api.get_uid(instance.getSample())
        return instance.getRequestUID()
411920
def get_container(self, path):
        """"""
        if not settings.container_permitted(path):
            raise errors.NotPermittedException(
                "Access to container \"%s\" is not permitted." % path)
        return self._get_container(path)
1374253
function() {
            var container;
            //first, try get it by `containerDataName`
            if(this.containerDataName) {
                if(container = this.$element.data(this.containerDataName)) {
                    return container;
                }
            }
            //second, try `containerName`
            container = this.$element.data(this.containerName);
            return container;
        }
972274
def buildcontainer(self):
        """"""
        if self.container:
            return
        # Create HTML div with style
        if self.options['chart'].width:
            if str(self.options['chart'].width)[-1] != '%':
                self.div_style += 'width:%spx;' % self.options['chart'].width
            else:
                self.div_style += 'width:%s;' % self.options['chart'].width
        if self.options['chart'].height:
            if str(self.options['chart'].height)[-1] != '%':
                self.div_style += 'height:%spx;' % self.options['chart'].height
            else:
                self.div_style += 'height:%s;' % self.options['chart'].height

        self.div_name = self.options['chart'].__dict__['renderTo'] # recheck div name
        self.container = self.containerheader + \
            '<div id="%s" style="%s">%s</div>\n' % (self.div_name, self.div_style, self.loading)
381043
private CoreContainer createCoreContainer() {

        CoreContainer container = null;
        try {
            // get the core container
            // still no core container: create it
            container = CoreContainer.createAndLoad(
                Paths.get(m_solrConfig.getHome()),
                m_solrConfig.getSolrFile().toPath());
            if (CmsLog.INIT.isInfoEnabled()) {
                CmsLog.INIT.info(
                    Messages.get().getBundle().key(
                        Messages.INIT_SOLR_CORE_CONTAINER_CREATED_2,
                        m_solrConfig.getHome(),
                        m_solrConfig.getSolrFile().getName()));
            }
        } catch (Exception e) {
            LOG.error(
                Messages.get().getBundle().key(
                    Messages.ERR_SOLR_CORE_CONTAINER_NOT_CREATED_1,
                    m_solrConfig.getSolrFile().getAbsolutePath()),
                e);
        }
        return container;

    }
794992
protected function makeNewContainer()
    {
        $container = new Container();
        $container->classSet($this->entityClass);
        $container->setPropertyMapper( PropertyMapperEntityData::class );
        return $container;
    }
164864
private Container createContainer(final FedoraSession session, final String path) {
        try {
            final Node node = findOrCreateNode(session, path, NT_FOLDER);

            if (node.canAddMixin(FEDORA_RESOURCE)) {
                node.addMixin(FEDORA_RESOURCE);
                node.addMixin(FEDORA_CONTAINER);
            }

            return new ContainerImpl(node);
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
1374738
def _get_container_service(container):
    '''
    
    '''
    if 'account_key' in container:
        account = azure.storage.CloudStorageAccount(container['account_name'], account_key=container['account_key'])
    elif 'sas_token' in container:
        account = azure.storage.CloudStorageAccount(container['account_name'], sas_token=container['sas_token'])
    else:
        account = azure.storage.CloudStorageAccount(container['account_name'])
    blob_service = account.create_block_blob_service()
    return blob_service
404185
public function getContainer()
    {
        if (null !== $this->container) {
            throw new ContainerAlreadyExistsException($this->container);
        }

        // Construct container
        $this->container = new Container();
        $this->hydrateContainerWithBootstrapParameters();

        if (false === $this->tryParseContainerDump()) {
            $this->hydrateContainerWithApplicationParameters();
            $this->loadApplicationServices();
        }

        return $this->container;
    }
912489
def create_container(self, container, **kwargs):
        
        try:
            LOG.debug('create_container() with %s is success.', self.driver)
            return self.driver.create_container(container, **kwargs)
        except DriverException as e:
            LOG.exception('create_container() with %s raised\
                            an exception %s.', self.driver, e)
1306223
public function getContainer()
    {
        if (!is_object($this->container)) {
            return $this->container = Container::getInstance();
        }

        return $this->container;
    }
284678
public static ContainerWrapper getContainer(HttpServletRequest request) throws Exception {
		ContainerFinderImp scf = new ContainerFinderImp();
		ServletContext sc = request.getSession().getServletContext();
		return scf.findContainer(new ServletContextWrapper(sc));
	}