// GetTO returns its Transfer Object
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,
	}
}
786699
func (c *ContactInfo) GetTO() *ContactInfoTO {
	var yahoo, facebook, twitter, github, website string
	if c.Website != nil {
		website = c.Website.String()
	}
	if c.GitHub != nil {
		github = c.GitHub.String()
	}
	if c.Yahoo != nil {
		yahoo = c.Yahoo.String()
	}
	if c.Facebook != nil {
		facebook = c.Facebook.String()
	}
	if c.Twitter != nil {
		twitter = c.Twitter.String()
	}
	return &ContactInfoTO{
		original: c,
		Website:  website,
		GitHub:   github,
		Skype:    c.Skype,
		Jabber:   c.Jabber,
		Yahoo:    yahoo,
		Facebook: facebook,
		Twitter:  twitter,
		Steam:    c.Steam,
	}
}
361597
func (p *PostClassification) GetTO(users ...*User) *PostClassificationTO {
	return &PostClassificationTO{
		original: p,
		ID:       p.ID,
		UHpid:    p.UHpid,
		GHpid:    p.GHpid,
		Tag:      p.Tag,
	}
}
983316
func (p *ProjectPost) GetTO(users ...*User) *PostTO {
	if len(users) != 1 {
		panic("ProjectPost.GetTO requires a user parameter")
	}
	user := users[0]
	postTO := p.Post.GetTO()
	postTO.Type = ProjectBoardID

	if from, e := NewUser(p.From); e == nil {
		postTO.FromInfo = from.Info().GetTO()
	}
	if to, e := NewProject(p.To); e == nil {
		postTO.ToInfo = to.Info().GetTO()
	}

	postTO.Rate = p.VotesCount()
	postTO.RevisionsCount = p.RevisionsNumber()
	postTO.CommentsCount = p.CommentsCount()
	postTO.BookmarksCount = p.BookmarksCount()
	postTO.LurkersCount = p.LurkersCount()
	postTO.Timestamp = p.Time.Unix()
	postTO.URL = p.URL().String()
	postTO.CanBookmark = user.CanBookmark(p)
	postTO.CanComment = user.CanComment(p)
	postTO.CanDelete = user.CanDelete(p)
	postTO.CanEdit = user.CanEdit(p)
	postTO.CanLurk = user.CanLurk(p)
	return postTO
}
638308
func (l *LabelsSearchResult) GetTotal() int {
	if l == nil || l.Total == nil {
		return 0
	}
	return *l.Total
}
724092
func (ps *PeerRoundState) MarshalTo(data []byte) (int, error) {
	bs, err := ps.Marshal()
	if err != nil {
		return -1, err
	}
	return copy(data, bs), nil
}
116801
func (c *ProjectPostComment) GetTO(users ...*User) *ProjectPostCommentTO {
	if len(users) != 1 {
		panic("ProjectPostComment.GetTO requires a user parameter")
	}
	user := users[0]

	var fromInfo, toInfo *InfoTO
	if from, e := NewUser(c.From); e == nil {
		fromInfo = from.Info().GetTO()
	}

	if to, e := NewProject(c.To); e == nil {
		toInfo = to.Info().GetTO()
	}
	return &ProjectPostCommentTO{
		original:  c,
		Hcid:      c.Hcid,
		Hpid:      c.Hpid,
		FromInfo:  fromInfo,
		ToInfo:    toInfo,
		Message:   c.Message,
		Lang:      c.Lang,
		Time:      c.Time,
		Timestamp: c.Time.Unix(),
		CanDelete: user.CanDelete(c),
		CanEdit:   user.CanEdit(c),
	}
}
386628
func (p *PoolData) CopyTo(dstP *PoolData) error {
	dstP.ParentKey = p.ParentKey
	dstP.Pool = types.GetIPNetCopy(p.Pool)

	if p.Range != nil {
		dstP.Range = &AddressRange{}
		dstP.Range.Sub = types.GetIPNetCopy(p.Range.Sub)
		dstP.Range.Start = p.Range.Start
		dstP.Range.End = p.Range.End
	}

	dstP.RefCount = p.RefCount
	return nil
}
1042217
func (s *Server) SendTo(to *Node, m Message) error {
	msg, err := s.serializer.Marshal(m)
	if err != nil {
		return fmt.Errorf("marshaling message: %v", err)
	}
	msg = append([]byte{getMessageType(m)}, msg...)
	return s.defaultClient.SendMessage(context.Background(), &to.URI, msg)
}
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()
}
1313698
func (fs *FileSorter) CollectTo(part int, key, val sophie.SophieWriter) error {
	fs.RLock()
	mo, ok := fs.mapOuts[part]
	fs.RUnlock()
	if !ok {
		fs.Lock()
		mo, ok = fs.mapOuts[part]
		if !ok {
			fldMapOut := fs.TmpFolder.Join(pathMapOut)
			fldMapOut.Mkdir(0755)
			path := fldMapOut.Join(fmt.Sprintf(fmtPart, part))

			writer, err := kv.NewWriter(path)
			if err != nil {
				fs.Unlock()
				return err
			}
			mo = &mapOut{rawPath: path, writer: writer}
			fs.mapOuts[part] = mo
		}
		fs.Unlock()
	}
	return mo.Collect(key, val)
}
934465
func (l *ProjectPostLurk) GetTO(users ...*User) *ProjectPostLurkTO {
	var fromInfo, toInfo *InfoTO
	if from, e := NewUser(l.From); e == nil {
		fromInfo = from.Info().GetTO()
	}
	if to, e := NewProject(l.To); e == nil {
		toInfo = to.Info().GetTO()
	}
	return &ProjectPostLurkTO{
		original:  l,
		Hpid:      l.Hpid,
		FromInfo:  fromInfo,
		ToInfo:    toInfo,
		Time:      l.Time,
		Timestamp: l.Time.Unix(),
		Counter:   l.Counter,
	}
}
1216419
func (p *SpecialProject) GetTO(users ...*User) *SpecialProjectTO {
	return &SpecialProjectTO{
		original: p,
		Role:     p.Role,
		Counter:  p.Counter,
	}
}
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
}
1187084
func (g *Graph) GetAt(i int) *Graph {
	if i >= len(g.Out) || i < 0 {
		return nil
	}

	return g.Out[i]
}
353513
func (u *UsersSearchResult) GetTotal() int {
	if u == nil || u.Total == nil {
		return 0
	}
	return *u.Total
}
598783
func (l *ListCheckRunsResults) GetTotal() int {
	if l == nil || l.Total == nil {
		return 0
	}
	return *l.Total
}