// AvatarLink returns repository avatar absolute link.
165547
func (repo *Repository) AvatarLink() string {
	link := repo.RelAvatarLink()
	if link[0] == '/' && link[1] != '/' {
		return setting.AppURL + strings.TrimPrefix(link, setting.AppSubURL)[1:]
	}
	return link
}
1168076
func (s *SetSpec) Link(scope Scope) (TypeSpec, error) {
	if s.linked() {
		return s, nil
	}

	var err error
	s.ValueSpec, err = s.ValueSpec.Link(scope)
	return s, err
}
620874
func (e *AutoscalingGroup) CloudformationLink() *cloudformation.Literal {
	return cloudformation.Ref("AWS::AutoScaling::AutoScalingGroup", fi.StringValue(e.Name))
}
1058683
func (s *IssueService) AddLink(issueLink *IssueLink) (*Response, error) {
	apiEndpoint := fmt.Sprintf("rest/api/2/issueLink")
	req, err := s.client.NewRequest("POST", apiEndpoint, issueLink)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(req, nil)
	if err != nil {
		err = NewJiraError(resp, err)
	}

	return resp, err
}
978989
func (trc *TumblrRestClient) Avatar(blogname string, size int) AvatarResponse {
	requestUrl := trc.request.host + fmt.Sprintf("/v2/blog/%s/avatar/%d", blogname, size)
	httpRequest, err := http.NewRequest("GET", requestUrl, nil)
	if err != nil {
		fmt.Println(err)
	}
	transport := &http.Transport{}
	httpResponse, err2 := transport.RoundTrip(httpRequest)
	if err2 != nil {
		fmt.Println(err2)
	}
	defer httpResponse.Body.Close()
	body, err3 := ioutil.ReadAll(httpResponse.Body)
	if err3 != nil {
		fmt.Println(err3)
	}
	data := trc.request.JSONParse(body)
	var result AvatarResponse
	json.Unmarshal(data.Response, &result)
	return result
}
536409
func (b *Build) BuilderLink() *Link {
	if b.Builder == nil {
		panic("Invalid build")
	}
	builder := b.Builder
	return NewLink(
		builder.Builder,
		fmt.Sprintf("/p/%s/builders/%s/%s", builder.Project, builder.Bucket, builder.Builder),
		fmt.Sprintf("Builder %s in bucket %s", builder.Builder, builder.Bucket))
}
843593
func (nct *NhacCuaTui) GetDirectLink(link string) ([]glod.Response, error) {
	var listSong []glod.Response
	return listSong, nil
}
123933
func (s *StructSpec) Link(scope Scope) (TypeSpec, error) {
	if s.linked() {
		return s, nil
	}

	err := s.Fields.Link(scope)
	return s, err
}
64794
func (csn *ChiaSeNhac) GetDirectLink(link string) ([]glod.Response, error) {
	var listSong []glod.Response
	return listSong, nil
}
342805
func (o *Enterprise) Avatars(info *bambou.FetchingInfo) (AvatarsList, *bambou.Error) {

	var list AvatarsList
	err := bambou.CurrentSession().FetchChildren(o, AvatarIdentity, &list, info)
	return list, err
}
1210100
func (l *linkIndex) link(parent, child *container.Container, alias string) {
	l.mu.Lock()

	if l.idx[parent] == nil {
		l.idx[parent] = make(map[string]*container.Container)
	}
	l.idx[parent][alias] = child
	if l.childIdx[child] == nil {
		l.childIdx[child] = make(map[*container.Container]map[string]struct{})
	}
	if l.childIdx[child][parent] == nil {
		l.childIdx[child][parent] = make(map[string]struct{})
	}
	l.childIdx[child][parent][alias] = struct{}{}

	l.mu.Unlock()
}
859170
func GetGravatar(id string, size int, dtype AvatarType) string {
	h := md5.New()
	h.Write([]byte(id))
	sum := h.Sum(nil)
	return fmt.Sprintf("https://secure.gravatar.com/avatar/%x?s=%d&d=%s", sum, size, dtype)
}
241168
func (u *User) RelAvatarLink() string {
	defaultImgUrl := setting.AppSubURL + "/img/avatar_default.png"
	if u.ID == -1 {
		return defaultImgUrl
	}

	switch {
	case u.UseCustomAvatar:
		if !com.IsExist(u.CustomAvatarPath()) {
			return defaultImgUrl
		}
		return fmt.Sprintf("%s/%s/%d", setting.AppSubURL, USER_AVATAR_URL_PREFIX, u.ID)
	case setting.DisableGravatar, setting.OfflineMode:
		if !com.IsExist(u.CustomAvatarPath()) {
			if err := u.GenerateRandomAvatar(); err != nil {
				log.Error(3, "GenerateRandomAvatar: %v", err)
			}
		}

		return fmt.Sprintf("%s/%s/%d", setting.AppSubURL, USER_AVATAR_URL_PREFIX, u.ID)
	}
	return tool.AvatarLink(u.AvatarEmail)
}
979508
func (r *RepositoriesService) All(uri *Hyperlink, params M) (repos []Repository,
	result *Result) {
	if uri == nil && len(params) == 0 {
		uri = &UserRepositoriesURL
	} else if uri == nil {
		uri = &AllRepositoriesURL
	}
	url, err := uri.Expand(params)
	if err != nil {
		return nil, &Result{Err: err}
	}
	result = r.client.get(url, &repos)
	return
}
1180614
func (self *Graph) Link(source, target uint32, weight float64) {
	if _, ok := self.nodes[source]; ok == false {
		self.nodes[source] = &node{
			weight:   0,
			outbound: 0,
		}
	}

	self.nodes[source].outbound += weight

	if _, ok := self.nodes[target]; ok == false {
		self.nodes[target] = &node{
			weight:   0,
			outbound: 0,
		}
	}

	if _, ok := self.edges[source]; ok == false {
		self.edges[source] = map[uint32]float64{}
	}

	self.edges[source][target] += weight
}
141634
func CreateLink(c web.C, w http.ResponseWriter, r *http.Request) {
	account := r.Header.Get("X-Remote-User")
	l := Link{
		ShortLink: uniuri.New(),
		Target:    r.FormValue("t"),
		Owner:     account,
	}
	links[l.ShortLink] = l

	fmt.Fprintf(w, "%s\n", l.ShortLink)
	return
}
485751
func (bow *Browser) Links() []*Link {
	links := make([]*Link, 0, InitialAssetsSliceSize)
	bow.Find("a").Each(func(_ int, s *goquery.Selection) {
		href, err := bow.attrToResolvedUrl("href", s)
		if err == nil {
			links = append(links, NewLinkAsset(
				href,
				bow.attrOrDefault("id", "", s),
				s.Text(),
			))
		}
	})

	return links
}