//UnwrapAny returns two values where the first is not nil if the ActionInterface is a Action
//or the second non-nil if its a ActDepend
760556
func UnwrapAny(a ActionInterface) (*Action, *ActDepend) {
	wa := UnwrapActionWrap(a)
	wad := UnwrapActDependWrap(a)

	return wa, wad
}
854128
func (u *ActionDetails) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
		// TeamJoinDetails : Additional information relevant when a new member
		// joins the team.
		TeamJoinDetails json.RawMessage `json:"team_join_details,omitempty"`
		// RemoveAction : Define how the user was removed from the team.
		RemoveAction json.RawMessage `json:"remove_action,omitempty"`
	}
	var w wrap
	var err error
	if err = json.Unmarshal(body, &w); err != nil {
		return err
	}
	u.Tag = w.Tag
	switch u.Tag {
	case "team_join_details":
		err = json.Unmarshal(body, &u.TeamJoinDetails)

		if err != nil {
			return err
		}
	case "remove_action":
		err = json.Unmarshal(w.RemoveAction, &u.RemoveAction)

		if err != nil {
			return err
		}
	}
	return nil
}
1199901
func (x *Contract) UnmarshalJSON(data []byte) (err error) {
	x2 := contract{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = Contract(x2)
		return x.checkResourceType()
	}
	return
}
443153
func (b *ByteBuffer) UnreadByte() error {
	b.Lock()
	defer b.Unlock()
	return b.b.UnreadByte()
}
1366386
func (a *ActionWrap) UseThen(fx func(b interface{}, a ActionInterface), f ActionInterface) ActionInterface {
	return a.action.UseThen(fx, a)
}
194185
func (r *Chain) UnChain() {
	prev := r.prev
	next := r.next

	if prev != nil && next != nil {
		prev.UseNext(next)
		next.UsePrev(prev)
		return
	}

	prev.UseNext(nil)
}
390235
func (mr *MockFacadeMockRecorder) UnpinMachineApplications() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnpinMachineApplications", reflect.TypeOf((*MockFacade)(nil).UnpinMachineApplications))
}
148291
func (c *Container) unmapRun() {
	if !c.mapped {
		return
	}
	runs := c.runs()
	tmp := make([]interval16, c.len)
	copy(tmp, runs)
	h := (*reflect.SliceHeader)(unsafe.Pointer(&tmp))
	c.pointer, c.cap = (*uint16)(unsafe.Pointer(h.Data)), int32(h.Cap)
	c.mapped = false
}
444170
func (x *PaymentReconciliation) UnmarshalJSON(data []byte) (err error) {
	x2 := paymentReconciliation{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = PaymentReconciliation(x2)
		return x.checkResourceType()
	}
	return
}
528439
func unwrapAlias(in *types.Type) *types.Type {
	for in.Kind == types.Alias {
		in = in.Underlying
	}
	return in
}
171621
func GetChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error) {
	cap := &peer.ChaincodeActionPayload{}
	err := proto.Unmarshal(capBytes, cap)
	return cap, errors.Wrap(err, "error unmarshaling ChaincodeActionPayload")
}
301478
func unparen(x ast.Expr) ast.Expr {
	if p, isParen := x.(*ast.ParenExpr); isParen {
		x = unparen(p.X)
	}
	return x
}
127781
func UnwrapActDependWrap(a ActionInterface) *ActDepend {
	w, ok := a.(*ActionWrap)

	if !ok {
		return UnwrapActDepend(a)
	}

	ax, ok := w.action.(*ActDepend)

	if !ok {
		return UnwrapActDependWrap(ax)
	}

	return ax

}
1176301
func (cr *ConflictResolver) getActionsToMerge(
	ctx context.Context, unmergedChains, mergedChains *crChains,
	mergedPaths map[data.BlockPointer]data.Path) (
	map[data.BlockPointer]crActionList, error) {
	actionMap := make(map[data.BlockPointer]crActionList)
	for unmergedMostRecent, unmergedChain := range unmergedChains.byMostRecent {
		original := unmergedChain.original
		// If this is a file that has been deleted in the merged
		// branch, a corresponding recreate op will take care of it,
		// no need to do anything here.

		// We don't need the "ok" value from this lookup because it's
		// fine to pass a nil mergedChain into crChain.getActionsToMerge.
		mergedChain := mergedChains.byOriginal[original]
		mergedPath, ok := mergedPaths[unmergedMostRecent]
		if !ok {
			// This most likely means that the file was created or
			// deleted in the unmerged branch and thus has no
			// corresponding merged path yet.
			continue
		}
		if !mergedPath.IsValid() {
			cr.log.CWarningf(ctx, "Ignoring invalid merged path for %v "+
				"(original=%v)", unmergedMostRecent, original)
			continue
		}

		actions, err := unmergedChain.getActionsToMerge(
			ctx, cr.config.ConflictRenamer(), mergedPath,
			mergedChain)
		if err != nil {
			return nil, err
		}

		if len(actions) > 0 {
			actionMap[mergedPath.TailPointer()] = actions
		}
	}

	return actionMap, nil
}
1086097
func NewActDependBy(r ActionInterface, v ActionInterface, max int) *ActDepend {
	var set = make([]ActionInterface, max)
	var count = 1

	act := &ActDepend{
		resolveType(r),
		set,
		make(map[int]bool),
		0,
		max,
		false,
	}

	for count < max {
		m := NewAction()
		c := count
		m.When(func(b interface{}, _ ActionInterface) {
			act.states[c] = false
		})
		set[count] = m
		act.states[count] = false
		count++
	}

	return act
}
1370316
func ApplyUnaryInbound(h transport.UnaryHandler, i UnaryInbound) transport.UnaryHandler {
	if i == nil {
		return h
	}
	return unaryHandlerWithMiddleware{h: h, i: i}
}
167981
func UnwrapOpID(c context.Context, token string, caller identity.Identity) (int64, error) {
	body, err := opToken.Validate(c, token, []byte(caller))
	if err != nil {
		return 0, errors.Annotate(err, "failed to validate upload operation ID token").Err()
	}
	id, err := strconv.ParseInt(body["id"], 10, 64)
	if err != nil {
		return 0, errors.Annotate(err, "invalid upload operation ID %q", body["id"]).Err()
	}
	return id, nil
}