:returns: A :class:`~okcupyd.profile.Profile` instance belonging
                  to the sender of this message.
434851
def sender(self):
        
        return (self._message_thread.user_profile
                if 'from_me' in self._message_element.attrib['class']
                else self._message_thread.correspondent_profile)
893526
def quickmatch(self):
        
        response = self._session.okc_get('quickmatch', params={'okc_api': 1})
        return Profile(self._session, response.json()['sn'])
408951
def profile(message=None, verbose=False):
    
    import functools
    from harrison.registered_timer import RegisteredTimer

    # Adjust the call stack index for RegisteredTimer so the call is Timer use
    # is properly attributed.
    class DecoratorTimer(RegisteredTimer):
        _CALLER_STACK_INDEX = 2

    def wrapper(fn):
        desc = message or fn.__name__

        @functools.wraps(fn)
        def wrapped_fn(*args, **kwargs):
            with DecoratorTimer(desc=desc, verbose=verbose):
                return fn(*args, **kwargs)
        return wrapped_fn

    return wrapper
153709
def _parse_profile(profile):
    '''
    
    '''
    if isinstance(profile, string_types):
        _profile = __salt__['config.option'](profile)
        if not _profile:
            msg = 'Pillar key for profile {0} not found.'.format(profile)
            raise SaltInvocationError(msg)
    else:
        _profile = profile
    hosts = _profile.get('hosts')
    index = _profile.get('index')
    return (hosts, index)
852431
def messaging(self):
        
        if self._messaging is None:
            from twilio.rest.messaging import Messaging
            self._messaging = Messaging(self)
        return self._messaging
388002
public String getProfileId() {
        return (data != null && data.payload != null) ? data.payload.profileId : null;
    }
440392
def get_profile_for_user(user):
    
    if not hasattr(user, '_yacms_profile'):
        # Raises ProfileNotConfigured if not bool(ACCOUNTS_PROFILE_MODEL)
        profile_model = get_profile_model()
        profile_manager = profile_model._default_manager.using(user._state.db)

        user_field = get_profile_user_fieldname(profile_model, user.__class__)
        profile, created = profile_manager.get_or_create(**{user_field: user})

        profile.user = user
        user._yacms_profile = profile

    return user._yacms_profile
398656
def get(self):
        
        mail = {
            'from': self._get_or_none(self.from_email),
            'subject': self._get_or_none(self.subject),
            'personalizations': [p.get() for p in self.personalizations or []],
            'content': [c.get() for c in self.contents or []],
            'attachments': [a.get() for a in self.attachments or []],
            'template_id': self._get_or_none(self.template_id),
            'sections': self._flatten_dicts(self.sections),
            'headers': self._flatten_dicts(self.headers),
            'categories': [c.get() for c in self.categories or []],
            'custom_args': self._flatten_dicts(self.custom_args),
            'send_at':  self._get_or_none(self.send_at),
            'batch_id': self._get_or_none(self.batch_id),
            'asm': self._get_or_none(self.asm),
            'ip_pool_name': self._get_or_none(self.ip_pool_name),
            'mail_settings': self._get_or_none(self.mail_settings),
            'tracking_settings': self._get_or_none(self.tracking_settings),
            'reply_to': self._get_or_none(self.reply_to),
        }

        return {key: value for key, value in mail.items()
                if value is not None and value != [] and value != {}}
1334909
public void profile(IoEventType type) {
        switch (type) {
            case MESSAGE_RECEIVED :
                profileMessageReceived = true;
                
                if (messageReceivedTimerWorker == null) {
                    messageReceivedTimerWorker = new TimerWorker();
                }
                
                return;
                
            case MESSAGE_SENT :
                profileMessageSent = true;
                
                if (messageSentTimerWorker == null) {
                    messageSentTimerWorker = new TimerWorker();
                }
                
                return;
                
            case SESSION_CREATED :
                profileSessionCreated = true;
                
                if (sessionCreatedTimerWorker == null) {
                    sessionCreatedTimerWorker = new TimerWorker();
                }
                
            case SESSION_OPENED :
                profileSessionOpened = true;
                
                if (sessionOpenedTimerWorker == null) {
                    sessionOpenedTimerWorker = new TimerWorker();
                }
                
            case SESSION_IDLE :
                profileSessionIdle = true;
                
                if (sessionIdleTimerWorker == null) {
                    sessionIdleTimerWorker = new TimerWorker();
                }
                
            case SESSION_CLOSED :
                profileSessionClosed = true;
                
                if (sessionClosedTimerWorker == null) {
                    sessionClosedTimerWorker = new TimerWorker();
                }
        }
    }
407804
public static Profile getCurrentProfile() {
        RequestContext context = RequestContext.getCurrent();
        if (context != null) {
            return getProfile(context.getRequest());
        } else {
            return null;
        }
    }
683534
def profile(self, profile):
        
        # clear staging data
        self._staging_data = None
        # retrieve language from install.json or assume Python
        lang = profile.get('install_json', {}).get('programLanguage', 'PYTHON')
        # load instance of ArgBuilder
        profile_args = ArgBuilder(lang, self.profile_args(profile.get('args')))
        # set current profile
        self._profile = profile
        # attach instance to current profile
        self._profile['profile_args'] = profile_args
        # load tcex module after current profile is set
        self.load_tcex()
        # select report for current profile
        self.reports.profile(profile.get('profile_name'))
        # create required directories for tcrun to function
        self._create_tc_dirs()
117378
def remove_profile(self):
        
        profile_name = self.profile_combo.currentText()
        # noinspection PyTypeChecker
        button_selected = QMessageBox.warning(
            None,
            'Remove Profile',
            self.tr('Remove %s.') % profile_name,
            QMessageBox.Ok,
            QMessageBox.Cancel
        )
        if button_selected == QMessageBox.Ok:
            self.profile_combo.removeItem(
                self.profile_combo.currentIndex()
            )
            self.minimum_needs.remove_profile(profile_name)
            self.select_profile(self.profile_combo.currentIndex())
958248
def profile
      unless @profile
        if associated_profile
          @profile = Profile.new(associated_profile)
        else
          options = {:fields => 'user_id', :includes => 'Profile'}
          options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)
          tmp = User.find(username, options)
          @profile = Profile.new(tmp.associated_profile)
        end
      end
      @profile
    end
278111
def get_profiles(self):
        
        out = set()
        for ft in self.features.values():
            out.update(ft.get_profiles())
        for ext in self.extensions.values():
            out.update(ext.get_profiles())
        return out
845487
def subject_id(self):
        

        if "subject" in self.message.keys():
            _subj = self.message.subject
            if "base_id" in _subj.keys() and _subj.base_id:
                return _subj.base_id
            elif _subj.name_id:
                return _subj.name_id
        else:
            if "base_id" in self.message.keys() and self.message.base_id:
                return self.message.base_id
            elif self.message.name_id:
                return self.message.name_id
            else:  # EncryptedID
                pass
271065
def get_profile(self):
        
        r = self._session.get(API_URL + "/logins/me")
        r.raise_for_status()

        return r.json()
406314
def profile_file(self):
        
        if 'profile' in self._kwargs and self._kwargs['profile']:
            profile_path = path.normpath(self._kwargs['profile'])
            if os.path.exists(profile_path) and os.path.isdir(profile_path):
                return path.join(
                    profile_path, '{}-{}.prof'.format(
                        os.getpid(), self._kwargs['consumer_name']))