// LooseLoad has exactly same functionality as Load function
// except it ignores nonexistent files instead of returning error.
328162
func LooseLoad(source interface{}, others ...interface{}) (*File, error) {
	return LoadSources(LoadOptions{Loose: true}, source, others...)
}
496572
func Loader(l CacheableLoader) Option {
	return func(c Cache) error {
		switch oc := c.(type) {
		case *cache:
			oc.load = l
			return nil
		default:
			return errors.New(ErrIllegalCache, errorMessages)
		}
	}
}
1295734
func LockedLoad(bpf []unix.SockFilter) error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()
	return Load(bpf)
}
1159266
func Load(path string) (d *Dic, err error) {
	r, err := zip.OpenReader(path)
	if err != nil {
		return d, err
	}
	defer r.Close()
	return load(&r.Reader, true)
}
841121
func (p *plugin) Load() {
	dir, file := filepath.Split(p.Path())
	p.name = file
	name := filepath.Base(dir) + "." + file[:len(file)-3]
	s, err := py.NewUnicode(name)
	if err != nil {
		log.Warn(err)
		return
	}
	defer s.Decref()

	log.Debug("Loading plugin %s", name)
	l := py.NewLock()
	defer l.Unlock()
	if r, err := module.Base().CallMethodObjArgs("reload_plugin", s); err != nil {
		log.Warn(err)
		return
	} else if r != nil {
		r.Decref()
	}
}
702175
func (m *nfsMounter) Load(source []string) error {
	info, err := mount.GetMounts()
	if err != nil {
		return err
	}
	re := regexp.MustCompile(`,addr=(.*)`)
MountLoop:
	for _, v := range info {
		host := "localhost"
		if len(m.servers) != 0 {
			if !strings.HasPrefix(v.Fstype, "nfs") {
				continue
			}
			matches := re.FindStringSubmatch(v.VfsOpts)
			if len(matches) != 2 {
				continue
			}

			if exists := m.serverExists(matches[1]); !exists {
				continue
			}
			host = matches[1]
		}
		m.normalizeSource(v, host)
		mount, ok := m.mounts[v.Source]
		if !ok {
			mount = &Info{
				Device:     v.Source,
				Fs:         v.Fstype,
				Minor:      v.Minor,
				Mountpoint: make([]*PathInfo, 0),
			}
			m.mounts[v.Source] = mount
		}
		// Allow Load to be called multiple times.
		for _, p := range mount.Mountpoint {
			if p.Path == v.Mountpoint {
				continue MountLoop
			}
		}
		mount.Mountpoint = append(mount.Mountpoint,
			&PathInfo{
				Path: normalizeMountPath(v.Mountpoint),
			},
		)
	}
	return nil
}
1127340
func (y *YAMLLoader) Load(s interface{}) error {
	var r io.Reader

	if y.Reader != nil {
		r = y.Reader
	} else if y.Path != "" {
		file, err := getConfig(y.Path)
		if err != nil {
			return err
		}
		defer file.Close()
		r = file
	} else {
		return ErrSourceNotSet
	}

	data, err := ioutil.ReadAll(r)
	if err != nil {
		return err
	}

	return yaml.Unmarshal(data, s)
}
141895
func (l *Loader) onLoaded(w *Wallet, db walletdb.DB) {
	for _, fn := range l.callbacks {
		fn(w)
	}

	l.wallet = w
	l.db = db
	l.callbacks = nil // not needed anymore
}
444761
func (c *Connection) Load(names ...string) (errors []error) {
	var tempErrors []error = make([]error, len(names))
	var numErrors int = 0
	for _, name := range names {
		err := c.Create(name)
		if err != nil {
			tempErrors = append(tempErrors, err)
			numErrors += 1
			continue
		}
		break
	}

	copy(errors, tempErrors[0:numErrors])
	return
}
1290559
func LoadFile(filename string) (*File, error) {
	// check if the file exists, return a new file if it doesn't
	if _, err := os.Stat(filename); os.IsNotExist(err) {
		file := NewFile()
		file.Filename = filename
		return file, nil
	}

	// if file exists, read and parse it
	f, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer f.Close()

	return Parse(filename, filename, f)
}
1018779
func (l *propertiesLoader) Load(out interface{}) error {
	properties := make(p.Properties)
	if err := properties.Load(l.r); err != nil {
		return err
	}
	o := out.(*map[string]string)
	*o = map[string]string(properties)
	return nil
}
320022
func (c *collection) Unload(ctx context.Context) error {
	req, err := c.conn.NewRequest("PUT", path.Join(c.relPath("collection"), "unload"))
	if err != nil {
		return WithStack(err)
	}
	resp, err := c.conn.Do(ctx, req)
	if err != nil {
		return WithStack(err)
	}
	if err := resp.CheckStatus(200); err != nil {
		return WithStack(err)
	}
	return nil

}
875081
func Load(filename string) (*Model, error) {
	f, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer f.Close()
	model, err := FromReader(f)
	if err != nil {
		model = new(Model)
		if err1 := model.convertOldFormat(filename); err1 != nil {
			return model, err1
		}
		return model, nil
	}
	return model, nil
}
125219
func (m *SnapshotMetadata) load() error {
	// This is not safe for concurrent access.
	// Exported methods will deal with locking.
	jsonData, err := ioutil.ReadFile(m.path)
	if jsonData == nil || os.IsNotExist(err) {
		m.save()
	} else {
		if err := json.Unmarshal(jsonData, &m.snapshotMetadata); err != nil {
			return err
		}
	}
	return nil
}
70083
func (f *ScmpFilter) Load() error {
	f.lock.Lock()
	defer f.lock.Unlock()

	if !f.valid {
		return errBadFilter
	}

	if retCode := C.seccomp_load(f.filterCtx); retCode != 0 {
		return syscall.Errno(-1 * retCode)
	}

	return nil
}
1261270
func (bf *Filter) Unload() {
	bf.mtx.Lock()
	bf.msgFilterLoad = nil
	bf.mtx.Unlock()
}
669241
func (j *JSONLoader) Load(s interface{}) error {
	var r io.Reader
	if j.Reader != nil {
		r = j.Reader
	} else if j.Path != "" {
		file, err := getConfig(j.Path)
		if err != nil {
			return err
		}
		defer file.Close()
		r = file
	} else {
		return ErrSourceNotSet
	}

	return json.NewDecoder(r).Decode(s)
}