Sets <PROFILE_ROOT>_PROFILE environment variable to the name of the current profile.
3912
def activate(self, profile_name=NotSet):
        
        if profile_name is NotSet:
            profile_name = self.profile_name
        self._active_profile_name = profile_name
1358105
def setProfile( self, profile ):
        
        self._profile = profile
        
        if not profile:
            self.uiNameTXT.setText('')
            self.uiVersionSPN.setValue(1.0)
            self.uiDescriptionTXT.setText('')
            self.uiIconBTN.setFilepath(resources.find('img/profile_48.png'))
        else:
            self.uiNameTXT.setText(profile.name())
            self.uiVersionSPN.setValue(profile.version())
            self.uiDescriptionTXT.setText(profile.description())
            
            filepath = profile.icon()
            if ( not filepath ):
                filepath = resources.find('img/profile_48.png')
            self.uiIconBTN.setFilepath(filepath)
612981
function() {
    // the attributes for multi-profile itself
    this.attr = trait({
      path: {
        value: this.path,
        type: {
          readOnly: true,
          setup: function(value) {
            if (!fs.isDir(value)) {
              fs.mkdir(value);
            }

            var profiles = this.profiles_file = node_path.join(value, 'profiles');
            var current = this.current_file = node_path.join(value, 'current_profile');

            profile.touchFile(profiles);
            profile.touchFile(current);
          }
        }
      },

      // get or set the names of profiles
      profiles: {
        type: {
          getter: function() {
            return fs.read(this.profiles_file).split(/[\r\n]+/).filter(Boolean);
          },

          setter: function(profiles) {
            fs.write(this.profiles_file, profiles.join('\n'));

            return profiles;
          }
        }
      },

      // get or set the name of the current profile
      current: {
        type: {
          getter: function() {
            return fs.read(this.current_file).trim() || null;
          },

          setter: function(v) {
            fs.write(this.current_file, v);

            return v;
          }
        }
      }
    }, {
      host: this
    });
  }
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()
142650
public static function setEnvironmentVariable($name, $value = null)
        {
            list($name, $value) = static::normaliseEnvironmentVariable($name, $value);

            // Don't overwrite existing environment variables if we're immutable
            // Ruby's dotenv does this with `ENV[key] ||= value`.
            if (true === static::$immutable && false === is_null(static::findEnvironmentVariable($name))) {
                return;
            }

            putenv("$name=$value");

            $_ENV[$name] = $value;
            $_SERVER[$name] = $value;
        }
164841
def profile(script, argv, profiler_factory,
            pickle_protocol, dump_filename, mono):
    """"""
    filename, code, globals_ = script
    sys.argv[:] = [filename] + list(argv)
    __profile__(filename, code, globals_, profiler_factory,
                pickle_protocol=pickle_protocol, dump_filename=dump_filename,
                mono=mono)
730657
def fromProfileName(cls, name):
        
        with profiles.ProfileStore.open() as config:
            return cls.fromProfile(config.load(name))
982661
def setCurrentProfile(self, profile):
        
        try:
            index = self._profiles.index(profile)
        except ValueError:
            index = -1
        
        self._profileCombo.setCurrentIndex(index)
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()
226108
def set_root_path(self, root_path=None, settings_module=None):
        
        if root_path:
            self.root_path = root_path
            return

        if settings_module:
            self.root_path = os.path.dirname(os.path.abspath(settings_module.__file__))
            return

        # try to guess which module import app.py
        import inspect

        caller = inspect.stack()[1]
        caller_module = inspect.getmodule(caller[0])
        assert hasattr(caller_module, '__file__'), 'Caller module %s should have __file__ attr' % caller_module
        self.root_path = os.path.dirname(os.path.abspath(caller_module.__file__))
144179
public static EnvironmentRule newInstance(String profile) {
        EnvironmentRule environmentRule = new EnvironmentRule();
        environmentRule.setProfile(profile);
        return environmentRule;
    }
637826
public void updateProfile(ProfileUpdate profile) {
		getResourceFactory().getApiResource("/user/profile/")
				.entity(profile, MediaType.APPLICATION_JSON_TYPE).put();
	}
616488
public void init(ServletContext context) {
        if (profiles != null) {
            for (IDiagramProfile profile : profiles) {
                profile.init(context);
                _registry.put(profile.getName(),
                              profile);
            }
        }
    }
5717
def SetStorageProfiler(self, storage_profiler):
    
    self._storage_profiler = storage_profiler
    if self._storage_file:
      self._storage_file.SetStorageProfiler(storage_profiler)
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())
1169302
public static function setEnvironmentVariable($name, $value = null)
    {
        list($name, $value) = static::normaliseEnvironmentVariable($name, $value);

        static::$variables[$name] = $value;
    }
220115
def update_path(self):
        
        if WINDOWS:
            return self.add_to_windows_path()

        # Updating any profile we can on UNIX systems
        export_string = self.get_export_string()

        addition = "\n{}\n".format(export_string)

        updated = []
        profiles = self.get_unix_profiles()
        for profile in profiles:
            if not os.path.exists(profile):
                continue

            with open(profile, "r") as f:
                content = f.read()

            if addition not in content:
                with open(profile, "a") as f:
                    f.write(addition)

                updated.append(os.path.relpath(profile, HOME))