Set the type corresponding to the whole document.

    Args:
        loader_cls: The loader class to set the document type for.
        type_: The type to loader should process the document into.
166756
def set_document_type(loader_cls: Type, type_: Type) -> None:
    
    loader_cls.document_type = type_

    if not hasattr(loader_cls, '_registered_classes'):
        loader_cls._registered_classes = dict()
313939
@Override
    public <TYPE extends Assignable> TYPE as(final Class<TYPE> clazz) {
        Validate.notNull(clazz, "Class must be specified");

        return this.configuration.getExtensionLoader().load(clazz, this);
    }
132170
def set_deserializer_by_mime_type(self, mime_type):
        

        for deserializer in self._deserializers:
            if deserializer.content_type() == mime_type:
                self._selected_deserializer = deserializer
                return

        raise exception.UnsupportedContentTypeError(mime_type, self.supported_mime_types_str)
99273
def import_class(name: Text) -> Type:
    

    parts = name.split('.')
    module_name = parts[:-1]
    class_name = parts[-1]
    module_ = importlib.import_module('.'.join(module_name))
    return getattr(module_, class_name)
1340664
public void setClassLoader (ClassLoader loader)
    {
        _loader = loader;
        if (_comm != null) {
            _comm.setClassLoader(loader);
        }
    }
681797
def initialize_options(cls):
        
        cls.CONFIG_OPTIONS = cls.CFG.get(cls.CONFIG_PATH, return_type=dict)
523209
def setTableType(self, tableType):
        
        if tableType == self._tableType:
            return
        
        self._initialized = False
        self._tableType = tableType
        self.setQuery(Query())
1091887
def set_attributes(self, doc, fields, parent_type=None):
        

        if parent_type:
            assert isinstance(parent_type, Struct)

        self.subtypes = []

        # These are only set if this struct enumerates subtypes.
        self._enumerated_subtypes = None  # Optional[List[Tuple[str, DataType]]]
        self._is_catch_all = None  # Optional[Bool]

        super(Struct, self).set_attributes(doc, fields, parent_type)

        if self.parent_type:
            self.parent_type.subtypes.append(self)
588251
def load_block_type(self, block_type):
        
        return XBlock.load_class(block_type, self.default_class, self.select)
798911
def setTableType( self, tableType ):
        
        self._tableType     = tableType
        
        if tableType:
            self._tableTypeName = tableType.schema().name()
        else:
            self._tableTypeName = ''
1240796
def set_attributes(self, doc, data_type):
        
        self.raw_doc = doc
        self.doc = doc_unwrap(doc)
        self.data_type = data_type

        # Make sure we don't have a cyclic reference.
        # Since attributes are set one data type at a time, only the last data
        # type to be populated in a cycle will be able to detect the cycle.
        # Before that, the cycle will be broken by an alias with no populated
        # source.
        cur_data_type = data_type
        while is_alias(cur_data_type):
            cur_data_type = cur_data_type.data_type
            if cur_data_type == self:
                raise InvalidSpec(
                    "Alias '%s' is part of a cycle." % self.name,
                    self._ast_node.lineno, self._ast_node.path)
245950
def resource_type_type(loader):
    

    def impl(string):
        t_resources = loader.get_models('common.models#ResourceTypes')
        if set(string) - set("sco"):
            raise ValueError
        return t_resources(_str=''.join(set(string)))

    return impl
886500
public void setType(MsgType type) {
        this.type = type;
        if (type == MsgType.flash) {
            this.mclass = MClassType.flash;
        } else {
            this.mclass = MClassType.normal;
        }
    }
564500
def _set_item_class(self):
        
        clsname = self.__tohu_items_name__
        self.item_cls = make_item_class(clsname, self.field_names)
632518
def class_for_type(self, object_type):
        
        if object_type not in self.class_mapping:
            raise ZenpyException("Unknown object_type: " + str(object_type))
        else:
            return self.class_mapping[object_type]
405850
@SuppressWarnings("unchecked")
    public static <T> Class<T> loadClass(Class<T> type, ClassLoader classloader) {
        return loadClass(type.getName(), classloader);
    }
1202215
public static function setLoader($loader) {
    if (!$loader) {
      self::$_loader = NULL;
      return;
    }
    if ($loader instanceof FluentDOM\Loadable) {
      self::$_loader = $loader;
      return;
    }
    throw new FluentDOM\Exceptions\InvalidArgument(
      'loader', [Loadable::class]
    );
  }