// Getter interface
490226
func (m *MetricStorage) Get(ctx genericapirequest.Context, name string, opts *metav1.GetOptions) (runtime.Object, error) {
	// TODO: pay attention to get options
	nodeMetrics := m.getNodeMetrics(name)
	if nodeMetrics == nil {
		return &metrics.NodeMetrics{}, errors.NewNotFound(m.groupResource, name)
	}
	return nodeMetrics, nil
}
765458
func (reader *PluginConfigReader) GetInt(key string, defaultValue int64) int64 {
	value, err := reader.WithError.GetInt(key, defaultValue)
	reader.Errors.Push(err)
	return value
}
1101712
func (c ConfigAttributes) GetInt(attrName string, defaultValue int) int {
	if val, ok := c[attrName]; ok {
		if value, ok := val.(float64); ok {
			return int(value)
		}
		return val.(int)
	}
	return defaultValue
}
1307149
func (c *Context) GetInt(key string) (i int) {
	if val, ok := c.Get(key); ok && val != nil {
		i, _ = val.(int)
	}
	return
}
778217
func (f FakeGetter) Get(name string) (*api.Service, error) {
	return f.Svc, f.Err
}
1191711
func (c Config) GetInt(key string) (int64, error) {
	var (
		iout int64
		val  interface{}
		ok   bool
	)

	if val, ok = c[key]; !ok {
		return iout, ErrConfigNotFound
	}

	if iout, ok = val.(int64); !ok {
		return iout, ErrNotAnInt
	}

	return iout, nil
}
1093476
func getattr(thread *Thread, _ *Builtin, args Tuple, kwargs []Tuple) (Value, error) {
	var object, dflt Value
	var name string
	if err := UnpackPositionalArgs("getattr", args, kwargs, 2, &object, &name, &dflt); err != nil {
		return nil, err
	}
	if object, ok := object.(HasAttrs); ok {
		v, err := object.Attr(name)
		if err != nil {
			// An error could mean the field doesn't exist,
			// or it exists but could not be computed.
			if dflt != nil {
				return dflt, nil
			}
			return nil, err
		}
		if v != nil {
			return v, nil
		}
		// (nil, nil) => no such field
	}
	if dflt != nil {
		return dflt, nil
	}
	return nil, fmt.Errorf("%s has no .%s field or method", object.Type(), name)
}
362572
func GetLogger(ctx context.Context) *logrus.Entry {
	logger := ctx.Value(loggerKey{})

	if logger == nil {
		return L
	}

	return logger.(*logrus.Entry)
}
853053
func (a customResourceStrategy) GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) {
	accessor, err := meta.Accessor(obj)
	if err != nil {
		return nil, nil, err
	}
	return labels.Set(accessor.GetLabels()), objectMetaFieldsSet(accessor, a.namespaceScoped), nil
}
1052380
func getAttr(fr *Frame, x Value, name string) (Value, error) {
	// field or method?
	if x, ok := x.(HasAttrs); ok {
		if v, err := x.Attr(name); v != nil || err != nil {
			return v, err
		}
	}

	return nil, fmt.Errorf("%s has no .%s field or method", x.Type(), name)
}
412906
func (c *ConfigLocal) keyGetter() blockKeyGetter {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.keyman
}
899022
func SimpleGetter() Getter {
	return func(s reflect.Value) []reflect.Value {
		vals := valueSlice(s.Len())
		for i := range vals {
			vals[i] = reflect.Indirect(reflect.Indirect(s.Index(i)))
		}
		return vals
	}
}
1346463
func (s *Session) GetInt(key string, def int64) int64 {
	v, ok := s.Values[key]
	if !ok {
		return def
	}

	return v.(int64)
}
1228337
func (r *Store) GetInt(key string) (int, error) {
	v := r.GetEntry(key)
	if v == nil {
		return 0, fmt.Errorf(errFindParse, "int", key)
	}
	return v.IntDefault(-1)
}
217475
func (c *config) GetIntErr(key string, args ...interface{}) (int, error) {
	val, err := c.Get(key, args...)
	if err != nil {
		return 0, err
	}
	ival, err := cfg.ToInt(val)
	c.log(TOINT, err, toVarArgs(args, val, ival)...)
	return ival, err
}
1231992
func (v *KeyValue_GetValue_Args) GetKey() (o string) {
	if v != nil && v.Key != nil {
		return *v.Key
	}

	return
}
100007
func (f *oneofField) getter(g *Generator, mc *msgCtx) {
	// The discriminator type
	g.P("type ", f.goType, " interface {")
	g.P(f.goType, "()")
	g.P("}")
	g.P()
	// The subField types, fulfilling the discriminator type contract
	for _, sf := range f.subFields {
		g.P("type ", Annotate(mc.message.file, sf.fullPath, sf.oneofTypeName), " struct {")
		g.P(Annotate(mc.message.file, sf.fullPath, sf.goName), " ", sf.goType, " `", sf.tags, "`")
		g.P("}")
		g.P()
	}
	for _, sf := range f.subFields {
		g.P("func (*", sf.oneofTypeName, ") ", f.goType, "() {}")
		g.P()
	}
	// Getter for the oneof field
	g.P("func (m *", mc.goName, ") ", Annotate(mc.message.file, f.fullPath, f.getterName), "() ", f.goType, " {")
	g.P("if m != nil { return m.", f.goName, " }")
	g.P("return nil")
	g.P("}")
	g.P()
	// Getters for each oneof
	for _, sf := range f.subFields {
		if sf.deprecated != "" {
			g.P(sf.deprecated)
		}
		g.P("func (m *", mc.goName, ") ", Annotate(mc.message.file, sf.fullPath, sf.getterName), "() "+sf.goType+" {")
		g.P("if x, ok := m.", f.getterName, "().(*", sf.oneofTypeName, "); ok {")
		g.P("return x.", sf.goName)
		g.P("}")
		g.P("return ", sf.getterDef)
		g.P("}")
		g.P()
	}
}