// GetAccount retrives an account
970567
func GetAccount(host, token, id string) (*map[string]interface{}, error) {
	path := variables.APIPathAccount
	path = strings.Replace(path, ":id", id, 1)
	return GenericRequest(host, path, token, nil)
}
435527
func (t *TrafficData) GetCount() int {
	if t == nil || t.Count == nil {
		return 0
	}
	return *t.Count
}
1233970
func (a *Amount) GetAmount(now time.Time) (int32, error) {
	for _, s := range a.GetChange() {
		start, err := s.mostRecentStart(now)
		if err != nil {
			return 0, errors.Annotate(err, "invalid start time").Err()
		}
		if start.Before(now) || start.Equal(now) {
			sec, err := s.Length.ToSeconds()
			if err != nil {
				return 0, errors.Annotate(err, "invalid length").Err()
			}
			end := start.Add(time.Second * time.Duration(sec))
			if now.Before(end) {
				return s.Amount, nil
			}
		}
	}
	return a.GetDefault(), nil
}
590101
func AccountsGet(c web.C, w http.ResponseWriter, r *http.Request) {
	// Get the account ID from the request
	id := c.URLParams["id"]

	// Right now we only support "me" as the ID
	if id != "me" {
		utils.JSONResponse(w, 501, &AccountsGetResponse{
			Success: false,
			Message: `Only the "me" user is implemented`,
		})
		return
	}

	// Fetch the current session from the database
	session := c.Env["token"].(*models.Token)

	// Fetch the user object from the database
	user, err := env.Accounts.GetAccount(session.Owner)
	if err != nil {
		utils.JSONResponse(w, 500, &AccountsDeleteResponse{
			Success: false,
			Message: "Unable to resolve the account",
		})
		return
	}

	// Return the user struct
	utils.JSONResponse(w, 200, &AccountsGetResponse{
		Success: true,
		Account: user,
	})
}
1032535
func (s *AccountService) CreateAccount(p *CreateAccountParams) (*CreateAccountResponse, error) {
	resp, err := s.cs.newRequest("createAccount", p.toURLValues())
	if err != nil {
		return nil, err
	}

	if resp, err = getRawValue(resp); err != nil {
		return nil, err
	}

	var r CreateAccountResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
899925
func NewAccount(AccountId string, Name *Name, Email string, EmailVerified bool, Disabled bool) *Account {
	s := new(Account)
	s.AccountId = AccountId
	s.Name = Name
	s.Email = Email
	s.EmailVerified = EmailVerified
	s.Disabled = Disabled
	return s
}
1060583
func (s *AccountsService) GetAccount(account string) (*AccountInfo, *Response, error) {
	u := fmt.Sprintf("accounts/%s", account)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	v := new(AccountInfo)
	resp, err := s.client.Do(req, v)
	if err != nil {
		return nil, resp, err
	}

	return v, resp, err
}
112560
func (c *Client) GetAuth(accessToken string) (resp GetAuthResponse, err error) {
	options := GetAuthOptions{
		AccountIDs: []string{},
	}
	return c.GetAuthWithOptions(accessToken, options)
}
565242
func (ud *UltraDns) GetAccountDetails() ([]AccInfo, error) {
	var Res struct {
		RInfo    ResultInfo `json:"resultInfo"`
		Accounts []AccInfo  `json:"accounts"`
	}

	_, body, err := ud.Client.Get(UltraHost+"/v1/accounts").
		Set("Authorization", ud.tokenHeader).End()
	if err != nil {
		return Res.Accounts, errors.New("Authentication Failed")
	}

	errr := json.Unmarshal([]byte(body), &Res)
	if errr != nil {
		return Res.Accounts, errors.New("Unmarshal Error")
	}

	return Res.Accounts, nil
}
1005780
func (s *Server) LookupAccount(name string) (*Account, error) {
	return s.lookupAccount(name)
}
345979
func (c *ApiController) GetAccountOrganizations() {
	fmt.Println("Start get account organizations")

	client := github.NewClient(oauthCfg.Client(oauth2.NoContext, tkn))

	organizations, _, err := client.Organizations.List("", nil)
	if err != nil {
		fmt.Println("error getting organizations")
		fmt.Println(nil)
	}

	c.Data["json"] = organizations
	c.ServeJson()
}
1021069
func (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error) {
	acc, err := fetchKeystore(s.am).NewAccount(password)
	if err == nil {
		return acc.Address, nil
	}
	return common.Address{}, err
}
1175652
func (c *Client) DisableAccount(p *DisableAccountParameter) (*Account, error) {
	obj, err := c.Request("disableAccount", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Account), err
}
685232
func (db *DB) GetAccounts() []AccountModel {
	db.Lock()
	defer db.Unlock()
	ids := make([]int, len(db.accounts))
	i := 0
	for id := range db.accounts {
		ids[i] = id
		i++
	}
	sort.Ints(ids)
	list := make([]AccountModel, len(ids))
	for i, id := range ids {
		list[i] = *db.accounts[id]
	}
	return list
}
220323
func (pm *ProtocolManager) getAccount(triedb *trie.Database, root, hash common.Hash) (state.Account, error) {
	trie, err := trie.New(root, triedb)
	if err != nil {
		return state.Account{}, err
	}
	blob, err := trie.TryGet(hash[:])
	if err != nil {
		return state.Account{}, err
	}
	var account state.Account
	if err = rlp.DecodeBytes(blob, &account); err != nil {
		return state.Account{}, err
	}
	return account, nil
}
65437
func (s *ScopedKeyManager) LookupAccount(ns walletdb.ReadBucket, name string) (uint32, error) {
	s.mtx.RLock()
	defer s.mtx.RUnlock()

	return s.lookupAccount(ns, name)
}
43663
func GenesisAccountFromAccount(name string, account *acm.Account) Account {
	return Account{
		Name:        name,
		Permissions: account.Permissions,
		BasicAccount: BasicAccount{
			Address: account.Address,
			Amount:  account.Balance,
		},
	}
}