Create a `Loader` instance with a `loaderfn` bound
to the app or collection instance.
547641
function createLoader(options, fn) {
  var loader = new utils.Loader(options);
  return function() {
    if (!this.isApp) loader.cache = this.views;
    loader.options.loaderFn = fn.bind(this);
    loader.load.apply(loader, arguments);
    return loader.cache;
  };
}
531841
def from_yaml(stream, cls=None, loader_cls=yaml.Loader,
              object_pairs_hook=OrderedDict, **extras):
    

    class OrderedLoader(loader_cls):
        pass

    def construct_mapping(loader, node):
        loader.flatten_mapping(node)
        return object_pairs_hook(loader.construct_pairs(node))

    OrderedLoader.add_constructor(
        yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
        construct_mapping)

    yaml_dict = yaml.load(stream, OrderedLoader) or {}
    yaml_dict.update(extras)
    return cls(**yaml_dict) if cls else yaml_dict
798534
def load(self, value: Any, type_: Type[T], *, annotation: Optional[Annotation] = None) -> T:
        
        try:
            index = self.index(type_)
        except ValueError:
            raise TypedloadTypeError(
                'Cannot deal with value of type %s' % type_,
                value=value,
                type_=type_
            )

        # Add type to known types, to resolve ForwardRef later on
        if self.frefs is not None and hasattr(type_, '__name__'):
            tname = type_.__name__
            if tname not in self.frefs:
                self.frefs[tname] = type_

        func = self.handlers[index][1]
        try:
            return func(self, value, type_)
        except Exception as e:
            assert isinstance(e, TypedloadException)
            e.trace.insert(0, TraceItem(value, type_, annotation))
            raise e
1209792
public Object create(Class<?> iface, ClassLoader proxyLoader) {
		return create(new Class[]{iface}, proxyLoader);
	}
1263196
function(app, serverType, handlerMap) {
  let p = pathUtil.getHandlerPath(app.getBase(), serverType);
  if(p) {
    handlerMap[serverType] = Loader.load(p, app);
  }
}
393034
@Override
	public Loader createLoader(ClassLoader parent) {

        if( log.isDebugEnabled() )
            log.debug("Creating Loader with parent class loader '" +
                       parent + "'");

        WebappLoader loader = new WebappLoader(parent);
        return (loader);

    }
1170967
protected <T> T instantiate(String name, ClassLoader classLoader) {
    try {
      Class<?> generatedClass = loadClass(classLoader, name);
      if (generatedClass == Void.class) {
        return null;
      }
      @SuppressWarnings("unchecked")
      T instance = (T) generatedClass.newInstance();
      return instance;
    } catch (InstantiationException e) {
      throw new RuntimeException("Failed to initialize " + name, e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException("Failed to initialize " + name, e);
    }
  }
638930
def load(obj, settings_module, identifier="py", silent=False, key=None):
    """"""
    mod, loaded_from = get_module(obj, settings_module, silent)

    if mod and loaded_from:
        obj.logger.debug("py_loader: {}".format(mod))
    else:
        obj.logger.debug(
            "py_loader: %s (Ignoring, Not Found)", settings_module
        )
        return

    for setting in dir(mod):
        if setting.isupper():
            if key is None or key == setting:
                setting_value = getattr(mod, setting)
                obj.logger.debug(
                    "py_loader: loading %s: %s (%s)",
                    setting,
                    "*****" if "secret" in settings_module else setting_value,
                    identifier,
                )
                obj.set(setting, setting_value, loader_identifier=identifier)

    obj._loaded_files.append(mod.__file__)
702774
def set_loader(self, loader, destructor, state):
        
        return lib.zcertstore_set_loader(self._as_parameter_, loader, destructor, state)
756844
public Object create(Class<?>[] ifaces, ClassLoader proxyLoader) {
		return Proxy.newProxyInstance(proxyLoader, ifaces,
				new XRemotingInvocationHandler(serializer, requester));
	}
1071622
def bind(cls, app, *paths, methods=None, name=None, **kwargs):
        
        paths = paths or ['/%s(/{%s})?/?' % (cls.name, cls.name)]
        name = name or "api.%s" % cls.name
        return super(RESTHandler, cls).bind(app, *paths, methods=methods, name=name, **kwargs)
1365442
function Builder(baseURL, cfg) {
  if (typeof baseURL == 'object') {
    cfg = baseURL;
    baseURL = null;
  }

  this.loader = null;
  this.resetConfig = function() {};

  this.reset();

  if (baseURL)
    this.config({ baseURL: baseURL });

  // config passed to constructor will
  // be saved for future .reset() calls
  if (typeof cfg == 'object')
    this.config(cfg, true, !!baseURL);
  else if (typeof cfg == 'string')
    this.loadConfigSync(cfg, true, !!baseURL);
}
983482
def initialize_collector(cls, name=None, configfile=None, handlers=[]):
    
    collector = None

    try:
        # Initialize Collector
        collector = cls(name=name, configfile=configfile, handlers=handlers)
    except Exception:
        # Log error
        logger.error("Failed to initialize Collector: %s. %s",
                     cls.__name__, traceback.format_exc())

    # Return collector
    return collector
824011
function BinaryLoader(loadItem) {
		this.AbstractLoader_constructor(loadItem, true, createjs.Types.BINARY);
		this.on("initialize", this._updateXHR, this);
	}
121658
protected function createCollectionLoader()
    {
        $loader = $this->createCollectionLoaderFromTrait();

        $mainMenu = filter_input(INPUT_GET, 'main_menu', FILTER_SANITIZE_STRING);
        if ($mainMenu) {
            $loader->setCallback(function (&$obj) use ($mainMenu) {
                if (!$obj['main_menu']) {
                    $obj['main_menu'] = $mainMenu;
                }
            });
        }

        return $loader;
    }
786340
def load(value: Any, type_: Type[T], **kwargs) -> T:
    
    from . import dataloader
    loader = dataloader.Loader(**kwargs)
    return loader.load(value, type_)
361602
function (app) {
  let p = pathUtil.getCronPath(app.getBase(), app.getServerType());
  if (p) {
    return Loader.load(p, app);
  }
}