Validate that a vertex classname corresponds to a non-abstract vertex class.
555049
def validate_is_non_abstract_vertex_type(self, vertex_classname):
        """"""
        element = self.get_vertex_schema_element_or_raise(vertex_classname)

        if element.abstract:
            raise InvalidClassError(u'Expected a non-abstract vertex class, but {} is abstract'
                                    .format(vertex_classname))
1181337
def _validate_member(self, member, classes, instanceof):
        
        log.info("Validating member %s" % member)

        stripped = self._get_stripped_attributes(member, classes)
        if self._field_name_from_uri(member) in stripped:
            all_class_members = sum([self.schema_def.attributes_by_class[cl]
                                     for cl in classes], [])
            if member in all_class_members:
                return
            if self._namespace_from_uri(member) in self.allowed_namespaces:
                err = self.err("Unoficially allowed namespace {0}",
                               self._namespace_from_uri(member))
                return ValidationWarning(ValidationResult.WARNING, err['err'],
                                         err['line'], err['num'])
        else:
            err = self.err("{0} - invalid member of {1}",
                           self._field_name_from_uri(member),
                           self._field_name_from_uri(instanceof))
            return ValidationWarning(ValidationResult.ERROR, err['err'],
                                     err['line'], err['num'])
1371330
def assign_vertexid(self):
        

        # gather 'uniq' names which are refferred by blocks
        validvnames = set()
        self.valid_vertices = []
        for b in self.blocks.values():
            for n in b.vnames:
                v = self.vertices[n]
                if v.name not in validvnames:
                    validvnames.update([v.name])
                    self.valid_vertices.append(v)

        self.valid_vertices = sorted(self.valid_vertices)
        for i, v in enumerate(self.valid_vertices):
            v.index = i
848810
private void validateClassDeclaration(Node n, boolean isAmbient) {
    validateClassHelper(n, isAmbient);
    validateName(n.getFirstChild());
  }
255596
private boolean checkSupertypes(Class<?> cls) {
    for(Class<?> c : knownParameterizables) {
      if(c.isAssignableFrom(cls)) {
        return true;
      }
    }
    return false;
  }
332376
private static void validateReservedVariableNames( Graph graph, List<String> errors ){
        for( Node node : graph.getNodes() ){
            if( node instanceof BeanAsyncCallActivity ){
                validateReservedVariablesFromMapping( ((BeanAsyncCallActivity)node).getResultMapping(), graph, node, errors );
            }
            else if( node instanceof BeanCallActivity ){
                validateReservedVariablesFromMapping( ((BeanCallActivity)node).getResultMapping(), graph, node, errors );
            }
            else if( node instanceof CreateNewInstanceActivity ){
                MapMapping mapMapping = ((CreateNewInstanceActivity)node).getArgumentsMapping();
                if( mapMapping != null && mapMapping.getEntryMappings() != null ){
                    for( String key : mapMapping.getEntryMappings().keySet() ){
                        validateReservedVariable( key, graph, node, errors );
                    }
                }
            }
            else if( node instanceof HumanTaskActivity ){
                validateReservedVariablesFromMapping( ((HumanTaskActivity)node).getResultMapping(), graph, node, errors );
            }
            else if( node instanceof ObjectCallActivity ){
                validateReservedVariablesFromMapping( ((ObjectCallActivity)node).getResultMapping(), graph, node, errors );
            }
            else if( node instanceof SetAttributeActivity ){
                validateReservedVariable( ((SetAttributeActivity)node).getAttribute(), graph, node, errors );
            }
            else if( node instanceof CatchSignal ){
                validateReservedVariablesFromMapping( ((CatchSignal)node).getResultMapping(), graph, node, errors );
            }
        }
    }
1342911
def node_is_subclass(cls, *subclass_names):
    """"""
    if not isinstance(cls, (ClassDef, Instance)):
        return False

    # if cls.bases == YES:
    #     return False
    for base_cls in cls.bases:
        try:
            for inf in base_cls.inferred():  # pragma no branch
                if inf.qname() in subclass_names:
                    return True

                if inf != cls and node_is_subclass(  # pragma no branch
                        inf, *subclass_names):
                    # check up the hierarchy in case we are a subclass of
                    # a subclass of a subclass ...
                    return True
        except InferenceError:  # pragma no cover
            continue

    return False
280105
def check(self, values, namespace):
        """"""
        is_tuplish_type = (issubclass(self._cls, tg.Tuple) or
                           issubclass(type(values), self._cls))
        if (not _is_sequence(values) or not is_tuplish_type or
                len(values) != len(self._checks)):
            return False
        for thischeck, thisvalue in zip(self._checks, values):
            if not thischeck(thisvalue, namespace):
                return False
        return True
1018108
def has_vertex_color(self):
        """"""
        for v in (self._vertex_colors, self._vertex_colors_indexed_by_faces,
                  self._vertex_colors_indexed_by_edges):
            if v is not None:
                return True
        return False
456588
def _validateClasses(classes):
    
    glyphToClass = {}
    for className, glyphList in classes.items():
        for glyphName in glyphList:
            if glyphName not in glyphToClass:
                glyphToClass[glyphName] = set()
            glyphToClass[glyphName].add(className)
    for glyphName, groupList in glyphToClass.items():
        if len(groupList) > 1:
            raise ExtractorError("Kerning classes are in an conflicting state.")
340084
def validate_properties_exist(self, classname, property_names):
        """"""
        schema_element = self.get_element_by_class_name(classname)

        requested_properties = set(property_names)
        available_properties = set(schema_element.properties.keys())
        non_existent_properties = requested_properties - available_properties
        if non_existent_properties:
            raise InvalidPropertyError(
                u'Class "{}" does not have definitions for properties "{}": '
                u'{}'.format(classname, non_existent_properties, property_names))
843659
def validate_vertex_field_directive_interactions(parent_location, vertex_field_name, directives):
    """"""
    fold_directive = directives.get('fold', None)
    optional_directive = directives.get('optional', None)
    output_source_directive = directives.get('output_source', None)
    recurse_directive = directives.get('recurse', None)

    if fold_directive and optional_directive:
        raise GraphQLCompilationError(u'@fold and @optional may not appear at the same '
                                      u'vertex field! Parent location: {}, vertex field name: {}'
                                      .format(parent_location, vertex_field_name))

    if fold_directive and output_source_directive:
        raise GraphQLCompilationError(u'@fold and @output_source may not appear at the same '
                                      u'vertex field! Parent location: {}, vertex field name: {}'
                                      .format(parent_location, vertex_field_name))

    if fold_directive and recurse_directive:
        raise GraphQLCompilationError(u'@fold and @recurse may not appear at the same '
                                      u'vertex field! Parent location: {}, vertex field name: {}'
                                      .format(parent_location, vertex_field_name))

    if optional_directive and output_source_directive:
        raise GraphQLCompilationError(u'@optional and @output_source may not appear at the same '
                                      u'vertex field! Parent location: {}, vertex field name: {}'
                                      .format(parent_location, vertex_field_name))

    if optional_directive and recurse_directive:
        raise GraphQLCompilationError(u'@optional and @recurse may not appear at the same '
                                      u'vertex field! Parent location: {}, vertex field name: {}'
                                      .format(parent_location, vertex_field_name))
823317
def validate(tool_class, model_class):
    
    if not hasattr(tool_class, 'name'):
        raise ImproperlyConfigured("No 'name' attribute found for tool %s." % (
            tool_class.__name__
        ))

    if not hasattr(tool_class, 'label'):
        raise ImproperlyConfigured("No 'label' attribute found for tool %s." % (
            tool_class.__name__
        ))

    if not hasattr(tool_class, 'view'):
        raise NotImplementedError("No 'view' method found for tool %s." % (
            tool_class.__name__
        ))
485776
def _link_vertex_and_edge_types(self):
        """"""
        for edge_class_name in self._edge_class_names:
            edge_element = self._elements[edge_class_name]

            if (EDGE_SOURCE_PROPERTY_NAME not in edge_element.properties or
                    EDGE_DESTINATION_PROPERTY_NAME not in edge_element.properties):
                if edge_element.abstract:
                    continue
                else:
                    raise AssertionError(u'Found a non-abstract edge class with undefined '
                                         u'endpoint types: {}'.format(edge_element))

            from_class_name = edge_element.properties[EDGE_SOURCE_PROPERTY_NAME].qualifier
            to_class_name = edge_element.properties[EDGE_DESTINATION_PROPERTY_NAME].qualifier

            edge_schema_element = self._elements[edge_class_name]

            # Link from_class_name with edge_class_name
            for from_class in self._subclass_sets[from_class_name]:
                from_schema_element = self._elements[from_class]
                from_schema_element.out_connections.add(edge_class_name)
                edge_schema_element.in_connections.add(from_class)

            # Link edge_class_name with to_class_name
            for to_class in self._subclass_sets[to_class_name]:
                to_schema_element = self._elements[to_class]
                edge_schema_element.out_connections.add(to_class)
                to_schema_element.in_connections.add(edge_class_name)
387160
def _validate(cls, kind):
        """"""
        if kind not in cls._valid_kinds:
            mesg = "'kind' must be one of {}, {}, {}, or {}."
            raise ValueError(mesg.format(*cls._valid_kinds))
        else:
            return kind
698155
def validate(self, value):
        
        if value is None:
            return
        if len(self.classes) and not isinstance(value, self.classes):
            msg = '"%s" must be: %s' % (self.name, self.classes)
            raise AttributeError(msg)
337181
def is_vertex_field_type(graphql_type):
    """"""
    # This will need to change if we ever support complex embedded types or edge field types.
    underlying_type = strip_non_null_from_type(graphql_type)
    return isinstance(underlying_type, (GraphQLInterfaceType, GraphQLObjectType, GraphQLUnionType))