// GetLuminocity gets the broadband and IR only values from the TSL2561,
// adjusting gain if auto-gain is enabled
771361
func (d *TSL2561Driver) GetLuminocity() (broadband uint16, ir uint16, err error) {
	// if auto gain disabled get a single reading and continue
	if !d.autoGain {
		broadband, ir, err = d.getData()
		return
	}

	agcCheck := false
	hi, lo := d.getHiLo()

	// Read data until we find a valid range
	valid := false
	for {
		broadband, ir, err = d.getData()
		if err != nil {
			return
		}

		// Run an auto-gain check if we haven't already done so
		if !agcCheck {
			if (broadband < lo) && (d.gain == TSL2561Gain1X) {
				// increase gain and try again
				err = d.SetGain(TSL2561Gain16X)
				if err != nil {
					return
				}
				agcCheck = true
			} else if (broadband > hi) && (d.gain == TSL2561Gain16X) {
				// drop gain and try again
				err = d.SetGain(TSL2561Gain1X)
				if err != nil {
					return
				}
				agcCheck = true
			} else {
				// Reading is either valid, or we're already at the chips
				// limits
				valid = true
			}
		} else {
			// If we've already adjusted the gain once, just return the new results.
			// This avoids endless loops where a value is at one extreme pre-gain,
			// and the the other extreme post-gain
			valid = true
		}

		if valid {
			break
		}
	}

	return
}
427584
func getTLSConf(enableRPC bool, tlsConf *tlsutil.Config) (*tls.Config, tlsutil.RegionWrapper, error) {
	var tlsWrap tlsutil.RegionWrapper
	var incomingTLS *tls.Config
	if enableRPC {
		tw, err := tlsConf.OutgoingTLSWrapper()
		if err != nil {
			return nil, nil, err
		}
		tlsWrap = tw

		itls, err := tlsConf.IncomingTLSConfig()
		if err != nil {
			return nil, nil, err
		}
		incomingTLS = itls
	}
	return incomingTLS, tlsWrap, nil
}
340711
func (r Billing_Item) GetBandwidthAllocation() (resp datatypes.Network_Bandwidth_Version1_Allocation, err error) {
	err = r.Session.DoRequest("SoftLayer_Billing_Item", "getBandwidthAllocation", nil, &r.Options, &resp)
	return
}
406999
func (l *Language) GetLocal(key string) interface{} {
	if l == nil {
		panic("language not set")
	}
	key = strings.ToLower(key)
	if !globalOnlySettings[key] {
		if v, ok := l.settings[key]; ok {
			return v
		}
	}
	return nil
}
1337667
func (s *OsdCsiServer) GetPluginInfo(
	ctx context.Context,
	req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {

	return &csi.GetPluginInfoResponse{
		Name:          csiDriverNamePrefix + s.driver.Name(),
		VendorVersion: csiDriverVersion,

		// As OSD CSI Driver matures, add here more information
		Manifest: map[string]string{
			"driver": s.driver.Name(),
		},
	}, nil
}
683568
func (disk *dataDisk) GetGlobalMapPath(spec *volume.Spec) (string, error) {
	volumeSource, _, err := getVolumeSource(spec)
	if err != nil {
		return "", err
	}
	return filepath.Join(disk.plugin.host.GetVolumeDevicePluginDir(azureDataDiskPluginName), string(volumeSource.DiskName)), nil
}
722775
func GetDynamicPluginProber(pluginDir string, runner exec.Interface) volume.DynamicPluginProber {
	return &flexVolumeProber{
		pluginDir: pluginDir,
		watcher:   utilfs.NewFsnotifyWatcher(),
		factory:   pluginFactory{},
		runner:    runner,
		fs:        &utilfs.DefaultFs{},
	}
}
524047
func (L *State) GetMetaTable(index int) bool {
	return C.lua_getmetatable(L.s, C.int(index)) != 0
}
188398
func (ep *endpoint) GetLocalAddress() (tcpip.FullAddress, *tcpip.Error) {
	return tcpip.FullAddress{}, tcpip.ErrNotSupported
}
217204
func (r Hardware_Server) GetPublicBandwidthTotal(startTime *int, endTime *int) (resp uint, err error) {
	params := []interface{}{
		startTime,
		endTime,
	}
	err = r.Session.DoRequest("SoftLayer_Hardware_Server", "getPublicBandwidthTotal", params, &r.Options, &resp)
	return
}
1275540
func (surface *XlibSurface) GetDrawable() uint64 {
	ret := uint64(C.cairo_xlib_surface_get_drawable(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
1137313
func (f *IdentityClient) GetPluginCapabilities(ctx context.Context, in *csipb.GetPluginCapabilitiesRequest, opts ...grpc.CallOption) (*csipb.GetPluginCapabilitiesResponse, error) {
	return nil, nil
}
965133
func GetLocale(locale string) (*Locale, bool) {
	l, ok := locales[locale]
	return l, ok
}
681654
func (fw *FirewallSSO) getRadiusClient(ctx context.Context) *radius.Client {
	return &radius.Client{}
}
102965
func (r Hardware_SecurityModule750) GetScaleAssets() (resp []datatypes.Scale_Asset, err error) {
	err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule750", "getScaleAssets", nil, &r.Options, &resp)
	return
}
795337
func (m *Stub) GetInfo(ctx context.Context, req *watcherapi.InfoRequest) (*watcherapi.PluginInfo, error) {
	log.Println("GetInfo")
	return &watcherapi.PluginInfo{
		Type:              watcherapi.DevicePlugin,
		Name:              m.resourceName,
		Endpoint:          m.endpoint,
		SupportedVersions: []string{pluginapi.Version}}, nil
}
1193307
func dialElastic(addr string, options graph.Options) (*elastic.Client, error) {
	client, err := elastic.NewClient(elastic.SetURL(addr))
	if err != nil {
		return nil, err
	}
	return client, nil
}