Determine whether any of the matched elements are assigned the given class.

@param string $class_name

@return boolean
168669
public function hasClass($class_name)
    {
        foreach ($this->nodes as $node) {
            if ($node instanceof \DOMElement && $node_class_attr = $node->getAttribute('class')) {
                $node_classes = explode(' ', $node_class_attr);
                if (\in_array($class_name, $node_classes, true)) {
                    return true;
                }
            }
        }

        return false;
    }
946483
protected function childrenByInstance($class_name) {
    $matches = [];
    $child = $this->head;
    while ($child) {
      if ($child instanceof $class_name) {
        $matches[] = $child;
      }
      $child = $child->next;
    }
    return $matches;
  }
1247086
public function isClassReflected($className)
    {
        if (!$this->initialized) {
            $this->initialize();
        }
        $className = $this->cleanClassName($className);

        return isset($this->classReflectionData[$className]);
    }
1144607
function contains( element, className ) {
  className = className.replace( '.', '' );
  if ( hasClassList ) {
    return element.classList.contains( className );
  }

  return element.className.indexOf( className ) > -1;
}
1141354
public boolean isMapped(Class<?> classToCheck){
		return    !isNull(loadGlobals().get(classToCheck.getName()))
			   || !isEmpty(loadAttributes().get(classToCheck.getName()));
	}
932009
public function importsClass($class_name = NULL) {
    if ($this->useFunction || $this->useConst) {
      return FALSE;
    }
    if ($class_name) {
      foreach ($this->getDeclarations() as $declaration) {
        if ($declaration->getName()->getPath() === $class_name) {
          return TRUE;
        }
      }
      return FALSE;
    }
    else {
      return TRUE;
    }
  }
153234
function hasClass ( el, className ) {
        return el.classList ? el.classList.contains(className) : new RegExp('\\b' + className + '\\b').test(el.className);
    }
300900
public synchronized boolean isClassAffected(String className) {
        if (isOnMustRunList(className)) {
            return true;
        }
        boolean isAffected = true;
        String fullMethodName = className + "." + CLASS_EXT;
        Set<RegData> regData = mStorer.load(mRootDir, className, CLASS_EXT);
        isAffected = isAffected(regData);
        recordTestAffectedOutcome(fullMethodName, isAffected);
        return isAffected;
    }
54007
public function getFirstDescendant($class_name)
    {
        if (!class_exists($class_name) && !interface_exists($class_name)) {
            return null;
        }

        $out = null;

        foreach ($this->children as $child_widget) {
            if ($child_widget instanceof $class_name) {
                $out = $child_widget;
                break;
            }

            if ($child_widget instanceof SwatUIParent) {
                $out = $child_widget->getFirstDescendant($class_name);
                if ($out !== null) {
                    break;
                }
            }
        }

        return $out;
    }
56413
def class_check(vector):
    
    for i in vector:
        if not isinstance(i, type(vector[0])):
            return False
    return True
274292
def has_class_methods(*class_method_names):
    

    def test(cls):
        if not isinstance(cls, type):
            cls = type(cls)
        for class_method_name in class_method_names:
            try:
                class_method = getattr(cls, class_method_name)
                if class_method.__self__ is not cls:
                    return False
            except AttributeError:
                return False
        return True

    return test
1011243
private function checkClassHasValidSuffix($className, $classSuffix = null)
    {
        if ($classSuffix === '*') {
            return true;
        }
        $classSuffixPos = strrpos($className, $classSuffix);
        return $classSuffixPos === (strlen($className) - strlen($classSuffix));
    }
951737
public static boolean check(Class<?> clz) {
        if (Config.CACHE_SEEN_CLASSES_V) {
            int index = hash(clz);
            if (CACHE[index] == clz) {
                return true;
            }
            CACHE[index] = clz;
        }
        return false;
    }
982250
private boolean isJavaSystemClassName(String className) {
        if (className == null) {
            return false;
        }

        if (className.startsWith("java/") || className.startsWith("javax/")) {
            return true;
        }
        return false;
    }
1108629
protected function classMatches($class_name, $descendant_of)
	{
		$class_name = ltrim($class_name, '\\');
		$descendant_of = ltrim($descendant_of, '\\');
		$match_with = array_merge(class_implements($class_name), class_parents($class_name));

		return $class_name == $descendant_of || in_array($descendant_of, $match_with);
	}
1245918
public static boolean isMatched(Map<String, Object> patterns,
                                    String className) {
        // Array [] object class names are "[x", where x is the first letter of the array type
        // -> NO '.' in class name, thus!
        // see http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getName%28%29
        String qualifiedNamespace = className;
        String name = className;
        if( className.indexOf('.') > 0 ) { 
            qualifiedNamespace = className.substring( 0, className.lastIndexOf( '.' ) ).trim();
            name = className.substring( className.lastIndexOf( '.' ) + 1 ).trim();
        }
        else if( className.indexOf('[') == 0 ) { 
           qualifiedNamespace = className.substring(0, className.lastIndexOf('[') );
        }
        Object object = patterns.get( qualifiedNamespace );
        if ( object == null ) {
            return true;
        } else if ( STAR.equals( object ) ) {
            return false;
        } else if ( patterns.containsKey( "*" ) ) {
            // for now we assume if the name space is * then we have a catchall *.* pattern
            return true;
        } else {
            List list = (List) object;
            return !list.contains( name );
        }
    }
795057
private function isValidShortClassName(string $name): bool
    {
        return empty($name) === false && preg_match(static::VALID_CLASS_NAME_REGEX, $name) === 1;
    }