Checks if container exists already
335295
def container_exists(self, id=None, name=None):
        
        exists = False
        if id and self.container_by_id(id):
            exists = True
        elif name and self.container_by_name(name):
            exists = True

        return exists
704928
def exists(name, path=None):
    '''
    
    '''

    _exists = name in ls_(path=path)
    # container may be just created but we did cached earlier the
    # lxc-ls results
    if not _exists:
        _exists = name in ls_(cache=False, path=path)
    return _exists
579399
public function hasActualContainer(): bool
    {
        if (false === $this->environment->isDebug())
        {
            return true === $this->configCache()->isFresh();
        }

        return false;
    }
1218492
def exists(self):
        
        t = self.wait_timeout
        self.wait_timeout = 0
        try:
            self.reload()
            return True
        except NoSuchElementException:
            return False
        finally:
            self.wait_timeout = t
325088
public function containerExists($container = '')
    {
        $this->checkConnection();

        try {
            /** @var Container $container */
            $container = $this->blobConn->getContainer($container);

            return !empty($container);
        } catch (\Exception $ex) {
            if ($ex instanceof ClientErrorResponseException) {
                if ($ex->getCode() === 404 || str_contains($ex->getMessage(), '404')) {
                    return false;
                }
            }
            static::handleGuzzleException($ex);
            throw new DfException('Failed to list containers: ' . $ex->getMessage());
        }
    }
1035578
def exists(*nictag, **kwargs):
    '''
    
    '''
    ret = {}
    if not nictag:
        return {'Error': 'Please provide at least one nictag to check.'}

    cmd = 'nictagadm exists -l {0}'.format(' '.join(nictag))
    res = __salt__['cmd.run_all'](cmd)

    if not kwargs.get('verbose', False):
        ret = res['retcode'] == 0
    else:
        missing = res['stderr'].splitlines()
        for nt in nictag:
            ret[nt] = nt not in missing

    return ret
1289407
def url_is_unique
      if container.is_a?(Page) && url.present?
        url_exists = Ninetails::Container.
          where.not(id: container.id).
          includes(:current_revision).
          where(ninetails_revisions: { url: url }).
          exists?

        errors.add :url, "is already in use" if url_exists
      end
    end
1014554
public function exists($name): bool
    {
        return Container::getCache()->get($this->getCacheKey($name)) === null;
    }
1328953
def parents_exist?(yml, key)
      exists = true
      Array(yml[key]['extends']).each do |parent|
        unless yml.key?(parent)
          exists = false unless
          Squib.logger.error "Processing layout: '#{key}' attempts to extend a missing '#{yml[key]['extends']}'"
        end
      end
      return exists
    end
1302219
def _check_object_exists(self):
        
        if not DB.get_keys(self.key):
            raise KeyError("Object with key '{}' not exist".format(self.key))
588919
function (item, container) {
            if (item && !ariaUtilsArray.contains(container, item)) {
                container.push(item);
            }
        }
253195
def exists(cls, id):
        """"""
        return bool(redisco.get_client().exists(cls._key[str(id)]) or
                    redisco.get_client().sismember(cls._key['all'], str(id)))
832202
function (cb) {
			o1._client.createContainer(sName, function (err, _container) {
				if (err)
					return cb(err);

				// check that a parallel operation didn't just add the same container
				container = _.find(o1.aContainers, { name : sName });

				if (!container) {
					o1.aContainers.push(_container);
					container = _container;
				}

				cb();
			});
		}
256663
public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = false)
    {
        if (is_string($name) && $this->container->has($name)) {
            return true;
        } elseif (parent::has($name, $checkAbstractFactories, $usePeeringServiceManagers)) {
            return true;
        }

        return false;
    }
923242
public function offsetExists($key)
    {
        return isset($this->container[$key]) || \array_key_exists($key, $this->container);
    }
378153
function(cb) {
          docker.listContainers({
            all : 1,
          // filters: '{"status":["running"]}'
          }, function(err, containers) {
            if (err) {
              return cb(err);
            }

            var container = null;

            for (var c = 0; c < containers.length; c++) {
              if (containers[c].Image.indexOf(utils.qualifiedImageName(tag,
                  options.registry, null)) === 0) {
                // If the current container is running or terminated
                if (utils.getContainerStatus(containers[c]) === "RUNNING"
                    || utils.getContainerStatus(containers[c]) === "STOPPED") {
                  container = containers[c];
                  break;
                }
              }
            }

            cb(null, container);
          });
        }
723829
def _check_if_tag_already_exists(self):
        """"""
        version = self.data['new_version']
        if self.vcs.tag_exists(version):
            return True
        else:
            return False