// Single enables single song mode, if single is true, disables it otherwise.
15273
func (c *Client) Single(single bool) error {
	if single {
		return c.Command("single 1").OK()
	}
	return c.Command("single 0").OK()
}
689943
func (f *File) Mode() os.FileMode {
	mode := os.FileMode(f.ino.Mode & 0777)
	switch f.ino.Mode & ifmt {
	case ififo:
		mode |= os.ModeNamedPipe
	default: // ifchr, ifblk, unknown
		mode |= os.ModeDevice
	case ifdir:
		mode |= os.ModeDir
	case ifreg:
		// no bits
	case iflnk:
		mode |= os.ModeSymlink
	case ifsock:
		mode |= os.ModeSocket
	}
	return mode
}
1337472
func (u *uploader) singlePart(buf io.ReadSeeker) (*UploadOutput, error) {
	params := &s3.PutObjectInput{}
	awsutil.Copy(params, u.in)
	params.Body = buf

	// Need to use request form because URL generated in request is
	// used in return.
	req, out := u.cfg.S3.PutObjectRequest(params)
	req.SetContext(u.ctx)
	req.ApplyOptions(u.cfg.RequestOptions...)
	if err := req.Send(); err != nil {
		return nil, err
	}

	url := req.HTTPRequest.URL.String()
	return &UploadOutput{
		Location:  url,
		VersionID: out.VersionId,
	}, nil
}
846826
func (s *CatIndicesService) PrimaryOnly(primaryOnly bool) *CatIndicesService {
	s.primaryOnly = &primaryOnly
	return s
}
1326659
func Version() string {
	b, _ := ioutil.ReadFile("../VERSION")
	v := string(b)
	return v
}
994009
func (d *Decoder) Format() *audio.Format {
	if d == nil {
		return nil
	}
	return &audio.Format{
		NumChannels: int(d.NumChans),
		SampleRate:  int(d.SampleRate),
	}
}
994180
func (fi headerFileInfo) Mode() (mode os.FileMode) {
	// Set file permission bits.
	mode = os.FileMode(fi.h.Mode).Perm()
	return mode
}
58166
func Version() string {
	// Start with the major, minor, and patch versions.
	version := fmt.Sprintf("%d.%d.%d", appMajor, appMinor, appPatch)

	// Append pre-release version if there is one.  The hyphen called for
	// by the semantic versioning spec is automatically appended and should
	// not be contained in the pre-release string.  The pre-release version
	// is not appended if it contains invalid characters.
	preRelease := normalizeVerString(appPreRelease)
	if preRelease != "" {
		version = fmt.Sprintf("%s-%s", version, preRelease)
	}

	// Append commit hash of current build to version.
	version = fmt.Sprintf("%s commit=%s", version, Commit)

	return version
}
524519
func (s *DeleteByQueryService) Version(version bool) *DeleteByQueryService {
	s.version = &version
	return s
}
962145
func SingleNodeCluster(hostport string, hostMap map[string][]string) bool {
	// If the map contains more than one host then clearly there is more than
	// one address so we can't be a single node cluster.
	if len(hostMap) > 1 {
		return false
	}

	host := CaptureHost(hostport)

	// If hostport is not even in the map at all then it's not possible for
	// us to be a single node cluster.
	_, ok := hostMap[host]
	if !ok {
		return false
	}

	// Same as above; there is most than one host
	if len(hostMap[host]) > 1 {
		return false
	}

	// There is a single hostport in the map; check that it matches
	if hostMap[host][0] == hostport {
		return true
	}

	// There is a single hostport in the map but it doesn't match the given
	// hostport.
	return false
}
247104
func (q Query) SingleWith(predicate func(interface{}) bool) (r interface{}) {
	next := q.Iterate()
	found := false

	for item, ok := next(); ok; item, ok = next() {
		if predicate(item) {
			if found {
				return nil
			}

			found = true
			r = item
		}
	}

	return
}
585460
func (query Query) One(record interface{}) error {
	query.LimitResult = 1
	count, err := query.repo.adapter.All(query, record, query.repo.logger...)

	if err != nil {
		return transformError(err)
	} else if count == 0 {
		return errors.New("no result found", "", errors.NotFound)
	} else {
		return nil
	}
}
1284704
func (c *GitTreesService) One() (tree *GitTree, result *Result) {
	result = c.client.get(c.URL, &tree)
	return
}
1258379
func (s *RatesService) Single(code string) (*float64, error) {
	// No base currency provided, let them know!
	if baseCurrency == "" || code == "" {
		return nil, errors.New("Both the base currency and requested currency values must be set")
	}

	// If we have cached results, use them.
	results := s.client.Cache.Get(baseCurrency)
	if results != nil {
		single := results.Rates[code]
		return &single, nil
	}

	// No cached results, go and fetch them.
	err := s.client.Update.LatestRates(baseCurrency)
	if err != nil {
		return nil, err
	}

	return s.Single(code)
}
835931
func SingleVersionValidator(desiredVersion Version) VersionValidator {
	return func(version Version) error {
		if version == desiredVersion {
			return nil
		}

		return ErrBadVersion{version}
	}
}
738779
func (pt *PlaylistTrack) Track() *Track {
	// TODO return PlaylistTrack and add extra functionality on top of that
	sp_track := C.sp_playlist_track(pt.playlist.sp_playlist, C.int(pt.index))
	return newTrack(pt.playlist.session, sp_track)
}
1203931
func (b *InsertStmt) Pair(column string, value interface{}) *InsertStmt {
	b.Column = append(b.Column, column)
	switch len(b.Value) {
	case 0:
		b.Values(value)
	case 1:
		b.Value[0] = append(b.Value[0], value)
	default:
		panic("pair only allows one record to insert")
	}
	return b
}