Loads a patch from the patch_dir
 @param name [#to_s] Name of a patch to load from the patch_dir
 @return [Patch] A patch loaded from the patch_dir
 @raise [ConfigurationError] If patch_dir is nil or is not a valid directory path
332365
def patch(name)
      raise ConfigurationError, "patch_dir has not been set" if patch_dir.nil?
      raise ConfigurationError, "patch_dir is not a directory" unless Dir.exist?(patch_dir)
      Patch.from_yaml File.join(patch_dir, "#{name}.yml")
    end
460020
def load_config
      path = ENV['HOME'] + '/.nadb.config'
      if !File.exists?(path)
        return
      end

      @config = JSON.parse(File.read(path))
    end
1367053
static function load($name){

		if($name == ''){
			return self::$data;
		}
		$name = Loader::getName($name,'config');
		$key = $name->app.'.'.$name->class;
		
		if(!isset(static::$data[$key])){
			// file config is exist?
			if(!file_exists($name->path)){
				user_error('Config '.$name->path.' Not Found');
				exit;
			}
			self::$data[$key] = (require_once $name->path);
		}
		return self::$data[$key];
	}
458116
def load_missing_constant(from_mod, const_name)
      # always default to the actual implementation
      super
    rescue LoadError, NameError => e
      load_missing_constant_error(from_mod, const_name, e)
    end
641552
def load(self, name=None, *args, **kwargs):
        ""
        inst = self.stash.load(name)
        if inst is None:
            inst = self.instance(name, *args, **kwargs)
        logger.debug(f'loaded (conf mng) instance: {inst}')
        return inst
885011
def const_lookup(mod, name)
      name.to_s.split('::').map(&:to_sym).each do |component|
        begin
          mod = mod.const_get(component, false)
        rescue NameError
          return nil
        end
      end
      mod
    end
1298275
def load_by_name name
      path = self.locate_definition name
      raise TargetLoadError.new("Target definition file does not exist for #{name}") if path.nil?
      config = YAML::load_file(path)
      raise TargetLoadError.new("Target definition file #{path} is not valid YAML") if config.nil?
      config = config.deep_symbolize
      self.store_config config
      self.check_constructor name
      self.load_constructor
    end
57143
def model(name)
      model = created_model(name)
      return nil unless model
      Pickle::Adapter.get_model(model.class, model.id)
    end
292637
def specs_from_names(names)
      names.map do |name|
        spec = available_spec(name)
        fail "#{name} was not found" if spec.nil?
        spec
      end
    end
1136398
def load_hash_configuration(self, hash_name):
        
        conf = self.redis_object.get(hash_name+'_conf')

        return pickle.loads(conf) if conf is not None else None
1192358
def plan_rename
      ref = @dao.applied_patches_inverse
      m = {}
      @patches.each do |patch|
        old_name = ref[patch.signature]
        raise NotAppliedError, patch if old_name.nil?
        raise DuplicateError, [patch.name, m[old_name]] if m.key?(old_name)
        m[old_name] = patch.name
      end
      m.select { |old_name, new_name| old_name != new_name }
    end
272418
def remove_patch(cls, patch_name):
        
        try:
            os.unlink(cls._get_patch_path(patch_name))
        except:
            raise StashException("patch '%s' does not exist" % patch_name)
730916
def load!
      begin
        require name unless enabled?
      rescue LoadError => error
        puts("Unable to load plugin #{name} due to #{error}.")
      rescue => error
        puts("require '#{name}' failed with #{error}")
      end
      @enabled = true
    end
1293539
def from_dir(dirname)
      unless File.directory?(dirname)
        raise "'#{dirname}' is not a directory or doesn't exists"
      end
      @dirname = File.expand_path dirname
      @ctime = DateTime.now
      _load_from_dir
      self
    end
24683
def load_config path
      return {} unless File.exist? path
      YAML.load File.read path
    end
575544
def examples_dir( f = nil )
      if File.exists?( config_file_path )
        form_file_name( examples_dir_from_config_file, f )
      else
        form_file_name( config_dir( '/examples' ), f )
      end
    end
67306
def find_file(name)
      @load_path.each do |dir|
        file_path = File.join(dir, "#{name}.rb")
        return file_path if File.exist? file_path
      end
      raise("Module #{name} not found")
    end