Returns a UserObj (or whatever the self.user_class is) by using the
        user's access token.
        :param attr_map: Dictionary map from Cognito attributes to attribute
        names we would like to show to our users
        :return:
17854
def get_user(self, attr_map=None):
        
        user = self.client.get_user(
                AccessToken=self.access_token
            )

        user_metadata = {
            'username': user.get('Username'),
            'id_token': self.id_token,
            'access_token': self.access_token,
            'refresh_token': self.refresh_token,
        }
        return self.get_user_obj(username=self.username,
                                 attribute_list=user.get('UserAttributes'),
                                 metadata=user_metadata,attr_map=attr_map)
192711
def _cache_key(self, attr_name):
        
        dn = self._ldap_user.dn.replace(' ', '%20')
        key = u'auth_ldap.%s.%s.%s' % (self.__class__.__name__, attr_name, dn)

        return key
658917
def authenticated_userid(request):
    
    user = getattr(request, 'user', None)
    key = user.pk_field()
    return getattr(user, key)
191282
def get_user(self, validated_token):
        
        if api_settings.USER_ID_CLAIM not in validated_token:
            # The TokenUser class assumes tokens will have a recognizable user
            # identifier claim.
            raise InvalidToken(_('Token contained no recognizable user identification'))

        return TokenUser(validated_token)
671743
@GET
  @Path("/db/{authenticatorName}/cachedSerializedUserMap")
  @Produces(SmileMediaTypes.APPLICATION_JACKSON_SMILE)
  @Consumes(MediaType.APPLICATION_JSON)
  @ResourceFilters(BasicSecurityResourceFilter.class)
  public Response getCachedSerializedUserMap(
      @Context HttpServletRequest req,
      @PathParam("authenticatorName") final String authenticatorName
  )
  {
    return handler.getCachedSerializedUserMap(authenticatorName);
  }
149188
User getMe(AccessToken accessToken, String... attributes) {
        return getVersion() == Version.OSIAM_3
                ? mapToType(getMeResource(accessToken, attributes), User.class)
                : getUser(getCurrentUserBasic(accessToken).getId(), accessToken);
    }
151563
def view_getattr():
    

    def view_getattr(_value, context, **_params):
        value = getattr(context["view"], context["key"])
        return _attr(value)

    return view_getattr
292720
def auth_criteria(self):
        
        # the dictionary we will return
        auth = {}

        # go over each attribute of the service
        for attr in dir(self):
            # make sure we could hit an infinite loop
            if attr != 'auth_criteria':
                # get the actual attribute
                attribute = getattr(self, attr)
                # if the service represents an auth criteria
                if isinstance(attribute, Callable) and hasattr(attribute, '_service_auth'):
                    # add the criteria to the final results
                    auth[getattr(self, attr)._service_auth] = attribute

        # return the auth mapping
        return auth
195681
def _getAttrGroupMember(self, attrGroup, attr):
        
        method_name = '%s_%s' % (attrGroup, attr)
        return getattr(self, method_name)
98850
@Override
    public Map<String, List<Object>> getAttributes() {
        final Map<String, List<Object>> attributeMap = new LinkedHashMap<String, List<Object>>();

        for (final LocalAccountPersonAttributeImpl attribute : attributes) {
            final List<Object> objValues = this.getObjectValues(attribute);
            attributeMap.put(attribute.getName(), objValues);
        }

        return Collections.unmodifiableMap(attributeMap);
    }
237391
def get_user_id(self, user_id, mount_point='app-id', wrap_ttl=None):
        
        path = '/v1/auth/{0}/map/user-id/{1}'.format(mount_point, user_id)
        return self._adapter.get(path, wrap_ttl=wrap_ttl).json()
577666
def create_identity(self, user, sp_mapping, **extra_config):
        

        return {
            out_attr: getattr(user, user_attr)
            for user_attr, out_attr in sp_mapping.items()
            if hasattr(user, user_attr)
        }
125280
def get_access_token
      @client = TwitterOAuth::Client.new(:consumer_key => ConsumerKey, :consumer_secret => ConsumerSecret)
      request_token = @client.request_token
      # ask the user to visit the auth url
      puts "To authenticate your client, visit the URL: #{request_token.authorize_url}"
      open_link request_token.authorize_url
      # wait for the user to give us the PIN back
      print 'Enter PIN: '
      begin
        @client.authorize(request_token.token, request_token.secret, :oauth_verifier => self.class.get_input.chomp)
      rescue OAuth::Unauthorized
        false # Didn't get an access token
      end
    end
613712
def instance_get(attribute)
      getter = :"#{self.name}_#{attribute}"
      self.instance.send(getter) if instance.respond_to?(getter)
    end
1233297
public java.util.Map<java.lang.String, org.tensorflow.framework.AttrValue> getAttrMap() {
    return internalGetAttr().getMap();
  }
1207586
protected String getRenderedUserProfile(final Map<String, Object> model) {
        if (oauthProperties.getUserProfileViewType() == OAuthProperties.UserProfileViewTypes.FLAT) {
            val flattened = new LinkedHashMap<String, Object>();
            if (model.containsKey(MODEL_ATTRIBUTE_ATTRIBUTES)) {
                val attributes = Map.class.cast(model.get(MODEL_ATTRIBUTE_ATTRIBUTES));
                flattened.putAll(attributes);
            }
            model.keySet()
                .stream()
                .filter(k -> !k.equalsIgnoreCase(MODEL_ATTRIBUTE_ATTRIBUTES))
                .forEach(k -> flattened.put(k, model.get(k)));
            LOGGER.trace("Flattened user profile attributes with the final model as [{}]", model);
            return OAuth20Utils.toJson(flattened);
        }
        return OAuth20Utils.toJson(model);

    }
1228911
private int attributeMap(String name) {
        Integer num = map.get(name);
        if (num == null) {
            return 0;
        }
        return num.intValue();
    }