Returns the currently selected profile from the system.
        
        :return     <XViewProfile>
424674
def currentProfile(self):
        
        index = self._profileCombo.currentIndex()
        
        if 0 <= index and index < len(self._profiles):
            return self._profiles[index]
        return None
693193
def showProfileMenu(self, point):
        
        if not self.isEditingEnabled():
            return
        
        trigger = self.actionAt(point)
        if (isinstance(trigger, XViewProfileAction)):
            prof = trigger.profile()
        else:
            prof = None
        
        # define the menu
        menu = QMenu(self)
        acts = {}
        text = self.profileText()
        
        # user right clicked on a profile
        if prof:
            acts['edit'] = menu.addAction('Edit {0}...'.format(text))
            acts['save'] = menu.addAction('Save Layout')
            
            menu.addSeparator()
            
            acts['copy'] = menu.addAction('Copy {0}'.format(text))
            acts['export'] = menu.addAction('Export {0}...'.format(text))
            
            menu.addSeparator()
            
            acts['remove'] = menu.addAction('Delete {0}'.format(text))
        
        # show toolbar options
        else:
            acts['new'] = menu.addAction('New Layout'.format(text))
            
            menu.addSeparator()
            
            acts['save_as'] = menu.addAction('Save Layout as...')
            
            if QApplication.clipboard().text():
                acts['paste'] = menu.addAction('Paste {0}'.format(text))
            acts['import'] = menu.addAction('Import {0}...'.format(text))
        
        for key, act in acts.items():
            act.setIcon(QIcon(resources.find('img/{0}.png'.format(key))))
        
        # run the menu
        act = menu.exec_(QCursor.pos())
        
        # create a new profile
        if act is None:
            return
        
        elif act == acts.get('new'):
            self.clearActive()
        
        # create a new clear profile
        elif act == acts.get('save_as'):
            self.saveProfileAs()
        
        # edit an existing profile
        elif act == acts.get('edit'):
            self.editProfile(prof)
        
        # save or create a new profile
        elif act == acts.get('save'):
            self.saveProfileLayout(prof)
            
        # copy profile
        elif act == acts.get('copy'):
            QApplication.clipboard().setText(prof.toString())
        
        # export
        elif act == acts.get('export'):
            self.exportProfile(prof)
        
        # export
        elif act == acts.get('import'):
            self.importProfile()
        
        # paste profile
        elif act == acts.get('paste'):
            text = QApplication.clipboard().text()
            try:
                prof = XViewProfile.fromString(text)
            except:
                prof = None
                QMessageBox.information(self.window(),
                                        'Invalid {0}'.format(text),
                                        'The clipboard text does not contain '\
                                        'a properly formated {0}'.format(text))
                
            if prof and not prof.isEmpty():
                self.createProfile(profile=prof)
        
        # paste as profile
        elif act == acts.get('paste_as'):
            text = QApplication.clipboard().text()
            prof = XViewProfile.fromString(text)
            if not prof.isEmpty():
                if XViewProfileDialog.edit(self, prof):
                    self.createProfile(profile=prof)
        
        # remove the profile
        elif act == acts.get('remove'):
            self.removeProfile(prof)
271065
def get_profile(self):
        
        r = self._session.get(API_URL + "/logins/me")
        r.raise_for_status()

        return r.json()
941530
def load_activation_profiles(self):
        
        # We do here some lazy loading.
        if not self._load_activation_profiles:
            self._load_activation_profiles = \
                ActivationProfileManager(self, profile_type='load')
        return self._load_activation_profiles
975814
def lookup(self, profile, setting):
        
        for path in profiles():
            cfg = SafeConfigParser()
            cfg.read(path)
            if profile not in cfg.sections():
                continue
            if not cfg.has_option(profile, setting):
                continue
            return cfg.get(profile, setting)
395947
def get_profile(A):
    ""
    try:
        with open(os.path.expanduser(A.profile)) as I:
            profile = json.load(I)
        return profile
    except:
        return {}
1094042
def _get_profile(self, profile_id):
        ''''''
        profile_metadata = self._registry.get(profile_id)
        if not profile_metadata:
            return

        path = self._get_absolute_path(profile_metadata.get('schema_path'))
        if path and os.path.isfile(path):
            return self._load_json_file_or_url(path)

        url = profile_metadata.get('schema')
        if url:
            return self._load_json_file_or_url(url)
617248
def active():
    '''
    
    '''

    # turn off all profiles
    result = __salt__['cmd.run']('tuned-adm active')
    pattern = re.compile(r'''(?P<stmt>Current active profile:) (?P<profile>\w+.*)''')
    match = re.match(pattern, result)
    return '{0}'.format(match.group('profile'))
929673
def ManagedPreferenceProfile(self, data=None, subset=None):
        """"""
        return self.factory.get_object(jssobjects.ManagedPreferenceProfile,
                                       data, subset)
1277461
def get_profile(profile, caller, runner):
    '''
    
    '''
    profiles = profile.split(',')
    data = {}
    for profile in profiles:
        if os.path.basename(profile) == profile:
            profile = profile.split('.')[0]  # Trim extension if someone added it
            profile_path = os.path.join(os.path.dirname(__file__), 'profiles', profile + '.yml')
        else:
            profile_path = profile
        if os.path.exists(profile_path):
            try:
                rendered_template = _render_profile(profile_path, caller, runner)
                line = '-' * 80
                log.debug('\n%s\n%s\n%s\n', line, rendered_template, line)
                data.update(yaml.load(rendered_template))
            except Exception as ex:
                log.debug(ex, exc_info=True)
                raise salt.exceptions.SaltException('Rendering profile failed: {}'.format(ex))
        else:
            raise salt.exceptions.SaltException('Profile "{}" is not found.'.format(profile))

    return data
1032181
public Observable<ComapiResult<Map<String, Object>>> getProfile(@NonNull final String profileId) {

        final String token = getToken();

        if (sessionController.isCreatingSession()) {
            return getTaskQueue().queueGetProfile(profileId);
        } else if (TextUtils.isEmpty(token)) {
            return Observable.error(getSessionStateErrorDescription());
        } else {
            return doGetProfile(token, profileId);
        }
    }
885348
def all(self):
        
        attribute = self._attr[0]
        return self.profile.data.get(attribute, [])
474918
def profile(self):
        
        if self._profile is None:
            self._profile = self.build_profile()
        return self._profile
982661
def setCurrentProfile(self, profile):
        
        try:
            index = self._profiles.index(profile)
        except ValueError:
            index = -1
        
        self._profileCombo.setCurrentIndex(index)
714399
def get_full_profile(self, scope='profile/private'):
        
        profile = _get(
            token=self.oauth.get_user_token(scope),
            uri='/user/profile'
        )

        try:
            return json.loads(profile)
        except:
            raise MxitAPIException('Error parsing profile data')
1231771
def getProfile(self):
        
        if self._create:
            return ObjectProfile()
        else:
            if self._profile is None:
                r = self.api.getObjectProfile(self.pid)
                self._profile = parse_xml_object(ObjectProfile, r.content, r.url)
            return self._profile
411923
public function getCurrent()
    {
        if (!$this->currentProfile) {
            // first check to see if we have a Profile in the session
            if ($profile_id = $this->session->get('profile_id')) {
                // we do, so try and grap it from the db
                $this->currentProfile = $this->doctrine->getManager()
                    ->getRepository('HarvestCloudCoreBundle:Profile')
                    ->find($profile_id)
                ;
            }

            $user = $this->context->getToken()->getUser();

            // try to get the current User's default Profile
            if (!$this->currentProfile) {
                $this->currentProfile = $user->getDefaultProfile();
            }

            // try to get the User's first Profile
            if (!$this->currentProfile) {
                foreach ($user->getProfiles() as $profile) {
                    $this->currentProfile = $profile;

                    break;
                }
            }

            if (!$this->currentProfile) {
                $this->session->remove('profile_id');

                throw new \Exception('Cannot find current Profile');
            }

            $this->session->set('profile_id', $this->currentProfile->getId());
        }

        return $this->currentProfile;
    }