Display information about a snapshot profile.

    Resource can be a profile name or ID
332143
def info(gandi, resource):
    
    output_keys = ['id', 'name', 'kept_total', 'target', 'quota_factor',
                   'schedules']

    result = gandi.snapshotprofile.info(resource)
    output_snapshot_profile(gandi, result, output_keys)
    return result
339434
def _get_resource_id(resource, name, region=None, key=None,
                     keyid=None, profile=None):
    '''
    
    '''

    _id = _cache_id(name, sub_resource=resource,
                    region=region, key=key,
                    keyid=keyid, profile=profile)
    if _id:
        return _id

    r = _get_resource(resource, name=name, region=region, key=key,
                      keyid=keyid, profile=profile)

    if r:
        return r.id
965422
def profile(request):
    '''
        
    '''
    context = {}

    if request.method == 'POST':
        form = PasswordChangeForm(request.user, request.POST)
        if form.is_valid():
            form.save()
            messages.info(request, 'Password Changed.')
    else:
        form = PasswordChangeForm(request.user)

    key = Key.objects.get(email=request.user.email)
    
    #analytics
    endpoint_q = key.reports.values('api__name', 'endpoint').annotate(calls=Sum('calls')).order_by('-calls')
    endpoints = [{'endpoint':'.'.join((d['api__name'], d['endpoint'])),
                  'calls': d['calls']} for d in endpoint_q]
    date_q = key.reports.values('date').annotate(calls=Sum('calls')).order_by('date')
    context['endpoints'], context['endpoint_calls'] = _dictlist_to_lists(endpoints, 'endpoint', 'calls')
    context['timeline'] = date_q

    context['form'] = form
    context['key'] = key
    context['password_is_key'] = request.user.check_password(key.key)
    return render_to_response('locksmith/profile.html', context,
                              context_instance=RequestContext(request))
885500
def get_user_profile(self, user_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - user_id
        """ID"""
        path["user_id"] = user_id

        self.logger.debug("GET /api/v1/users/{user_id}/profile with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/users/{user_id}/profile".format(**path), data=data, params=params, single_item=True)
170795
def get_fullname(snapshot):
    
    actor = get_actor(snapshot)
    properties = api.get_user_properties(actor)
    return properties.get("fullname", actor)
321751
def snapshot(self):
        """"""
        self._snapshot = {
            'muted': self.muted,
            'volume': self.volume,
            'stream': self.stream
        }
        _LOGGER.info('took snapshot of current state of %s', self.friendly_name)
875710
def list(gandi, only_paas, only_vm):
    
    target = None
    if only_paas and not only_vm:
        target = 'paas'
    if only_vm and not only_paas:
        target = 'vm'

    output_keys = ['id', 'name', 'kept_total', 'target']
    result = gandi.snapshotprofile.list({}, target=target)

    for num, profile in enumerate(result):
        if num:
            gandi.separator_line()
        output_snapshot_profile(gandi, profile, output_keys)

    return result
1375041
def find_snapshots
      unless @lineage
        s = @servers.first
        kind_params = s.transform_parameters(s.parameters)
        @lineage = kind_params['DB_LINEAGE_NAME'].gsub(/text:/, "")
      end
      snapshots = Ec2EbsSnapshot.find_by_cloud_id(@servers.first.cloud_id).select { |n| n.nickname =~ /#{@lineage}.*$/ }
    end
737255
def _get_snapshot(self):
    """"""
    return self._scheduler_session.product_request(
      Snapshot, subjects=[PathGlobs(self._invalidation_globs)])[0]
708337
function onUpdateProfile() {
  var displayName = $('#display-name').val();
  var photoURL = $('#photo-url').val();
  activeUser().updateProfile({
    'displayName': displayName,
    'photoURL': photoURL
  }).then(function() {
    refreshUserData();
    alertSuccess('Profile updated!');
  }, onAuthError);
}
545404
function(typeName, id, snapshot) {
        // FIXME If there is a record, try and look up the self link
        // - Need to use the function from the serializer to build the self key
        // TODO: this basically only works in the simplest of scenarios
        var route = this.getRoute(typeName, id, snapshot);
        if(!route) {
          return this._super(typeName, id, snapshot);
        }

        var url = [];
        var host = get(this, 'host');
        var prefix = this.urlPrefix();
        var param = /\{(.*?)\}/g;

        if (id) {
          if (param.test(route)) {
            url.push(route.replace(param, id));
          } else {
            url.push(route);
          }
        } else {
          url.push(route.replace(param, ''));
        }

        if (prefix) {
          url.unshift(prefix);
        }

        url = url.join('/');

        if (!host && url) {
          url = '/' + url;
        }

        return url;
      }
639418
function getUserProfile(key, steamID, callback) {
  var steam = new SteamWebAPI({ apiKey: key, format: 'json' });

  steam.getPlayerSummaries({
    steamids: [ steamID ],
    callback: function(err, result) {
      if(err) {
        return callback(err);
      }

      var profile = {
        provider: 'steam',
        _json: result.response.players[0],
        id: result.response.players[0].steamid,
        displayName: result.response.players[0].personaname,
        photos: [{
          value: result.response.players[0].avatar
        }, {
          value: result.response.players[0].avatarmedium
        }, {
          value: result.response.players[0].avatarfull
        }]
      };

      callback(null, profile);
    }
  });
}
52364
def snapshot(self):
        
        return dict((category, dict((name, metric.value())
                                    for name, metric in list(metrics.items())))
                    for category, metrics in
                    list(self._store.items()))
210744
def get_user_details(self, response):
        
        user = response

        # Rename to what psa expects
        fullname = user.get('name', None)
        if fullname:
            user['fullname'] = fullname
            user.pop('name')

        # Get profile photo url if any
        profilephoto_id = user.get('profilephoto', None)
        if profilephoto_id:
            profilephoto_url = '{}/userinfo/v1/user/media/{}'.format(self.API_URL, profilephoto_id)
            user['profilephoto_url'] = profilephoto_url

        return user
27252
function profile(target, propertyKey, descriptor) {
    if (flags_1.IS_PROFILE) {
        return performProfile(target, propertyKey, descriptor);
    }
    else {
        // return as-is
        return descriptor;
    }
}
107701
def outputtemplate(self, template_id):
        """"""
        for profile in self.profiles:
            for outputtemplate in profile.outputtemplates():
                if outputtemplate.id == template_id:
                    return outputtemplate
        return KeyError("Outputtemplate " + template_id + " not found")
48438
def profile(name='stats', _stats=stats):
    """"""
    def _profile(function):
        def __profile(*args, **kw):
            start_time = timer()
            start_memory = _get_memory_usage()
            try:
                return function(*args, **kw)
            finally:
                total = timer() - start_time
                kstones = _seconds_to_kpystones(total)
                memory = _get_memory_usage() - start_memory
                _stats[name] = {'time': total,
                                'kstones': kstones,
                                'memory': memory}
        return __profile
    return _profile