Magical loading of all grafted functions.

    Parameters:
        force (bool): force reload
960500
def load(force=False):
    

    if GRAFTS and not force:
        return GRAFTS

    # insert missing paths
    # this could be a configurated item
    userpath = settings.userpath
    if os.path.isdir(userpath) and userpath not in __path__:
        __path__.append(userpath)

    def notify_error(name):
        logging.error('unable to load %s package' % name)

    # autoload decorated functions
    walker = walk_packages(__path__, '%s.' % __name__, onerror=notify_error)
    for module_finder, name, ispkg in walker:
        loader = module_finder.find_module(name)
        mod = loader.load_module(name)
        for func in mod.__dict__.values():
            if is_graft(func):
                GRAFTS.append(func)

    # append setuptools modules
    for entry_point in iter_entry_points(group=settings.entry_point):
        try:
            func = entry_point.load()
            if is_graft(func):
                GRAFTS.append(func)
            else:
                notify_error(entry_point.name)
        except Exception as error:
            logging.exception(error)
            notify_error(entry_point.name)

    return GRAFTS
601930
function load(mod) {
    if (typeof(mod.factory) === "function") {
      return require(mod.deps, mod.factory);
    }
    return mod.factory;
  }
704511
def reload(core = false, loaded = [], &code)
    Manager.connection.reload(core, loaded, &code)
  end
1068684
def patch_loader(*decorator_args, serializer):
    
    def wrapped(fn):
        @wraps(fn)
        def decorated(*args, **kwargs):
            result = serializer.load(request.get_json(),
                                     instance=kwargs.pop('instance'),
                                     partial=True)
            if not result.errors and not result.data.id:
                abort(HTTPStatus.NOT_FOUND)
            return fn(*result)
        return decorated

    if decorator_args and callable(decorator_args[0]):
        return wrapped(decorator_args[0])
    return wrapped
1347643
def patched_function(self, *args, **kwargs):
        
        result = self.function(*args, **kwargs)
        self.validate(result)
        return result
764127
def reload(self):
        
        self.load(self.api.get(self.objName, self.key))
114937
def auto_update(cls, function):
        

        def wrapper(self, *args, **kwargs):
            f = function(self, *args, **kwargs)
            self.update()
            return f
        return wrapper
1009094
def reload(self):
        
        self._load_data(self.objects.data().filter(key=self.key)[0][0], True)
495266
def _load_autoreload_magic(self):
        """"""
        from IPython.core.getipython import get_ipython
        try:
            get_ipython().run_line_magic('reload_ext', 'autoreload')
            get_ipython().run_line_magic('autoreload', '2')
        except Exception:
            pass
55535
def force_populate(self):
        
        if not os.path.exists(self.ref):
            raise FileNotFoundError("The reference file path '{}' does not exists.".format(self.ref))
        with open(self.ref, 'r') as f:
            for word in f:
                word = word.strip('\n')
                self.db.add(word)
        self.populated = True
1270270
def load(force_load = false)
      if not @deploys || force_load
        @deploys = begin
          deploys = Array.new
          hosts = @connection.hosts.all
          hosts.each do |host|
            deploy = Deploy.new(@connection)
            deploy.retrieve(host.name)
            if deploy.name
              host.add_deploy(deploy)
              deploys << deploy
            end
          end
          deploys
        end
      end
      @deploys
    end
648448
def os_workload_status(configs, required_interfaces, charm_func=None):
    
    def wrap(f):
        @wraps(f)
        def wrapped_f(*args, **kwargs):
            # Run the original function first
            f(*args, **kwargs)
            # Set workload status now that contexts have been
            # acted on
            set_os_workload_status(configs, required_interfaces, charm_func)
        return wrapped_f
    return wrap
1294233
def wraps(self, f):
        
        @_utils.wraps(f)
        def wrapped_f(*args, **kw):
            return self.call(f, *args, **kw)

        def retry_with(*args, **kwargs):
            return self.copy(*args, **kwargs).wraps(f)

        wrapped_f.retry = self
        wrapped_f.retry_with = retry_with

        return wrapped_f
94923
def load(self, _override=True, _allow_undeclared=False, **kwargs):
    """"""
    self.load_from_dict(
        kwargs, _override=_override, _allow_undeclared=_allow_undeclared)
1311919
def ensure_obj(f):
    
    @click.pass_context
    def new_func(ctx, *args, **kwargs):
        if ctx.obj is None:
            ctx.obj = {}
        return ctx.invoke(f, *args, **kwargs)
    return update_wrapper(new_func, f)
225960
public static function load($force = false) 
    {
        // already loaded
        if (!$force && self::$_loaded) {
            return false;
        }
        self::_resolveDefaultPath();

        $files = glob(realpath(self::$_path)."/*.php");
        foreach ($files as $file) {
            Log::log("loading factory from $file ...");
            include_once $file;
        }
        self::$_loaded = true;
        return self::$_loaded;
    }
888899
def workdir_loaded(func):
    

    @wraps(func)
    def decorator(workdir, *args, **kwargs):
        if not workdir.loaded:
            workdir.load()

        return func(workdir, *args, **kwargs)

    return decorator