Set up the core minion attributes.
        This is safe to call multiple times.
553077
def _setup_core(self):
        '''
        
        '''
        if not self.ready:
            # First call. Initialize.
            self.functions, self.returners, self.function_errors, self.executors = self._load_modules()
            self.serial = salt.payload.Serial(self.opts)
            self.mod_opts = self._prep_mod_opts()
#            self.matcher = Matcher(self.opts, self.functions)
            self.matchers = salt.loader.matchers(self.opts)
            self.beacons = salt.beacons.Beacon(self.opts, self.functions)
            uid = salt.utils.user.get_uid(user=self.opts.get('user', None))
            self.proc_dir = get_proc_dir(self.opts['cachedir'], uid=uid)
            self.grains_cache = self.opts['grains']
            self.ready = True
826912
def __initialize_node(self, attributes_flags=int(Qt.ItemIsSelectable | Qt.ItemIsEnabled)):
        

        attributes = dir(self.__component)
        for attribute in attributes:
            if attribute == "name":
                continue

            if not "_Profile__{0}".format(attribute) in attributes:
                continue

            value = getattr(self.__component, attribute)
            value = ", ".join(value) if type(value) in (tuple, list) else value
            roles = {Qt.DisplayRole: value,
                     Qt.EditRole: value}
            self[attribute] = umbra.ui.nodes.GraphModelAttribute(attribute, value, roles, attributes_flags)

        self.update_tool_tip()
1361623
def extend(self, **attributes):
        
        for key, value in attributes.iteritems():
            if not hasattr(self, key):
                setattr(self, key, value)
56161
void defineAttributesForStrictMode() {
        Context cx = Context.getContext();
        if (!cx.isStrictMode()) {
            return;
        }
        setGetterOrSetter("caller", 0, new ThrowTypeError("caller"), true);
        setGetterOrSetter("caller", 0, new ThrowTypeError("caller"), false);
        setGetterOrSetter("callee", 0, new ThrowTypeError("callee"), true);
        setGetterOrSetter("callee", 0, new ThrowTypeError("callee"), false);
        setAttributes("caller", DONTENUM | PERMANENT);
        setAttributes("callee", DONTENUM | PERMANENT);
        callerObj = null;
        calleeObj = null;
    }
538194
def _initialize(self, **resource_attributes):
        
        super(APIResourceCollection, self)._initialize(**resource_attributes)

        dict_list = self.data
        self.data = []
        for resource in dict_list:
            self.data.append(self._expected_api_resource(**resource))
838920
function init() {
        parent::init();
        // Set own core attributes
        $this->can_subaction = ACTION_NONE;
        //$this->can_subaction = ACTION_HAVE_SUBACTIONS;

        // Set own custom attributes
        $this->sesskey_protected = false; // This action doesn't need sesskey protection

        // Get needed strings
        $this->loadStrings(array(
            // 'key' => 'module',
        ));
    }
626334
def ensure_context_attribute_exists(context, name, default_value=None):
    
    if not hasattr(context, name):
        setattr(context, name, default_value)
1061598
private void init(Context context, AttributeSet attrs) {

        initAttributes(context, attrs);
        initPaintObjects();
        initDimensions();
        initPadding();
        initFloatingLabelAnimator();
        initOnItemSelectedListener();
        setMinimumHeight(getPaddingTop() + getPaddingBottom() + minContentHeight);
        //Erase the drawable selector not to be affected by new size (extra paddings)
        setBackgroundResource(R.drawable.my_background);

    }
968898
def _minion_event(self, load):
        '''
        
        '''
        load = self.__verify_load(load, ('id', 'tok'))
        if load is False:
            return {}
        # Route to master event bus
        self.masterapi._minion_event(load)
        # Process locally
        self._handle_minion_event(load)
109516
protected function initializeAttributes() {

		parent::initializeAttributes();

		$this->attributes['subtype'] = self::SUBTYPE;
		$this->attributes['access_id'] = ACCESS_PUBLIC;
	}
724558
def setattr(self, attr, new_value, close_the_changeset=True):
        """"""
        existing_value = getattr(self, attr, None)
        if existing_value != new_value:
            setattr(self, attr, new_value)
            self._changeset[attr] = new_value

        if close_the_changeset and self._changeset:
            self._call_callbacks()
508058
def apply_minion_config(overrides=None,
                        defaults=None,
                        cache_minion_id=False,
                        minion_id=None):
    '''
    
    '''
    if defaults is None:
        defaults = DEFAULT_MINION_OPTS.copy()
    if overrides is None:
        overrides = {}

    opts = defaults.copy()
    opts['__role'] = 'minion'
    _adjust_log_file_override(overrides, defaults['log_file'])
    if overrides:
        opts.update(overrides)

    if 'environment' in opts:
        if opts['saltenv'] is not None:
            log.warning(
                'The \'saltenv\' and \'environment\' minion config options '
                'cannot both be used. Ignoring \'environment\' in favor of '
                '\'saltenv\'.',
            )
            # Set environment to saltenv in case someone's custom module is
            # refrencing __opts__['environment']
            opts['environment'] = opts['saltenv']
        else:
            log.warning(
                'The \'environment\' minion config option has been renamed '
                'to \'saltenv\'. Using %s as the \'saltenv\' config value.',
                opts['environment']
            )
            opts['saltenv'] = opts['environment']

    for idx, val in enumerate(opts['fileserver_backend']):
        if val in ('git', 'hg', 'svn', 'minion'):
            new_val = val + 'fs'
            log.debug(
                'Changed %s to %s in minion opts\' fileserver_backend list',
                val, new_val
            )
            opts['fileserver_backend'][idx] = new_val

    opts['__cli'] = salt.utils.stringutils.to_unicode(
        os.path.basename(sys.argv[0])
    )

    # No ID provided. Will getfqdn save us?
    using_ip_for_id = False
    if not opts.get('id'):
        if minion_id:
            opts['id'] = minion_id
        else:
            opts['id'], using_ip_for_id = get_id(
                    opts,
                    cache_minion_id=cache_minion_id)

    # it does not make sense to append a domain to an IP based id
    if not using_ip_for_id and 'append_domain' in opts:
        opts['id'] = _append_domain(opts)

    for directory in opts.get('append_minionid_config_dirs', []):
        if directory in ('pki_dir', 'cachedir', 'extension_modules'):
            newdirectory = os.path.join(opts[directory], opts['id'])
            opts[directory] = newdirectory
        elif directory == 'default_include' and directory in opts:
            include_dir = os.path.dirname(opts[directory])
            new_include_dir = os.path.join(include_dir,
                                           opts['id'],
                                           os.path.basename(opts[directory]))
            opts[directory] = new_include_dir

    # pidfile can be in the list of append_minionid_config_dirs, but pidfile
    # is the actual path with the filename, not a directory.
    if 'pidfile' in opts.get('append_minionid_config_dirs', []):
        newpath_list = os.path.split(opts['pidfile'])
        opts['pidfile'] = os.path.join(newpath_list[0], 'salt', opts['id'], newpath_list[1])

    if len(opts['sock_dir']) > len(opts['cachedir']) + 10:
        opts['sock_dir'] = os.path.join(opts['cachedir'], '.salt-unix')

    # Enabling open mode requires that the value be set to True, and
    # nothing else!
    opts['open_mode'] = opts['open_mode'] is True
    opts['file_roots'] = _validate_file_roots(opts['file_roots'])
    opts['pillar_roots'] = _validate_pillar_roots(opts['pillar_roots'])
    # Make sure ext_mods gets set if it is an untrue value
    # (here to catch older bad configs)
    opts['extension_modules'] = (
        opts.get('extension_modules') or
        os.path.join(opts['cachedir'], 'extmods')
    )
    # Set up the utils_dirs location from the extension_modules location
    opts['utils_dirs'] = (
        opts.get('utils_dirs') or
        [os.path.join(opts['extension_modules'], 'utils')]
    )

    # Insert all 'utils_dirs' directories to the system path
    insert_system_path(opts, opts['utils_dirs'])

    # Prepend root_dir to other paths
    prepend_root_dirs = [
        'pki_dir', 'cachedir', 'sock_dir', 'extension_modules', 'pidfile',
    ]

    # These can be set to syslog, so, not actual paths on the system
    for config_key in ('log_file', 'key_logfile'):
        if urlparse(opts.get(config_key, '')).scheme == '':
            prepend_root_dirs.append(config_key)

    prepend_root_dir(opts, prepend_root_dirs)

    # if there is no beacons option yet, add an empty beacons dict
    if 'beacons' not in opts:
        opts['beacons'] = {}

    if overrides.get('ipc_write_buffer', '') == 'dynamic':
        opts['ipc_write_buffer'] = _DFLT_IPC_WBUFFER

    # Make sure hash_type is lowercase
    opts['hash_type'] = opts['hash_type'].lower()

    # Check and update TLS/SSL configuration
    _update_ssl_config(opts)
    _update_discovery_config(opts)

    return opts
610467
def _connect_minion(self, minion):
        '''
        
        '''
        auth_wait = minion.opts['acceptance_wait_time']
        failed = False
        while True:
            if failed:
                if auth_wait < self.max_auth_wait:
                    auth_wait += self.auth_wait
                log.debug(
                    "sleeping before reconnect attempt to %s [%d/%d]",
                   minion.opts['master'],
                    auth_wait,
                    self.max_auth_wait,
                )
                yield tornado.gen.sleep(auth_wait)  # TODO: log?
            try:
                if minion.opts.get('beacons_before_connect', False):
                    minion.setup_beacons(before_connect=True)
                if minion.opts.get('scheduler_before_connect', False):
                    minion.setup_scheduler(before_connect=True)
                yield minion.connect_master(failed=failed)
                minion.tune_in(start=False)
                self.minions.append(minion)
                break
            except SaltClientError as exc:
                failed = True
                log.error(
                    'Error while bringing up minion for multi-master. Is '
                    'master at %s responding?', minion.opts['master']
                )
            except SaltMasterUnresolvableError:
                err = 'Master address: \'{0}\' could not be resolved. Invalid or unresolveable address. ' \
                      'Set \'master\' value in minion config.'.format(minion.opts['master'])
                log.error(err)
                break
            except Exception as e:
                failed = True
                log.critical(
                    'Unexpected error while connecting to %s',
                    minion.opts['master'], exc_info=True
                )
860290
def _set_attributes(self):
        
        # turn config dict into nested objects
        config = obj(self._config_dict)
        # set the attributes onto instance
        for k, v in self._config_dict.items():
            setattr(self, k, getattr(config, k))
178793
def set_attribute(self, name, value):
        """"""
        self.attribute_name = name
        self.attribute = value
967508
def set_attributes(node, overwrite=True, **attributes):
    
    aset = node.attrs
    for k, v in attributes.items():
        if not overwrite and k in aset:
            pass
        elif v is None:
            if k in aset:
                del aset[k]
        else:
            aset[k] = v
1192116
public function set_attributes() {

		if ( ! empty( $this->struct['size'] ) ) {
			$this->attributes['class'][] = 'uix-grid';
			$this->attributes['class'][] = 'col-' . implode( '-', $this->struct['size'] );
		}

		parent::set_attributes();
	}