// PinStateQuery sends a PinStateQuery for pin.
544582
func (b *Client) PinStateQuery(pin int) error {
	return b.WriteSysex([]byte{PinStateQuery, byte(pin)})
}
364698
func UnassignPins(pins PinList) (er error) {
	er = nil

	for _, pin := range pins {
		e := UnassignPin(pin)
		if e != nil {
			er = e
		}
	}

	return
}
343973
func (s *Scanner) pushParseState(p int) {
	s.parseState = append(s.parseState, p)
}
693552
func (p *pinner) Flush() error {
	p.lock.Lock()
	defer p.lock.Unlock()

	ctx := context.TODO()

	internalset := cid.NewSet()
	recordInternal := internalset.Add

	root := &mdag.ProtoNode{}
	{
		n, err := storeSet(ctx, p.internal, p.directPin.Keys(), recordInternal)
		if err != nil {
			return err
		}
		if err := root.AddNodeLink(linkDirect, n); err != nil {
			return err
		}
	}

	{
		n, err := storeSet(ctx, p.internal, p.recursePin.Keys(), recordInternal)
		if err != nil {
			return err
		}
		if err := root.AddNodeLink(linkRecursive, n); err != nil {
			return err
		}
	}

	// add the empty node, its referenced by the pin sets but never created
	err := p.internal.Add(ctx, new(mdag.ProtoNode))
	if err != nil {
		return err
	}

	err = p.internal.Add(ctx, root)
	if err != nil {
		return err
	}

	k := root.Cid()

	internalset.Add(k)
	if err := p.dstore.Put(pinDatastoreKey, k.Bytes()); err != nil {
		return fmt.Errorf("cannot store pin state: %v", err)
	}
	p.internalPin = internalset
	return nil
}
352383
func (b *Bot) Pin(message Editable, options ...interface{}) error {
	messageID, chatID := message.MessageSig()

	params := map[string]string{
		"chat_id":    strconv.FormatInt(chatID, 10),
		"message_id": messageID,
	}

	sendOpts := extractOptions(options)
	embedSendOptions(params, sendOpts)

	respJSON, err := b.Raw("pinChatMessage", params)
	if err != nil {
		return err
	}

	return extractOkResponse(respJSON)
}
314384
func (qp *QueryParserBase) booleanQuery(clauses []*search.BooleanClause) (search.Query, error) {
	return qp.booleanQueryDisableCoord(clauses, false)
}
931779
func paginationQuery(options *ListOptions) string {
	query := url.Values{}
	query.Set("limit", strconv.Itoa(options.Limit))
	query.Set("offset", strconv.Itoa(options.Offset))

	return query.Encode()
}
339445
func (stub *ChaincodeStub) GetPrivateDataQueryResult(collection, query string) (StateQueryIteratorInterface, error) {
	if collection == "" {
		return nil, fmt.Errorf("collection must not be an empty string")
	}
	// ignore QueryResponseMetadata as it is not applicable for a range query without pagination
	iterator, _, err := stub.handleGetQueryResult(collection, query, nil)

	return iterator, err
}
911414
func (p Pin) Close() {
	if p.f != nil {
		p.f.Close()
		p.f = nil
	}
}
258945
func (s *scanner) pushParseState(p int) {
	s.parseState = append(s.parseState, p)
}
1140632
func (d *Domain) PinVcpuFlags(vcpu uint, cpuMap []bool, flags DomainModificationImpact) error {
	maplen := (len(cpuMap) + 7) / 8
	ccpumap := make([]C.uchar, maplen)
	for i := 0; i < len(cpuMap); i++ {
		if cpuMap[i] {
			byte := i / 8
			bit := i % 8
			ccpumap[byte] |= (1 << uint(bit))
		}
	}

	var err C.virError
	result := C.virDomainPinVcpuFlagsWrapper(d.ptr, C.uint(vcpu), &ccpumap[0], C.int(maplen), C.uint(flags), &err)

	if result == -1 {
		return makeError(&err)
	}

	return nil
}
297650
func (p *pinner) IsPinnedWithType(c cid.Cid, mode Mode) (string, bool, error) {
	p.lock.RLock()
	defer p.lock.RUnlock()
	return p.isPinnedWithType(c, mode)
}
1014931
func (f *FSM) Pinned() map[lease.Key][]string {
	f.mu.Lock()
	pinned := make(map[lease.Key][]string)
	for key, entities := range f.pinned {
		if !entities.IsEmpty() {
			pinned[key] = entities.SortedValues()
		}
	}
	f.mu.Unlock()
	return pinned
}
685357
func (a *leadershipPinningAPI) PinnedLeadership() (params.PinnedLeadershipResult, error) {
	result := params.PinnedLeadershipResult{}

	canAccess, err := a.authorizer.HasPermission(permission.ReadAccess, a.modelTag)
	if err != nil {
		return result, errors.Trace(err)
	}
	if !canAccess {
		return result, ErrPerm
	}

	result.Result = a.pinner.PinnedLeadership()
	return result, nil
}
222040
func (a *leadershipPinningAPI) pinMachineAppsOps(op func(string, string) error) (params.PinApplicationsResults, error) {
	result := params.PinApplicationsResults{}

	tag := a.authorizer.GetAuthTag()
	m, err := a.st.Machine(tag.Id())
	if err != nil {
		return result, errors.Trace(err)
	}
	apps, err := m.ApplicationNames()
	if err != nil {
		return result, errors.Trace(err)
	}

	results := make([]params.PinApplicationResult, len(apps))
	for i, app := range apps {
		results[i] = params.PinApplicationResult{
			ApplicationName: app,
		}
		if err := op(app, tag.String()); err != nil {
			results[i].Error = ServerError(err)
		}
	}
	result.Results = results
	return result, nil
}
498762
func (l *Lobby) CurrentState() State {
	var state int
	db.DB.DB().QueryRow("SELECT state FROM lobbies WHERE id = $1", l.ID).Scan(&state)
	return State(state)
}
839230
func (s *Store) PinLease(key lease.Key, entity string, stop <-chan struct{}) error {
	return errors.Trace(s.pinOp(OperationPin, key, entity, stop))
}