Create multiple containers using array of properties, where at least name is required

@param array $containers
@param bool  $check_exist If true, throws error if the container already exists

@return array
164722
public function createContainers($containers = [], $check_exist = false)
    {
        if (empty($containers)) {
            return [];
        }

        $out = [];
        foreach ($containers as $key => $folder) {
            try {
                // path is full path, name is relative to root, take either
                $out[$key] = $this->createContainer($folder, $check_exist);
            } catch (\Exception $ex) {
                // error whole batch here?
                $out[$key]['error'] = ['message' => $ex->getMessage(), 'code' => $ex->getCode()];
            }
        }

        return $out;
    }
1262093
public function pushContainer(array $container)
    {
        if (!empty($container['required'])) {
            $this->hasRequired = true;
        }
        if (empty($this->containers)) {
            $this->array      += $container;
            $this->containers  = array(&$this->array['elements']);
        } else {
            $cntIndex = count($this->containers) - 1;
            $myIndex  = count($this->containers[$cntIndex]);
            $this->containers[$cntIndex][$myIndex] = $container;
            $this->containers[$cntIndex + 1] =& $this->containers[$cntIndex][$myIndex]['elements'];
        }
    }
734813
public static function getContainers()
    {
        if (self::$containers === null) {
            self::$containers = (new Query())->select(['id', 'name', 'alias'])->from('cms_nav_container')->where(['is_deleted' => false])->indexBy('id')->orderBy(['cms_nav_container.id' => 'ASC'])->all();
        }
        
        return self::$containers;
    }
219970
def createCompoundFromChecked(self):
        
        checked_entries = self.checkedEntries()
        
        if len(checked_entries) <= 1:
            return QueryCompound()
        
        self.setUpdatesEnabled(False)
        joiner = self.currentJoiner()
        query = Query()
        for entry in checked_entries:
            if joiner == QueryCompound.Op.And:
                query &= entry.query()
            else:
                query |= entry.query()
        
        # clear out the existing containers
        first = checked_entries[0]
        first.setQuery(query)
        first.setChecked(False)
        
        layout = self._entryWidget.layout()
        for i in range(len(checked_entries) - 1, 0, -1):
            w = checked_entries[i]
            layout.takeAt(layout.indexOf(w))
            w.close()
        
        self.refreshEntries()
        self.setUpdatesEnabled(True)
        
        if not self.signalsBlocked():
            self.enterCompound(first, query)
873244
public static function checkbox(string $description, $options, $default = null, bool $allowExit = true): array
    {
        return self::multiSelect($description, $options, $default, $allowExit);
    }
1003930
public function getContainers(array $parameters = array())
    {
        $result = array();

        foreach ($this->getContainersInfo($parameters) as $info) {
            $result[] = new Container($this, $info['name'], $info['count'], $info['bytes']);
        }

        return $result;
    }
743430
def container_present(name, profile):
    '''
    
    '''
    containers = __salt__['libcloud_storage.list_containers'](profile)
    match = [z for z in containers if z['name'] == name]
    if match:
        return state_result(True, "Container already exists", name, {})
    else:
        result = __salt__['libcloud_storage.create_container'](name, profile)
        return state_result(True, "Created new container", name, result)
380959
protected function check($name, $check = '')
    {
        if (!isset($this->keyMap[$name])) {
            return false;
        }
        return ($this->keyMap[$name]['checksum'] === $this->generateNewChecksum($check));
    }
871750
private function doChecks($checks)
    {
        $errors = [];
        foreach ($checks as $check) {
            try {
                $check();
            } catch (Exception $e) {
                $errors[] = $e;
            }
        }
        if (count($errors)) {
            throw (new MultipleExceptions)->setExceptions($errors);
        }
    }
467118
private function AddCreateContainersField()
    {
        $name = 'CreateContainers';
        $this->AddField(new Checkbox($name, $name, (bool)$this->group->GetCreateContainers()));
    }
1011360
private function ensure_mailboxes_exist() {

        $requiredmailboxes = array(
            self::MAILBOX,
            $this->get_confirmation_folder(),
        );

        $existingmailboxes = $this->client->listMailboxes($requiredmailboxes);
        foreach ($requiredmailboxes as $mailbox) {
            if (isset($existingmailboxes[$mailbox])) {
                // This mailbox was found.
                continue;
            }

            mtrace("Unable to find the '{$mailbox}' mailbox - creating it.");
            $this->client->createMailbox($mailbox);
        }
    }
1097976
public function deleteBlob($container = '', $name = '', $noCheck = false)
    {
        $this->checkConnection();
        try {
            /** @var Container $container */
            $container = $this->blobConn->getContainer($container);
            if (empty($container)) {
                throw new \Exception("No container named '$container'");
            }

            $obj = null;
            try {
                $obj = $container->DataObject($name);
            } catch (\Exception $ex) {
                if ($noCheck) {
                    return;
                }
                throw $ex;
            }
            if ($obj) {
                $obj->Delete();
            }
        } catch (\Exception $ex) {
            static::handleGuzzleException($ex);
            if ($ex instanceof ObjFetchError) {
                throw new NotFoundException("File '$name' was not found.'");
            }
            throw new DfException('Failed to delete blob "' . $name . '": ' . $ex->getMessage());
        }
    }
233645
public function createContains(): \Contains
    {
        $num = array_push($this->contains, new Contains());

        return $this->contains[$num - 1];
    }
792297
def containers
      if @containers.nil? && !info[:containers].nil?
        @containers = []
        info[:containers].each do |uri|
          @containers.push(client.containers.get_from_uri(uri))
        end
      end
      @containers
    end
1226690
private function createContainer(array $files)
    {
        $containerBuilder = new Container();
        $loader = $this->createLoader($containerBuilder);
        foreach ($files as $file) {
            $loader->load($file);
        }

        return $containerBuilder;
    }
778153
def create(name, config_file=None, template=None, backing_store=None, template_options=None):
    '''
    
    
    '''
    if exists(name):
        raise ContainerAlreadyExists("The Container %s is already created!" % name)
    cmd = 'lxc-create -n %s' % name

    if config_file:
        cmd += ' -f %s' % config_file
    if template:
        cmd += ' -t %s' % template
    if backing_store:
        cmd += ' -B %s' % backing_store
    if template_options:
        cmd += '-- %s' % template_options

    if subprocess.check_call('%s >> /dev/null' % cmd, shell=True) == 0:
        if not exists(name):
            _logger.critical("The Container %s doesn't seem to be created! (options: %s)", name, cmd[3:])
            raise ContainerNotExists("The container (%s) does not exist!" % name)

        _logger.info("Container %s has been created with options %s", name, cmd[3:])
        return 0
    else:
        return 1
264254
public function setChecks(array $checks)
    {
        $this->checks = array();

        foreach ($checks as $check) {
            $this->addCheck($check);
        }
    }