AFAIK, profile covers only provided on pages, not users
421975
def upload_profile_cover filename
      # The Marketing API should be enabled for the APP to use this feature
      raise_not_provided_error unless switch_to_page

      media_info = page_client.put_picture(filename)
      page_client.put_connections("me", "/", { cover: media_info['id'] })
    end
492921
def my_profile_view(request):
    '''  '''
    page_name = "Profile Page"
    if request.user.username == ANONYMOUS_USERNAME:
        return red_home(request, MESSAGES['SPINELESS'])
    userProfile = UserProfile.objects.get(user=request.user)
    change_password_form = PasswordChangeForm(
        request.user,
        request.POST if "submit_password_form" in request.POST else None,
        )
    update_email_form = UpdateEmailForm(
        request.POST if "submit_profile_form" in request.POST else None,
        instance=request.user,
        prefix="user",
        )
    update_profile_form = UpdateProfileForm(
        request.POST if "submit_profile_form" in request.POST else None,
        instance=userProfile,
        prefix="profile",
        )
    if change_password_form.is_valid():
        change_password_form.save()
        messages.add_message(request, messages.SUCCESS,
                             "Your password was successfully changed.")
        return HttpResponseRedirect(reverse('my_profile'))
    if update_email_form.is_valid() and update_profile_form.is_valid():
        update_email_form.save()
        update_profile_form.save()
        messages.add_message(request, messages.SUCCESS,
                             "Your profile has been successfully updated.")
        return HttpResponseRedirect(reverse('my_profile'))
    return render_to_response('my_profile.html', {
        'page_name': page_name,
        "update_email_form": update_email_form,
        'update_profile_form': update_profile_form,
        'change_password_form': change_password_form,
        }, context_instance=RequestContext(request))
986380
def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs):
    '''
    
    '''
    return __salt__['pagerduty_util.resource_present']('users',
                                                       ['email', 'name', 'id'],
                                                       None,
                                                       profile,
                                                       subdomain,
                                                       api_key,
                                                       **kwargs)
688787
function createProfile(done) {
            if (self.closed) return done(null);

            temp.mkdir('browser-controller', function(err, dirpath) {
                if (err) return done(err);

                self.userDir = dirpath;

                done(null);
            });
        }
621909
protected static function formProfile() {

		check_admin_referer( 'pb-user-catalog' );

		$user_id = isset( $_REQUEST['user_id'] ) ? absint( $_REQUEST['user_id'] ) : 0;

		if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) ) {
			wp_die( __( 'You do not have permission to do that.', 'pressbooks' ) );
		}

		// Set Redirect URL
		if ( get_current_user_id() !== $user_id ) {
			$redirect_url = get_admin_url( get_current_blog_id(), '/index.php?page=pb_catalog&user_id=' . $user_id );
		} else {
			$redirect_url = get_admin_url( get_current_blog_id(), '/index.php?page=pb_catalog' );
		}

		/* Go! */

		$catalog = new static( $user_id );
		$catalog->saveProfile( $_POST );
		$catalog->uploadLogo( 'pb_catalog_logo' );

		$catalog->deleteCache();

		// Ok!
		$_SESSION['pb_notices'][] = __( 'Settings saved.' );

		// Redirect back to form
		\Pressbooks\Redirect\location( $redirect_url );
	}
181685
function (){
    var out = {}

    if(this.profiles.length !== 0){
      out.profiles = this.profiles
    }

    if(this.noProfilesFound.length !== 0){
      out.noProfilesFound = this.noProfilesFound;
    }

    if(utils.hasProperties(this.combinedProfile)){
      out.combinedProfile = this.combinedProfile
    }

    return out;
  }
458125
protected boolean onlyVisibleForOU(CmsUUID userId) {

        try {
            if (m_app.isOUManagable(m_cms.readUser(userId).getOuFqn())) {
                return true;
            }
        } catch (CmsException e) {
            //
        }
        return false;
    }
716408
def create(self, weeks):
        """"""
        user_pageviews = self.create_profiles('Pageviews', weeks)
        user_downloads = self.create_profiles('Downloads', weeks)

        self._export_profiles('Profiles', user_pageviews, user_downloads)

        user_pageviews = self.create_profiles('Pageviews_IP', weeks, True)
        user_downloads = self.create_profiles('Downloads_IP', weeks, True)

        self._export_profiles('Profiles_IP', user_pageviews, user_downloads,
                              ip_user=True)
886600
public function profile()
    {
        if ($this->config()->get('disable_profiles')) {
            $this->httpError(404, 'Not Found');
        }

        $profile = $this->getCurrentProfile();

        if (!$profile) {
            return $this->httpError(404, 'Not Found');
        }

        $this->blogPosts = $this->getCurrentProfilePosts();

        return $this->render();
    }
1364153
def get_basic_profile(self, user_id, scope='profile/public'):
        
        profile = _get(
            token=self.oauth.get_app_token(scope),
            uri='/user/profile/' + urllib.quote(user_id)
        )

        try:
            return json.loads(profile)
        except:
            raise MxitAPIException('Error parsing profile data')
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);
}
40236
function getProfile(provider, access_token, callback) {
  let fields;
  switch (provider) {
    case 'facebook':
      facebook.query().get('me?fields=name,email').auth(access_token).request(function (err, res, body) {
        if (err) {
          callback(err);
        } else {
          callback(null, {
            username: body.name,
            email: body.email
          });
        }
      });
      break;
    case 'google':
      google.query('plus').get('people/me').auth(access_token).request(function (err, res, body) {
        if (err) {
          callback(err);
        } else {
          callback(null, {
            username: body.displayName,
            email: body.emails[0].value
          });
        }
      });
      break;
    case 'github':
      github.query().get('user').auth(access_token).request(function (err, res, body) {
        if (err) {
          callback(err);
        } else {
          callback(null, {
            username: body.login,
            email: body.email
          });
        }
      });
      break;
    case 'linkedin2':
      fields = [
        'public-profile-url', 'email-address'
      ];
      linkedin.query().select('people/~:(' + fields.join() + ')?format=json').auth(access_token).request(function (err, res, body) {
        if (err) {
          callback(err);
        } else {
          callback(null, {
            username: substr(body.publicProfileUrl.lastIndexOf('/') + 1),
            email: body.emailAddress
          });
        }
      });
      break;
    default:
      callback({
        message: 'Unknown provider.'
      });
      break;
  }
}
1244194
def visible_for?(user)
      can_view_page = (
        if dropdown?
          true
        elsif menuable.kind_of?(Effective::Page)
          menuable.roles_permit?(user)
        else
          true
        end
      )

      can_view_menu_item = (
        if roles_mask == nil
          true
        elsif roles_mask == -1 # Am I logged out?
          user.blank?
        elsif roles_mask == 0 # Am I logged in?
          user.present?
        else
          roles_permit?(user)
        end
      )

      can_view_page && can_view_menu_item
    end
1170236
function() {
		App.currentUser.signOut();
		App.viewStack.clear();
		App.router.redirect('/');
		$('#fill_profile_invitation').hide();
	}
427482
def getUserProfilePhotos(self, user_id,
                             offset=None,
                             limit=None):
        
        p = _strip(locals())
        return self._api_request('getUserProfilePhotos', _rectify(p))
1227490
def member_profile_view(request, targetUsername):
    '''  '''
    if targetUsername == request.user.username and targetUsername != ANONYMOUS_USERNAME:
        return HttpResponseRedirect(reverse('my_profile'))
    page_name = "{0}'s Profile".format(targetUsername)
    targetUser = get_object_or_404(User, username=targetUsername)
    targetProfile = get_object_or_404(UserProfile, user=targetUser)
    number_of_threads = Thread.objects.filter(owner=targetProfile).count()
    number_of_messages = Message.objects.filter(owner=targetProfile).count()
    number_of_requests = Request.objects.filter(owner=targetProfile).count()
    rooms = Room.objects.filter(current_residents=targetProfile)
    prev_rooms = PreviousResident.objects.filter(resident=targetProfile)
    return render_to_response('member_profile.html', {
        'page_name': page_name,
        'targetUser': targetUser,
        'targetProfile': targetProfile,
        'number_of_threads': number_of_threads,
        'number_of_messages': number_of_messages,
        'number_of_requests': number_of_requests,
        "rooms": rooms,
        "prev_rooms": prev_rooms,
        }, context_instance=RequestContext(request))
1256691
def cover(self, pageid):
        
        r = requests.get(self.api,
                         params={'action': 'query', 'prop': 'pageimages', 'pageids': pageid, 'format': 'json'},
                         headers=self.header)
        jsd = r.json()
        image = "File:" + jsd['query']['pages'][str(pageid)]['pageimage']
        r = requests.get(self.api,
                         params={'action': 'query', 'prop': 'imageinfo', 'iiprop': 'url', 'titles': image,
                                 'format': 'json'},
                         headers=self.header)
        jsd = r.json()
        return jsd['query']['pages'][list(jsd['query']['pages'].keys())[0]]['imageinfo'][0]['url']