// GetUserPresence will retrieve the current presence status of given user.
489605
func (api *Client) GetUserPresence(user string) (*UserPresence, error) {
	return api.GetUserPresenceContext(context.Background(), user)
}
788541
func GetContextUser(c context.Context) User {
	var i = c.Value(userKey)
	if i == nil {
		return nil
	}
	return i.(User)
}
1196463
func (api *Client) GetUserPresenceContext(ctx context.Context, user string) (*UserPresence, error) {
	values := url.Values{
		"token": {api.token},
		"user":  {user},
	}

	response, err := api.userRequest(ctx, "users.getPresence", values)
	if err != nil {
		return nil, err
	}
	return &response.UserPresence, nil
}
788915
func (api *Client) SetUserPresence(presence string) error {
	return api.SetUserPresenceContext(context.Background(), presence)
}
965908
func (provider *SpotifyProvider) GetUser(creds *common.Credentials) (common.User, error) {

	profileData, err := provider.Get(creds, spotifyEndpointProfile)

	if err != nil {
		return nil, err
	}

	// build user
	user := NewUser(profileData, creds, provider)

	return user, nil
}
817661
func (u *Unit) WaitAgentPresence(timeout time.Duration) (err error) {
	defer errors.DeferredAnnotatef(&err, "waiting for agent of unit %q", u)
	ch := make(chan presence.Change)
	pwatcher := u.st.workers.presenceWatcher()
	pwatcher.Watch(u.globalAgentKey(), ch)
	defer pwatcher.Unwatch(u.globalAgentKey(), ch)
	pingBatcher := u.st.getPingBatcher()
	if err := pingBatcher.Sync(); err != nil {
		return err
	}
	for i := 0; i < 2; i++ {
		select {
		case change := <-ch:
			if change.Alive {
				return nil
			}
		case <-time.After(timeout):
			// TODO(fwereade): 2016-03-17 lp:1558657
			return fmt.Errorf("still not alive after timeout")
		case <-pwatcher.Dead():
			return pwatcher.Err()
		}
	}
	panic(fmt.Sprintf("presence reported dead status twice in a row for unit %q", u))
}
816129
func (c *UsersListCall) Presence(presence bool) *UsersListCall {
	c.presence = presence
	return c
}
553153
func (api *API) GetUser(user_id string) (*User, error) {
	result := new(User)
	url := createUrl(api, userPathSegment, user_id)
	err := api.Client.Get(url, &result, http.StatusOK)
	if err != nil {
		return nil, err
	}
	result.api = api
	return result, nil
}
605891
func (r *AdminService) GetUser(userName string) *AdminGetUserCall {
	c := &AdminGetUserCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.userName = userName
	return c
}
462095
func printStatusErr(e error) {
	fmt.Println("Checking status of " + AppName + " failed")
	fmt.Println("Details:", e.Error())
}
366735
func (provider *GoogleProvider) GetUser(creds *common.Credentials) (common.User, error) {

	profileData, err := provider.Get(creds, googleEndpointProfile)

	if err != nil {
		return nil, err
	}

	// build user
	user := NewUser(profileData, creds, provider)

	return user, nil
}
1339912
def get_presence(self, user_name):
        
        user_id = self.get_id_by_name(user_name)
        self.params.update({
            'user': user_id,
            })
        return FromUrl('https://slack.com/api/users.getPresence', self._requests)(data=self.params).get()
513042
func (c *Client) GetUser(username string) (rec *UserInfo, err error) {
	req, err := newGETRequest(c, "users/"+PathEscape(username))
	if err != nil {
		return nil, err
	}

	if err = executeAndParseRequest(c, req, &rec); err != nil {
		return nil, err
	}

	return rec, nil
}
80620
func (api *API) UserDetails() (User, error) {
	var r UserResponse
	res, err := api.makeRequest("GET", "/user", nil)
	if err != nil {
		return User{}, errors.Wrap(err, errMakeRequestError)
	}

	err = json.Unmarshal(res, &r)
	if err != nil {
		return User{}, errors.Wrap(err, errUnmarshalError)
	}

	return r.Result, nil
}
438559
func (provider *FacebookProvider) GetUser(creds *common.Credentials) (common.User, error) {

	profileData, err := provider.Get(creds, facebookEndpointProfile)

	if err != nil {
		return nil, err
	}

	// build user
	user := NewUser(profileData, creds, provider)

	return user, nil
}
629059
func (r *Request) HeaderPresent(key string) *Request {
	r.Header.Set(key, ".*")
	return r
}
1344405
public function getPresence()
    {
        return $this->client->apiCall('users.getPresence', [
            'user' => $this->getId(),
        ])->then(function (Payload $response) {
            return $response['presence'];
        });
    }