:param name: `class`:`str`, container name
        :return: `class`:`bool`, return True if delete success, otherwise return False
358279
def delete_container_2(self, name):
        
        code, container = self.get_container(name)
        if code == httplib.NOT_FOUND:
            return True
        elif code != httplib.OK:
            self.logger.error("Container %s on %s not exists. %d", name, self._host, code)
            return False

        if container.status.Running:
            code, message = self.change_container(name)
            if code != httplib.OK:
                self.logger.error("Stop container %s on %s error, status code %d, message %s", name, self._host, code,
                                  objson.dumps(message))
                return False

        code, message = self.delete_container(name)
        if code != httplib.OK:
            self.logger.error("Delete container %s on %s error, status code %d, message %s", name, self._host, code,
                              objson.dumps(message))
            return False
        return True
1155973
def get_class(classname, all=False):
    
    try:
        classes = _registry[classname]
    except KeyError:
        raise RegistryError('Class with name {!r} was not found. You may need '
            'to import the class.'.format(classname))
    if len(classes) > 1:
        if all:
            return _registry[classname]
        raise RegistryError('Multiple classes with name {!r} '
            'were found. Please use the full, '
            'module-qualified path.'.format(classname))
    else:
        return _registry[classname][0]
1286315
def _class_exists(self, classname, namespace):
        
        class_repo = self._get_class_repo(namespace)
        return classname in class_repo
1087191
def get_containers_by_name(self, name):
        
        code, containers = self.get_containers()

        if code != httplib.OK:
            return []

        return [container for container in containers if
                any(map(lambda x: x.startswith(name), container.Names))]
812714
def info(name):
    '''
    
    '''
    if not exists(name):
        raise ContainerNotExists("The container (%s) does not exist!" % name)
    cmd = ['lxc-info', '-n', name]
    out = subprocess.check_output(cmd).splitlines()
    info = {}
    for line in out:
        k, v = line.split()
        info[k] = v
    return info
1004973
def is_name_registered( self, name ):
        
        name_rec = self.get_name( name )    # won't return the name if expired
        if name_rec is None:
            return False 

        if name_rec['revoked']:
            return False

        return True
419937
def name(self):
        
        if not hasattr(self, '_name'):
            self._name = re.search('[a-z]+\.([a-z]+)\.([a-z]+)', str(self.__class__), re.IGNORECASE).group(2)

        return self._name
1049099
def remove(self, name_or_klass):
        
        _logger().log(5, 'removing mode %r', name_or_klass)
        mode = self.get(name_or_klass)
        mode.on_uninstall()
        self._modes.pop(mode.name)
        return mode
342159
def installed(self, name):
        
        logger.debug("name: %s", name)

        self._installed[name] = True
        return name
520128
public static boolean isClass(String name)
  {
    if(name == null) {
      return false;
    }
    Matcher matcher = CLASS_NAME_PATTERN.matcher(name);
    return matcher.find();
  }
551586
def delete(self, container, del_objects=False):
        
        return self._manager.delete(container, del_objects=del_objects)
38578
def has_image(self, image_name):
        

        try:
            self.docker_client.images.get(image_name)
            return True
        except docker.errors.ImageNotFound:
            return False
368079
def has_class(self, classname):
        
        def element_has_class():
            """Wrapper to test if element has a class"""
            pattern = re.compile('(\s|^){classname}(\s|$)'.format(classname=classname))
            classes = self.element.get_attribute('class')
            matches = re.search(pattern, classes)

            if matches is not None:
                return True
            return False

        return self.execute_and_handle_webelement_exceptions(
            element_has_class,
            'check for element class "{}"'.format(classname)
        )
64476
def delete_image(self, name: str) -> None:
        
        logger.debug("deleting Docker image: %s", name)
        path = "docker/images/{}".format(name)
        response = self.__api.delete(path)
        if response.status_code != 204:
            try:
                self.__api.handle_erroneous_response(response)
            except Exception:
                logger.exception("failed to delete Docker image: %s", name)
                raise
        else:
            logger.info("deleted Docker image: %s", name)
526482
def GetClass(self, *args, **kwargs):
        

        cname = args[0] if args else kwargs['ClassName']
        try:
            cc = self.classes[self.default_namespace][cname]
        except KeyError:
            if self.conn is None:
                ce = CIMError(CIM_ERR_NOT_FOUND, cname)
                raise ce
            cc = self.conn.GetClass(*args, **kwargs)
            try:
                self.classes[self.default_namespace][cc.classname] = cc
            except KeyError:
                self.classes[self.default_namespace] = \
                    NocaseDict({cc.classname: cc})
        if 'LocalOnly' in kwargs and not kwargs['LocalOnly']:
            if cc.superclass:
                try:
                    del kwargs['ClassName']
                except KeyError:
                    pass
                if args:
                    args = args[1:]
                super_ = self.GetClass(cc.superclass, *args, **kwargs)
                for prop in super_.properties.values():
                    if prop.name not in cc.properties:
                        cc.properties[prop.name] = prop
                for meth in super_.methods.values():
                    if meth.name not in cc.methods:
                        cc.methods[meth.name] = meth
        return cc
636640
def has_value_name(self, name):
        
        for val, _ in self._values:
            if val == name:
                return True
        return False
714224
def get_class(self, name):
        
        for i in self.get_classes():
            if i.get_name() == name:
                return i
        return None