// GetTO returns its Transfer Object
336700
func (u *DeletedUser) GetTO(users ...*User) *DeletedUserTO {
	return &DeletedUserTO{
		original:   u,
		Counter:    u.Counter,
		Username:   u.Username,
		Time:       u.Time,
		Timestamp:  u.Time.Unix(),
		Motivation: u.Motivation,
	}
}
1368768
func (us *UnSme) SerializeTo(w io.Writer) error {
	_, err := w.Write(us.Bytes())
	return err
}
31211
func (s *Bits) SetTo(index uint, val bool) {
	if val {
		s.Set(index)
	} else {
		s.Unset(index)
	}
}
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)
}
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
}
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),
	}
}
1333758
func (s *CreateExportTaskInput) SetTo(v int64) *CreateExportTaskInput {
	s.To = &v
	return s
}
724092
func (ps *PeerRoundState) MarshalTo(data []byte) (int, error) {
	bs, err := ps.Marshal()
	if err != nil {
		return -1, err
	}
	return copy(data, bs), nil
}
451029
func (p *Post) GetTO(users ...*User) *PostTO {
	return &PostTO{
		original:  p,
		Hpid:      p.Hpid,
		Pid:       p.Pid,
		Message:   p.Message,
		Time:      p.Time,
		Timestamp: p.Time.Unix(),
		Lang:      p.Lang,
		News:      p.News,
		Closed:    p.Closed,
	}
}
443537
func (o *ProjectOwner) GetTO(users ...*User) *ProjectOwnerTO {
	var fromInfo, toInfo *InfoTO
	if from, e := NewUser(o.From); e == nil {
		fromInfo = from.Info().GetTO()
	}
	if to, e := NewProject(o.To); e == nil {
		toInfo = to.Info().GetTO()
	}
	return &ProjectOwnerTO{
		original:  o,
		FromInfo:  fromInfo,
		ToInfo:    toInfo,
		Time:      o.Time,
		Timestamp: o.Time.Unix(),
		ToNotify:  o.ToNotify,
		Counter:   o.Counter,
	}

}
667916
func (f *fifoProcessor) PullTo(cnx redis.Conn, src, dest string,
	timeout time.Duration) ([]byte, error) {

	bytes, err := redis.Bytes(cnx.Do("BRPOPLPUSH", src, dest, block(timeout)))
	if err != nil {
		return nil, err
	}

	return bytes, nil
}
358410
func (z *ZipArchive) ExtractTo(destPath string, entries ...string) (err error) {
	return z.ExtractToFunc(destPath, defaultExtractFunc, entries...)
}
1235959
func (m *ProjectMember) GetTO(users ...*User) *ProjectMemberTO {
	var fromInfo, toInfo *InfoTO
	if from, e := NewUser(m.From); e == nil {
		fromInfo = from.Info().GetTO()
	}
	if to, e := NewProject(m.To); e == nil {
		toInfo = to.Info().GetTO()
	}
	return &ProjectMemberTO{
		original:  m,
		FromInfo:  fromInfo,
		ToInfo:    toInfo,
		Time:      m.Time,
		Timestamp: m.Time.Unix(),
		ToNotify:  m.ToNotify,
		Counter:   m.Counter,
	}
}
378298
func (p *PullRequestComment) GetInReplyTo() int64 {
	if p == nil || p.InReplyTo == nil {
		return 0
	}
	return *p.InReplyTo
}
588048
func (v *Variable) SerializeTo(w io.Writer) error {
	_, err := w.Write(v.Bytes())
	return err
}
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)
}
180688
func (u *UserFollower) GetTO(users ...*User) *UserFollowerTO {
	var fromInfo, toInfo *InfoTO
	if from, e := NewUser(u.From); e == nil {
		fromInfo = from.Info().GetTO()
	}
	if to, e := NewUser(u.To); e == nil {
		toInfo = to.Info().GetTO()
	}
	return &UserFollowerTO{
		original:  u,
		FromInfo:  fromInfo,
		ToInfo:    toInfo,
		Time:      u.Time,
		Timestamp: u.Time.Unix(),
		ToNotify:  u.ToNotify,
		Counter:   u.Counter,
	}
}