// PinWithMode allows the user to have fine grained control over pin
// counts
971646
func (p *pinner) PinWithMode(c cid.Cid, mode Mode) {
	p.lock.Lock()
	defer p.lock.Unlock()
	switch mode {
	case Recursive:
		p.recursePin.Add(c)
	case Direct:
		p.directPin.Add(c)
	}
}
1287204
func (d *GrovePiDriver) PinMode(pin byte, mode string) error {
	var b []byte
	if mode == "output" {
		b = []byte{CommandPinMode, pin, 1, 0}
	} else {
		b = []byte{CommandPinMode, pin, 0, 0}
	}
	_, err := d.connection.Write(b)

	time.Sleep(2 * time.Millisecond)

	_, err = d.connection.ReadByte()

	return err
}
946699
func (s *CampaignHook) SetMode(v string) *CampaignHook {
	s.Mode = &v
	return s
}
538237
func (c *Overlay) SetInspectModeWithParams(v *OverlaySetInspectModeParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Overlay.setInspectMode", Params: v})
}
372925
func scannerMode(mode uint) scanner.Mode {
	var m scanner.Mode
	if mode&ParseComments != 0 {
		m |= scanner.ScanComments
	}
	return m
}
470018
func WithNetworkMode(mode string) func(*TestContainerConfig) {
	return func(c *TestContainerConfig) {
		c.HostConfig.NetworkMode = containertypes.NetworkMode(mode)
	}
}
537801
func PinName(pin Pin) string {
	p := definedPins[pin]
	if p == nil {
		return ""
	}
	return p.names[0]
}
536662
func (w *Watcher) removePin(p Pin) {
	// we don't index by pin, so go looking
	for fd, pin := range w.pins {
		if pin.Number == p.Number {
			// found pin
			w.removeFd(fd)
			return
		}
	}
}
320198
func (s *BlobMetadata) SetMode(v string) *BlobMetadata {
	s.Mode = &v
	return s
}
1120766
func (api *Client) AddPinContext(ctx context.Context, channel string, item ItemRef) error {
	values := url.Values{
		"channel": {channel},
		"token":   {api.token},
	}
	if item.Timestamp != "" {
		values.Set("timestamp", item.Timestamp)
	}
	if item.File != "" {
		values.Set("file", item.File)
	}
	if item.Comment != "" {
		values.Set("file_comment", item.Comment)
	}

	response := &SlackResponse{}
	if err := api.postMethod(ctx, "pins.add", values, response); err != nil {
		return err
	}

	return response.Err()
}
118634
func (s *ObjectLockRetention) SetMode(v string) *ObjectLockRetention {
	s.Mode = &v
	return s
}
1104086
func (c *Ctx) SetMode(modes Modes) Modes {
	return Modes(C.X_SSL_CTX_set_mode(c.ctx, C.long(modes)))
}
954908
func (n *NetworkOpt) NetworkMode() string {
	networkIDOrName := "default"
	netOptVal := n.Value()
	if len(netOptVal) > 0 {
		networkIDOrName = netOptVal[0].Target
	}
	return networkIDOrName
}
672182
func FileMode(fm os.FileMode) PermissionBits {
	perm := PermissionBits(fm.Perm())

	if fm&os.ModeSetuid != 0 {
		perm.SetSetuid(true)
	}
	if fm&os.ModeSetgid != 0 {
		perm.SetSetgid(true)
	}
	if fm&os.ModeSticky != 0 {
		perm.SetSticky(true)
	}
	return perm
}
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)
}
1177633
func AssignPins(pins PinList, module Module) error {
	for _, pin := range pins {
		e := AssignPin(pin, module)
		if e != nil {
			return e
		}
	}
	return nil
}
1103426
func WithRstPin(val string) func(Config) {
	return func(c Config) {
		d, ok := c.(*SSD1306Driver)
		if ok {
			d.RSTPin = val
		} else {
			panic("unable to set rst pin for ssd1306")
		}
	}
}