set the current profile to W3C Note, RFC 3339, HTML5, or auto profile
320247
function() {
			switch( this.format.toLowerCase() ) {
				case 'microformat2':
					this.sep = ' ';
					this.dsep = '-';
					this.tsep = ':';
					this.tzsep = '';
					this.tzZulu = 'Z';
					break;
				case 'rfc3339':
					this.sep = 'T';
					this.dsep = '';
					this.tsep = '';
					this.tzsep = '';
					this.tzZulu = 'Z';
					break;
				case 'w3c':
					this.sep = 'T';
					this.dsep = '-';
					this.tsep = ':';
					this.tzsep = ':';
					this.tzZulu = 'Z';
					break;
				case 'html5':
					this.sep = ' ';
					this.dsep = '-';
					this.tsep = ':';
					this.tzsep = ':';
					this.tzZulu = 'Z';
					break;
				default:
					// auto - defined by format of input string
					this.sep = this.autoProfile.sep;
					this.dsep = this.autoProfile.dsep;
					this.tsep = this.autoProfile.tsep;
					this.tzsep = this.autoProfile.tzsep;
					this.tzZulu = this.autoProfile.tzZulu;
			}
		}
793289
def profile(curr_step, start_step, end_step, profile_name='profile.json',
            early_exit=True):
    """"""
    if curr_step == start_step:
        mx.nd.waitall()
        mx.profiler.set_config(profile_memory=False, profile_symbolic=True,
                               profile_imperative=True, filename=profile_name,
                               aggregate_stats=True)
        mx.profiler.set_state('run')
    elif curr_step == end_step:
        mx.nd.waitall()
        mx.profiler.set_state('stop')
        logging.info(mx.profiler.dumps())
        mx.profiler.dump()
        if early_exit:
            exit()
369723
def profile_view(request, semester, targetUsername, profile=None):
    
    wprofile = get_object_or_404(
        WorkshiftProfile,
        user__username=targetUsername,
        semester=semester
    )
    if wprofile == profile:
        page_name = "My Workshift Profile"
    else:
        page_name = "{}'s Workshift Profile".format(wprofile.user.get_full_name())

    past_shifts = WorkshiftInstance.objects.filter(
        Q(workshifter=wprofile) | Q(liable=wprofile),
        closed=True,
    )
    regular_shifts = RegularWorkshift.objects.filter(
        active=True, current_assignees=wprofile,
    )
    assigned_instances = WorkshiftInstance.objects.filter(
        Q(workshifter=wprofile) | Q(liable=wprofile),
        closed=False,
    ).exclude(
        weekly_workshift__current_assignees=wprofile,
    )
    pool_hours = wprofile.pool_hours.order_by(
        "-pool__is_primary", "pool__title",
    )
    first_standing, second_standing, third_standing = \
      any(pool_hours.first_date_standing for pool_hours in wprofile.pool_hours.all()), \
      any(pool_hours.second_date_standing for pool_hours in wprofile.pool_hours.all()), \
      any(pool_hours.third_date_standing for pool_hours in wprofile.pool_hours.all())

    full_management = utils.can_manage(request.user, semester=semester)
    any_management = utils.can_manage(request.user, semester, any_pool=True)
    view_note = wprofile == profile or full_management

    return render_to_response("profile.html", {
        "page_name": page_name,
        "profile": wprofile,
        "view_note": view_note,
        "past_shifts": past_shifts,
        "regular_shifts": regular_shifts,
        "assigned_instances": assigned_instances,
        "pool_hours": pool_hours,
        "first_standing": first_standing,
        "second_standing": second_standing,
        "third_standing": third_standing,
        "can_edit": any_management,
    }, context_instance=RequestContext(request))
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()
933219
public void setActiveProfile(long identifier, boolean fireOnProfileChanged) {
        if (mAccountHeaderBuilder.mProfiles != null) {
            for (IProfile profile : mAccountHeaderBuilder.mProfiles) {
                if (profile != null) {
                    if (profile.getIdentifier() == identifier) {
                        setActiveProfile(profile, fireOnProfileChanged);
                        return;
                    }
                }
            }
        }
    }
596722
public void setProfile(OperaProfile profile) {
    options.get(PROFILE).setValue(PROFILE.sanitize(profile));
    supportsPd = true;
  }
995285
async def SetCharmProfile(self, application, charm_url):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='Application',
                   request='SetCharmProfile',
                   version=8,
                   params=_params)
        _params['application'] = application
        _params['charm-url'] = charm_url
        reply = await self.rpc(msg)
        return reply
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'))
712671
async def _set_persistent_menu(self):
        

        page = self.settings()

        if 'menu' in page:
            await self._send_to_messenger_profile(page, {
                'persistent_menu': page['menu'],
            })

            logger.info('Set menu for page %s', page['page_id'])
564154
def profile(request):
    '''
    
    '''
    serializer_class = registration_settings.PROFILE_SERIALIZER_CLASS
    if request.method in ['POST', 'PUT', 'PATCH']:
        partial = request.method == 'PATCH'
        serializer = serializer_class(
            instance=request.user,
            data=request.data,
            partial=partial,
        )
        serializer.is_valid(raise_exception=True)
        serializer.save()
    else:  # request.method == 'GET':
        serializer = serializer_class(instance=request.user)

    return Response(serializer.data)
1001019
def saveProfile( self ):
        
        manager = self.parent()
        prof    = manager.currentProfile()
        
        # save the current profile
        save_prof = manager.viewWidget().saveProfile()
        prof.setXmlElement(save_prof.xmlElement())
703565
def mark_current_profile_as_pending(self):
        
        index = self.profile_combo.currentIndex()
        item = self.profile_combo.model().item(index)
        item.setForeground(QtGui.QColor('red'))
364827
def set_http_port(port=80):
    '''
    
    '''
    _current = global_settings()

    if _current['Global Settings']['HTTP_PORT']['VALUE'] == port:
        return True

    _xml = """<RIBCL VERSION="2.0">
                <LOGIN USER_LOGIN="adminname" PASSWORD="password">
                  <RIB_INFO MODE="write">
                    <MOD_GLOBAL_SETTINGS>
                      <HTTP_PORT value="{0}"/>
                    </MOD_GLOBAL_SETTINGS>
                  </RIB_INFO>
                </LOGIN>
              </RIBCL>""".format(port)

    return __execute_cmd('Set_HTTP_Port', _xml)
170758
def edit(parent, profile):
        
        dlg = XViewProfileDialog(parent)
        dlg.setProfile(profile)
        if ( dlg.exec_() ):
            return True
        return False
701969
def apply(self, reboot=False):
        """"""
        self.root.use_virtual_addresses = True
        self.root.manage.manage = True
        self.root.mode = 'new'
        self.root.init_boot = reboot

        self.client.set_profile(self.root.get_json())
212979
def _init_browser(self):
        
        chrome_options = webdriver.ChromeOptions()
        chrome_options.add_argument('--disable-extensions')
        chrome_options.add_argument('--disable-infobars')
        chrome_options.add_argument('--ignore-certificate-errors')
        chrome_options.add_experimental_option('prefs', {
            'profile.managed_default_content_settings.notifications': 1
        })

        browser = webdriver.Chrome(chrome_options=chrome_options)
        browser.set_page_load_timeout(10)
        browser.implicitly_wait(1)
        browser.maximize_window()
        browser.get(settings.HARNESS_URL)
        self._browser = browser
        if not wait_until(lambda: 'Thread' in browser.title, 30):
            self.assertIn('Thread', browser.title)
332424
def handleProfileChange(self):
        
        # restore the profile settings
        prof    = self.currentProfile()
        vwidget = self.viewWidget()
        if vwidget:
            prof.restore(vwidget)
        
        if not self.signalsBlocked():
            self.currentProfileChanged.emit(self.currentProfile())