// get custom menu
974420
func (this *Weixinmp) GetCustomMenu() ([]Button, error) {
	var menu struct {
		Menu struct {
			Button []Button `json:"button"`
		} `json:"menu"`
	}
	url := fmt.Sprintf("%smenu/get?access_token=", UrlPrefix)
	// retry
	for i := 0; i < retryNum; i++ {
		token, err := this.AccessToken.Fresh()
		if err != nil {
			if i < retryNum-1 {
				continue
			}
			return nil, err
		}
		resp, err := http.Get(url + token)
		if err != nil {
			if i < retryNum-1 {
				continue
			}
			return nil, err
		}
		defer resp.Body.Close()
		data, err := ioutil.ReadAll(resp.Body)
		if err != nil {
			if i < retryNum-1 {
				continue
			}
			return nil, err
		}
		// has error?
		var rtn response
		if err := json.Unmarshal(data, &rtn); err != nil {
			if i < retryNum-1 {
				continue
			}
			return nil, err
		}
		// yes
		if rtn.ErrCode != 0 {
			if i < retryNum-1 {
				continue
			}
			return nil, errors.New(fmt.Sprintf("%d %s", rtn.ErrCode, rtn.ErrMsg))
		}
		// no
		if err := json.Unmarshal(data, &menu); err != nil {
			if i < retryNum-1 {
				continue
			}
			return nil, err
		}
		break // success
	}
	return menu.Menu.Button, nil
}
626853
func (c *FakeTemplateInstances) Get(name string, options v1.GetOptions) (result *template.TemplateInstance, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewGetAction(templateinstancesResource, c.ns, name), &template.TemplateInstance{})

	if obj == nil {
		return nil, err
	}
	return obj.(*template.TemplateInstance), err
}
166970
func (c *ConfigPolicy) Get(ns []string) *ConfigPolicyNode {

	n := c.config.Get(ns)
	if n == nil {
		return NewPolicyNode()
	}
	switch t := n.(type) {
	case ConfigPolicyNode:
		return &t
	default:
		return t.(*ConfigPolicyNode)
	}
}
542631
func (r Product_Package) GetItemPricesFromSoftwareDescriptions(softwareDescriptions []datatypes.Software_Description, includeTranslationsFlag *bool, returnAllPricesFlag *bool) (resp []datatypes.Product_Item_Price, err error) {
	params := []interface{}{
		softwareDescriptions,
		includeTranslationsFlag,
		returnAllPricesFlag,
	}
	err = r.Session.DoRequest("SoftLayer_Product_Package", "getItemPricesFromSoftwareDescriptions", params, &r.Options, &resp)
	return
}
703526
func (o options) get(name string) (interface{}, error) {
	v, ok := o[name]
	if !ok {
		return nil, mangos.ErrBadOption
	}
	return v, nil
}
595504
func (o *TypoToleranceOption) Get() (bool, string) {
	if o == nil {
		return true, ""
	}
	if o.value == typoToleranceTrue {
		return true, ""
	}
	if o.value == typoToleranceFalse {
		return false, ""
	}
	return false, o.value
}
193646
func (s *RedisMapStore) GetAll(keys []string, options *ListOptions) ([]interface{}, error) {
	if len(keys) == 0 {
		return []interface{}{}, nil
	}

	for i, key := range keys {
		if !strings.HasPrefix(key, s.prefix) {
			keys[i] = s.prefix + key
		}
	}

	sort.Strings(keys)

	selectedKeys := selectKeys(keys, options)
	if len(selectedKeys) == 0 {
		return []interface{}{}, nil
	}

	pipe := s.client.Pipeline()
	defer pipe.Close()

	// Add all commands to pipeline
	cmds := make(map[string]*redis.StringStringMapCmd)
	for _, key := range selectedKeys {
		cmds[key] = pipe.HGetAll(key)
	}

	// Execute pipeline
	_, err := pipe.Exec()
	if err != nil {
		return nil, err
	}

	// Get all results from pipeline
	results := make([]interface{}, len(selectedKeys))
	for i, key := range selectedKeys {
		if result, err := cmds[key].Result(); err == nil {
			result, _ = s.migrate(key, result)
			if result, err := s.decoder(result); err == nil {
				results[i] = result
			}
		}
	}

	return results, nil
}
1036387
func (c *FakePodDisruptionBudgets) Get(name string, options v1.GetOptions) (result *v1beta1.PodDisruptionBudget, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewGetAction(poddisruptionbudgetsResource, c.ns, name), &v1beta1.PodDisruptionBudget{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.PodDisruptionBudget), err
}
73391
func (c *FakeKeysets) Get(name string, options v1.GetOptions) (result *v1alpha2.Keyset, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewGetAction(keysetsResource, c.ns, name), &v1alpha2.Keyset{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha2.Keyset), err
}
10013
func (s *customResourceDefinitionLister) Get(name string) (*apiextensions.CustomResourceDefinition, error) {
	obj, exists, err := s.indexer.GetByKey(name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(apiextensions.Resource("customresourcedefinition"), name)
	}
	return obj.(*apiextensions.CustomResourceDefinition), nil
}
817272
func (c *FakeHorizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2beta2.HorizontalPodAutoscaler{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
389039
func (r *REST) Get(ctx context.Context, _ string, options runtime.Object) (runtime.Object, error) {
	listOptions, ok := options.(*metav1.ListOptions)
	if !ok {
		return nil, fmt.Errorf("unexpected options: %T", options)
	}
	var opts metav1.ListOptions
	if listOptions != nil {
		opts = *listOptions
	}
	ns, ok := apirequest.NamespaceFrom(ctx)
	if !ok {
		ns = metav1.NamespaceAll
	}
	secrets, err := r.secrets.Secrets(ns).List(opts)
	if err != nil {
		return nil, err
	}
	filtered := make([]coreapi.Secret, 0, len(secrets.Items))
	for i := range secrets.Items {
		if secrets.Items[i].Annotations[imageapi.ExcludeImageSecretAnnotation] == "true" {
			continue
		}
		switch secrets.Items[i].Type {
		case corev1.SecretTypeDockercfg, corev1.SecretTypeDockerConfigJson:
			internalSecret := &coreapi.Secret{}
			if err := corev1conversion.Convert_v1_Secret_To_core_Secret(&secrets.Items[i], internalSecret, nil); err != nil {
				return nil, err
			}
			filtered = append(filtered, *internalSecret)
		}
	}
	// clear the external content and convert
	secrets.Items = nil
	internalSecretList := &coreapi.SecretList{}
	if err := corev1conversion.Convert_v1_SecretList_To_core_SecretList(secrets, internalSecretList, nil); err != nil {
		return nil, err
	}
	internalSecretList.Items = filtered
	return internalSecretList, nil
}
731929
func (i *InitContext) Get(t Type) (interface{}, error) {
	return i.plugins.Get(t)
}
838803
func (p *Payload) Custom(key string, val interface{}) *Payload {
	p.content[key] = val
	return p
}
1343599
func (s *Statement) Custom(options Options, statements ...Code) *Statement {
	g := &Group{
		close:     options.Close,
		items:     statements,
		multi:     options.Multi,
		name:      "custom",
		open:      options.Open,
		separator: options.Separator,
	}
	*s = append(*s, g)
	return s
}
1110203
func (s *Crd) Get(resource schema.GroupKind) (*apiext_v1b1.CustomResourceDefinition, error) {
	objs, err := s.byIndex(byGroupKindIndexName, byGroupKindIndexKey(resource.Group, resource.Kind))
	if err != nil {
		return nil, err
	}
	switch len(objs) {
	case 0:
		return nil, nil
	case 1:
		crd := objs[0].(*apiext_v1b1.CustomResourceDefinition).DeepCopy()
		// Objects from type-specific informers don't have GVK set
		crd.Kind = "CustomResourceDefinition"
		crd.APIVersion = apiext_v1b1.SchemeGroupVersion.String()
		return crd, nil
	default:
		// Must never happen
		panic(errors.Errorf("multiple CRDs by group %q and kind %q: %s", resource.Group, resource.Kind, objs))
	}
}
255640
func (r *ResponseMatcher) Custom(predicate func(*http.Response) bool) *ResponseMatcher {
	r.mux.mu.Lock()
	defer r.mux.mu.Unlock()
	r.predicate = predicate
	return r
}