// GetModulatorArray reads an array of modulator plugins
498333
func (reader *PluginConfigReader) GetModulatorArray(key string, logger logrus.FieldLogger, defaultValue ModulatorArray) ModulatorArray {
	modulators, err := reader.WithError.GetModulatorArray(key, logger, defaultValue)
	reader.Errors.Push(err)
	return modulators
}
556224
func getArray(schema proto.Schema) (*proto.Array, error) {
	if schema == nil {
		return nil, nil
	}
	visitor := &arraySchemaVisitor{}
	schema.Accept(visitor)
	return visitor.Result, visitor.Err
}
1221256
func (handle *LinuxKernelHandler) GetModules() ([]string, error) {
	// Check whether IPVS required kernel modules are built-in
	kernelVersion, ipvsModules, err := utilipvs.GetKernelVersionAndIPVSMods(handle.executor)
	if err != nil {
		return nil, err
	}
	builtinModsFilePath := fmt.Sprintf("/lib/modules/%s/modules.builtin", kernelVersion)
	b, err := ioutil.ReadFile(builtinModsFilePath)
	if err != nil {
		klog.Warningf("Failed to read file %s with error %v. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules", builtinModsFilePath, err)
	}
	var bmods []string
	for _, module := range ipvsModules {
		if match, _ := regexp.Match(module+".ko", b); match {
			bmods = append(bmods, module)
		}
	}

	// Try to load IPVS required kernel modules using modprobe first
	for _, kmod := range ipvsModules {
		err := handle.executor.Command("modprobe", "--", kmod).Run()
		if err != nil {
			klog.Warningf("Failed to load kernel module %v with modprobe. "+
				"You can ignore this message when kube-proxy is running inside container without mounting /lib/modules", kmod)
		}
	}

	// Find out loaded kernel modules
	out, err := handle.executor.Command("cut", "-f1", "-d", " ", "/proc/modules").CombinedOutput()
	if err != nil {
		return nil, err
	}

	mods := strings.Split(string(out), "\n")
	return append(mods, bmods...), nil
}
453791
func (reader PluginConfigReaderWithError) GetFormatterArray(key string, logger logrus.FieldLogger, defaultValue FormatterArray) (FormatterArray, error) {
	formatters := []Formatter{}

	modPlugins, err := reader.GetPluginArray(key, []Plugin{})
	if err != nil {
		return formatters, err
	}
	if len(modPlugins) == 0 {
		return formatters, nil
	}

	errors := tgo.NewErrorStack()
	errors.SetFormat(tgo.ErrorStackFormatCSV)

	for _, plugin := range modPlugins {
		if formatter, isFormatter := plugin.(Formatter); isFormatter {
			formatters = append(formatters, formatter)
		} else {
			errors.Pushf("Plugin '%T' is not a valid formatter", plugin)
			panic(errors.Top())
		}
	}

	return formatters, errors.OrNil()
}
1280983
func GetAnalogModule() (AnalogModule, error) {
	m, e := GetModule("analog")
	if e != nil {
		return nil, e
	}

	if m == nil {
		return nil, errors.New("Driver does not support analog")
	}

	return m.(AnalogModule), nil
}
473976
func ActiveModule(local *config.LocalConfig, moduleKind ModuleKind) string {
	var (
		modulesValue = reflect.ValueOf(local).Elem().FieldByName("Modules")
		modulesType  = modulesValue.Type()
		numField     = modulesType.NumField()
		kind         = string(moduleKind)
	)
	for i := 0; i < numField; i++ {
		var (
			fieldValue = modulesValue.Field(i)
			fieldType  = modulesType.Field(i)
		)
		if fieldType.Tag.Get("json") == kind {
			return fieldValue.Interface().(string)
		}
	}

	return ""
}
541410
func (t *TreeEntry) GetMode() string {
	if t == nil || t.Mode == nil {
		return ""
	}
	return *t.Mode
}
1287584
func (bc *BaiduClient) getBaiduRSAPublicKeyModulus() {
	body, _ := bc.Fetch("GET", "https://wappass.baidu.com/static/touch/js/login_d9bffc9.js", nil, nil)
	rawRSA := regexp.MustCompile(`,rsa:"(.*?)",error:`).FindSubmatch(body)
	if len(rawRSA) >= 1 {
		bc.rsaPublicKeyModulus = string(rawRSA[1])
		return
	}
	bc.rsaPublicKeyModulus = "B3C61EBBA4659C4CE3639287EE871F1F48F7930EA977991C7AFE3CC442FEA49643212E7D570C853F368065CC57A2014666DA8AE7D493FD47D171C0D894EEE3ED7F99F6798B7FFD7B5873227038AD23E3197631A8CB642213B9F27D4901AB0D92BFA27542AE890855396ED92775255C977F5C302F1E7ED4B1E369C12CB6B1822F"
}
731674
func (c Static) ServeModuleDir(moduleName, prefix, filepath string) revel.Result {
	// Fix for #503.
	prefix = c.Params.Fixed.Get("prefix")
	if prefix == "" {
		return c.NotFound("")
	}

	var basePath string
	for _, module := range revel.Modules {
		if module.Name == moduleName {
			basePath = module.Path
		}
	}

	absPath := fpath.Join(basePath, fpath.FromSlash(prefix))

	return serve(c, absPath, filepath, true)
}
922914
func GetFlagStringArray(cmd *cobra.Command, flag string) []string {
	s, err := cmd.Flags().GetStringArray(flag)
	if err != nil {
		klog.Fatalf("error accessing flag %s for command %s: %v", flag, cmd.Name(), err)
	}
	return s
}
1242193
func (c *Client) GetPlugins(details bool) *GetPluginsResult {
	r := &GetPluginsResult{}

	var path string
	if details {
		path = "/plugins?details"
	} else {
		path = "/plugins"
	}

	resp, err := c.do("GET", path, ContentTypeJSON)
	if err != nil {
		r.Err = err
		return r
	}

	switch resp.Meta.Type {
	// TODO change this to concrete const type when Joel adds it
	case rbody.PluginListType:
		// Success
		b := resp.Body.(*rbody.PluginList)
		r.LoadedPlugins = convertLoadedPlugins(b.LoadedPlugins)
		r.AvailablePlugins = convertAvailablePlugins(b.AvailablePlugins)
		return r
	case rbody.ErrorType:
		r.Err = resp.Body.(*rbody.Error)
	default:
		r.Err = ErrAPIResponseMetaType
	}
	return r
}
1074056
func (u *Ugen) Modulo(val Input) Input {
	return binOpModulo(u.Rate, u, val, u.NumOutputs)
}
781028
func (key *Key) GetModulus() (modulus []byte, err error) {
	var dataLen C.UINT32
	var cData *C.BYTE
	err = tspiError(C.Tspi_GetAttribData((C.TSS_HOBJECT)(key.handle), C.TSS_TSPATTRIB_RSAKEY_INFO, C.TSS_TSPATTRIB_KEYINFO_RSA_MODULUS, &dataLen, &cData))
	data := C.GoBytes(unsafe.Pointer(cData), (C.int)(dataLen))
	C.Tspi_Context_FreeMemory(key.context, cData)
	return data, err
}
734054
func loadKernelModules(context *model.NodeupModelContext) error {
	err := modprobe("br_netfilter")
	if err != nil {
		// TODO: Return error in 1.11 (too risky for 1.10)
		glog.Warningf("error loading br_netfilter module: %v", err)
	}
	// TODO: Add to /etc/modules-load.d/ ?
	return nil
}
174456
func (md *Decoder) IsModule(d *xmlp.Decoder) bool {
	space := d.Space
	if space == dublinCoreSpace || space == mediaSpace || space == contentSpace {
		return true
	}
	return false
}
870304
func (reader PluginConfigReaderWithError) GetStringArray(key string, defaultValue []string) ([]string, error) {
	key = reader.config.registerKey(key)
	if reader.HasValue(key) {
		return reader.config.Settings.StringArray(key)
	}
	return defaultValue, nil
}
1214375
func readModuleList(mdmp *Minidump, buf *minidumpBuf) {
	moduleNum := buf.u32()
	if buf.err != nil {
		return
	}

	mdmp.Modules = make([]Module, moduleNum)

	for i := range mdmp.Modules {
		buf.ctx = fmt.Sprintf("reading module list entry %d", i)
		module := &mdmp.Modules[i]

		module.BaseOfImage = buf.u64()
		module.SizeOfImage = buf.u32()
		module.Checksum = buf.u32()
		module.TimeDateStamp = buf.u32()
		nameOff := int(buf.u32())

		versionInfoVec := make([]uint32, unsafe.Sizeof(VSFixedFileInfo{})/unsafe.Sizeof(uint32(0)))
		for j := range versionInfoVec {
			versionInfoVec[j] = buf.u32()
		}

		module.VersionInfo = *(*VSFixedFileInfo)(unsafe.Pointer(&versionInfoVec[0]))

		_, module.CVRecord = readLocationDescriptor(buf)
		_, module.MiscRecord = readLocationDescriptor(buf)

		if buf.err != nil {
			return
		}

		nameBuf := minidumpBuf{buf: buf.buf, kind: "file", off: nameOff, err: nil, ctx: buf.ctx}
		module.Name = readString(&nameBuf)
		if nameBuf.err != nil {
			buf.err = nameBuf.err
			return
		}
	}
}