// GetTO returns its Transfer Object
430567
func (p *ProjectFollower) GetTO(users ...*User) *ProjectFollowerTO {
	var fromInfo, toInfo *InfoTO
	if from, e := NewUser(p.From); e == nil {
		fromInfo = from.Info().GetTO()
	}
	if to, e := NewProject(p.To); e == nil {
		toInfo = to.Info().GetTO()
	}
	return &ProjectFollowerTO{
		original:  p,
		FromInfo:  fromInfo,
		ToInfo:    toInfo,
		Time:      p.Time,
		Timestamp: p.Time.Unix(),
		ToNotify:  p.ToNotify,
		Counter:   p.Counter,
	}
}
643095
func (c *client) getRTT() string {
	if c.rtt == 0 {
		// If a real client, go ahead and send ping now to get a value
		// for RTT. For tests and telnet, or if client is closing, etc skip.
		if !c.flags.isSet(clearConnection) && c.flags.isSet(connectReceived) && c.opts.Lang != "" {
			c.sendPing()
		}
		return ""
	}
	var rtt time.Duration
	if c.rtt > time.Microsecond && c.rtt < time.Millisecond {
		rtt = c.rtt.Truncate(time.Microsecond)
	} else {
		rtt = c.rtt.Truncate(time.Millisecond)
	}
	return rtt.String()
}
32187
func redirectTo(to string) func(http.ResponseWriter, *http.Request) {
	return func(rw http.ResponseWriter, req *http.Request) {
		http.Redirect(rw, req, to, http.StatusFound)
	}
}
1214473
func (s *IdentityService) GetTOTP(user string) (string, error) {
	if user == "" {
		return "", trace.BadParameter("missing user name")
	}

	item, err := s.Get(context.TODO(), backend.Key(webPrefix, usersPrefix, user, totpPrefix))
	if err != nil {
		if trace.IsNotFound(err) {
			return "", trace.NotFound("user %q is not found", user)
		}
		return "", trace.Wrap(err)
	}

	return string(item.Value), nil
}
31211
func (s *Bits) SetTo(index uint, val bool) {
	if val {
		s.Set(index)
	} else {
		s.Unset(index)
	}
}
1225211
func (l *ListCheckSuiteResults) GetTotal() int {
	if l == nil || l.Total == nil {
		return 0
	}
	return *l.Total
}
358410
func (z *ZipArchive) ExtractTo(destPath string, entries ...string) (err error) {
	return z.ExtractToFunc(destPath, defaultExtractFunc, entries...)
}
189364
func (v *Object) GetString(keys ...string) (string, error) {
	child, err := v.getPath(keys)

	if err != nil {
		return "", err
	} else {
		return child.String()
	}
}
310350
func (c *UserPostCommentRevision) GetTO(users ...*User) *UserPostCommentRevisionTO {
	return &UserPostCommentRevisionTO{
		original:  c,
		Hcid:      c.Hcid,
		Message:   c.Message,
		Time:      c.Time,
		Timestamp: c.Time.Unix(),
		RevNo:     c.RevNo,
		Counter:   c.Counter,
	}
}
1364513
func (t *ProjectPostVote) GetTO(users ...*User) *ProjectPostVoteTO {
	var fromInfo, toInfo *InfoTO
	if from, e := NewUser(t.From); e == nil {
		fromInfo = from.Info().GetTO()
	}
	if to, e := NewUser(t.To); e == nil {
		toInfo = to.Info().GetTO()
	}
	return &ProjectPostVoteTO{
		original:  t,
		Hpid:      t.Hpid,
		FromInfo:  fromInfo,
		ToInfo:    toInfo,
		Time:      t.Time,
		Timestamp: t.Time.Unix(),
		Vote:      t.Vote,
		Counter:   t.Counter,
	}
}
232529
func (c *CommitStats) GetTotal() int {
	if c == nil || c.Total == nil {
		return 0
	}
	return *c.Total
}
1360069
func (p *UserPostRevision) GetTO(users ...*User) *UserPostRevisionTO {
	return &UserPostRevisionTO{
		original:  p,
		Hpid:      p.Hpid,
		Message:   p.Message,
		Time:      p.Time,
		Timestamp: p.Time.Unix(),
		RevNo:     p.RevNo,
		Counter:   p.Counter,
	}
}
775698
func (p *PersonalInfo) GetTO() *PersonalInfoTO {
	return &PersonalInfoTO{
		original:  p,
		IsOnline:  p.IsOnline,
		Nation:    p.Nation,
		Timezone:  p.Timezone,
		Username:  p.Username,
		Name:      p.Name,
		Surname:   p.Surname,
		Gender:    p.Gender,
		Birthday:  p.Birthday,
		Gravatar:  p.Gravatar.String(),
		Interests: p.Interests,
		Quotes:    p.Quotes,
		Biography: p.Biography,
	}
}
320517
func (m *Memberlist) SendTo(to net.Addr, msg []byte) error {
	// Encode as a user message
	buf := make([]byte, 1, len(msg)+1)
	buf[0] = byte(userMsg)
	buf = append(buf, msg...)

	// Send the message
	return m.rawSendMsgPacket(to.String(), nil, buf)
}
175169
func (w *Whitelist) GetTO(users ...*User) *WhitelistTO {
	var fromInfo, toInfo *InfoTO
	if from, e := NewUser(w.From); e == nil {
		fromInfo = from.Info().GetTO()
	}
	if to, e := NewUser(w.To); e == nil {
		toInfo = to.Info().GetTO()
	}
	return &WhitelistTO{
		original:  w,
		FromInfo:  fromInfo,
		ToInfo:    toInfo,
		Time:      w.Time,
		Timestamp: w.Time.Unix(),
		Counter:   w.Counter,
	}
}
124037
func (r *RepositoriesSearchResult) GetTotal() int {
	if r == nil || r.Total == nil {
		return 0
	}
	return *r.Total
}
1320896
func (ms *MemSorters) CollectTo(part int, key, val sophie.SophieWriter) error {
	ms.RLock()
	sorter, ok := ms.sorters[part]
	ms.RUnlock()
	if !ok {
		ms.Lock()
		sorter, ok = ms.sorters[part]
		if !ok {
			sorter = &memSorter{}
			ms.sorters[part] = sorter
		}
		ms.Unlock()
	}
	sorter.Lock()
	defer sorter.Unlock()

	sorter.KeyOffs.Add(len(sorter.Buffer))
	key.WriteTo(&sorter.Buffer)
	sorter.ValOffs.Add(len(sorter.Buffer))
	val.WriteTo(&sorter.Buffer)
	sorter.ValEnds.Add(len(sorter.Buffer))

	return nil
}