Modify various attributes of the SuperToast before being shown.
503993
@SuppressLint("NewApi")
    @SuppressWarnings("deprecation")
    protected void onPrepareShow() {
        final int sdkVersion = android.os.Build.VERSION.SDK_INT;

        // Modify various attributes of the message TextView
        this.mTextView.setText(this.mStyle.message);
        this.mTextView.setTypeface(this.mTextView.getTypeface(), this.mStyle.messageTypefaceStyle);
        this.mTextView.setTextColor(this.mStyle.messageTextColor);
        this.mTextView.setTextSize(this.mStyle.messageTextSize);
        if (this.mStyle.messageIconResource > 0) {
            if (this.mStyle.messageIconPosition == Style.ICONPOSITION_LEFT) {
                this.mTextView.setCompoundDrawablesWithIntrinsicBounds(
                        this.mStyle.messageIconResource, 0, 0, 0);
            } else if (this.mStyle.messageIconPosition == Style.ICONPOSITION_TOP) {
                this.mTextView.setCompoundDrawablesWithIntrinsicBounds(
                        0, this.mStyle.messageIconResource, 0, 0);
            } else if (this.mStyle.messageIconPosition == Style.ICONPOSITION_RIGHT) {
                this.mTextView.setCompoundDrawablesWithIntrinsicBounds(
                        0, 0, this.mStyle.messageIconResource, 0);
            } else if (this.mStyle.messageIconPosition == Style.ICONPOSITION_BOTTOM) {
                this.mTextView.setCompoundDrawablesWithIntrinsicBounds(
                        0, 0, 0, this.mStyle.messageIconResource);
            }
        }

        // Handle depreciated API for setting the background
        if (sdkVersion >= Build.VERSION_CODES.JELLY_BEAN) {
            this.mView.setBackground(BackgroundUtils.getBackground(this.mStyle, this.mStyle.color));
            // Give Lollipop devices a nice shadow (does not work with transparent backgrounds)
            if (sdkVersion >= Build.VERSION_CODES.LOLLIPOP) mView.setElevation(3f);
        } else this.mView.setBackgroundDrawable(BackgroundUtils.getBackground(this.mStyle, this.mStyle.color));

        // Make adjustments that are specific to Lollipop frames
        if (this.mStyle.frame == Style.FRAME_LOLLIPOP) {
            this.mTextView.setGravity(Gravity.START);

            // We are on a big screen device, show the SuperToast on the bottom left with padding
            if ((this.mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
                    >= Configuration.SCREENLAYOUT_SIZE_LARGE) {
                this.mStyle.xOffset = BackgroundUtils.convertToDIP(12);
                this.mStyle.yOffset = BackgroundUtils.convertToDIP(12);
                this.mStyle.width = BackgroundUtils.convertToDIP(288);
                this.mStyle.gravity = Gravity.BOTTOM | Gravity.START;

                // Simple background shape with rounded corners
                final GradientDrawable gradientDrawable = new GradientDrawable();
                gradientDrawable.setCornerRadius(BackgroundUtils.convertToDIP(2));
                gradientDrawable.setColor(this.mStyle.color);

                // Handle depreciated API for setting the background
                if (sdkVersion >= Build.VERSION_CODES.JELLY_BEAN) this.mView.setBackground(gradientDrawable);
                else this.mView.setBackgroundDrawable(gradientDrawable);

            // We are NOT on a big screen device, show the SuperToast on the bottom with NO padding
            } else {
                this.mStyle.yOffset = 0;
                this.mStyle.width = FrameLayout.LayoutParams.MATCH_PARENT;
            }
            
            // Set the priority color of the Lollipop frame if any
            if (this.mStyle.priorityColor != 0) {
                mView.findViewById(R.id.border).setVisibility(View.VISIBLE);
                mView.findViewById(R.id.border).setBackgroundColor(this.mStyle.priorityColor);
            }
        }
        // Used for PriorityQueue comparisons
        this.getStyle().timestamp = System.currentTimeMillis();
    }
884285
def update_attributes(self, **original_kwargs):
        
        def update_attrs(layout_object):
            kwargs = original_kwargs.copy()
            if hasattr(layout_object, 'attrs'):
                if 'css_class' in kwargs:
                    if 'class' in layout_object.attrs:
                        layout_object.attrs['class'] += " %s" % kwargs.pop('css_class')
                    else:
                        layout_object.attrs['class'] = kwargs.pop('css_class')
                layout_object.attrs.update(kwargs)

        self.map(update_attrs)
199512
public static function PreCompile(){
            $oThis = self::CreateInstanceIfNotExists();
            $oThis->IncludeTemplate();
            $oThis->ReplaceVars();
            $oThis->RemoveUndefinedVars();
            $oThis->CheckConditions();
        }
424560
def enhance(self):
        
        self.update({'parameters':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemParameter)})
        self.update({'interfaces':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemInterface)})
        self.update({'subnets':
                    SubDict(self.api, self.objName,
                            self.payloadObj, self.key,
                            SubItemSubnet)})
603707
private void preprocess_ModifyShapeMembers(ServiceModel serviceModel, Shape shape, ShapeModifier modifier) {

        if (modifier.getModify() != null) {
            for (Map<String, ShapeModifier_ModifyModel> modifies : modifier.getModify()) {
                for (Entry<String, ShapeModifier_ModifyModel> entry : modifies.entrySet()) {

                    String memberToModify = entry.getKey();
                    ShapeModifier_ModifyModel modifyModel = entry.getValue();

                    doModifyShapeMembers(serviceModel, shape, memberToModify, modifyModel);
                }
            }
        }

        if (modifier.getExclude() != null) {
            for (String memberToExclude : modifier.getExclude()) {

                if (shape.getRequired() != null &&
                    shape.getRequired().contains(memberToExclude)) {
                    throw new IllegalStateException(
                            "ShapeModifier.exclude customization found for "
                                    + memberToExclude
                                    + ", but this member is marked as required in the model!");
                }

                if (shape.getMembers() != null) {
                    shape.getMembers().remove(memberToExclude);
                }
            }
        }

        if (modifier.getInject() != null) {
            for (Map<String, Member> injects : modifier.getInject()) {
                if (shape.getMembers() == null) {
                    shape.setMembers(new HashMap<>());
                }
                shape.getMembers().putAll(injects);
            }
        }

        if (modifier.getInjectEnumValues() != null) {
            if (shape.getEnumValues() == null) {
                throw new IllegalStateException("Attempted to add enum members to a non-enum shape!");
            }
            Set<String> extendValues = new HashSet<>(shape.getEnumValues());
            extendValues.addAll(modifier.getInjectEnumValues());
            shape.setEnumValues(new ArrayList<>(extendValues));
        }
    }
796446
def modify(self, modification, parameters):
        
        for src in self:
            src.modify(modification, parameters)
737419
def __update(self):
        

        # I can not set the size attr because it is my property, so I set the width and height separately
        width, height = self.size
        super(BaseWidget, self).__setattr__("width", width)
        super(BaseWidget, self).__setattr__("height", height)
        super(BaseWidget, self).__setattr__(self.anchor, self.pos)
845892
def on_change(self, attr, *callbacks):
        ''' 

        '''
        if len(callbacks) == 0:
            raise ValueError("on_change takes an attribute name and one or more callbacks, got only one parameter")

        _callbacks = self._callbacks.setdefault(attr, [])
        for callback in callbacks:

            if callback in _callbacks:
                continue

            _check_callback(callback, ('attr', 'old', 'new'))

            _callbacks.append(callback)
897720
def before_render(self):
        
        # We want to display the nav tabs, so we do NOT want disable_border in
        # the request. Thus, do not call super.before_render

        mtool = api.get_tool("portal_membership")
        if not mtool.checkPermission(AddAnalysisSpec, self.context):
            del self.context_actions[_("Add")]
1067591
def modify(name, old_value, new_value)
      @attributes[name] = new_value
      if @modifications && (old_value != new_value)
        original = @modifications[name].first if @modifications[name]
        @modifications[name] = [ (original || old_value), new_value ]
      end
    end
234173
void _setToDefault() {
		resizeAttributes(m_description.getTotalComponentCount());
		Point.attributeCopy(m_description._getDefaultPointAttributes(),
				m_attributes, m_description.getTotalComponentCount());
		m_attributes[0] = NumberUtils.NaN();
		m_attributes[1] = NumberUtils.NaN();
	}
853218
def prepend(self, tr):
        
        self.transforms.insert(0, tr)
        tr.changed.connect(self._subtr_changed)
        self._rebuild_shaders()
        self.update()
554389
def pre_render(self):
        """"""
        self.add_styles()
        self.add_scripts()
        self.root.set(
            'viewBox', '0 0 %d %d' % (self.graph.width, self.graph.height)
        )
        if self.graph.explicit_size:
            self.root.set('width', str(self.graph.width))
            self.root.set('height', str(self.graph.height))
437295
public function adjustPalettes(): void
    {
        // Load custom form config.
        $this->environment->enterContext(FormContext::forForm((int) CURRENT_ID));
        $widgets = $this->environment->getConfig()->get('form.widgets', []);

        foreach ($widgets as $name => $config) {
            if (!empty($config['input_group'])) {
                try {
                    MetaPalettes::appendFields('tl_form_field', $name, 'fconfig', ['bs_addInputGroup']);
                    // @codingStandardsIgnoreStart Catch statement is empty on purpose
                } catch (PaletteNotFoundException | LegacyPaletteNotFoundException $e) {
                    // Palette does not exist. Just skip it.
                }
                // @codingStandardsIgnoreEnd
            }
        }
    }
538738
function updateAttributes(instance) {
    if (instance.horizontalAlignment !== instance._lastHorizontalAlignment) {
      const horizontalAlignment = instance.horizontalAlignment === HORIZONTAL_ALIGN.LEFT ? 'left' : 'right'
      instance._root.setAttribute('data-horizontal-align', horizontalAlignment)
      instance._lastHorizontalAlignment = instance.horizontalAlignment
    }
    if (instance.verticalAlignment !== instance._lastVerticalAlignment) {
      const verticalAlignment = instance.verticalAlignment === VERTICAL_ALIGN.TOP ? 'top' : 'bottom'
      instance._root.setAttribute('data-vertical-align', verticalAlignment)
      instance._lastVerticalAlignment = instance.verticalAlignment
    }
  }
268073
private static void updateAttribute(Element parent, String attrName, String value) {

        if (parent != null) {
            Attribute attribute = parent.attribute(attrName);
            if (value != null) {
                if (attribute == null) {
                    parent.addAttribute(attrName, value);
                } else {
                    attribute.setValue(value);
                }
            } else {
                // remove only if exists
                if (attribute != null) {
                    parent.remove(attribute);
                }
            }
        }
    }
733873
function(name, func, superPrototype) {
		return function PseudoClass_setStaticSuper() {
			// Store the old super
			var previousSuper = this._super;

			// Use the method from the superclass' prototype
			// This strategy allows monkey patching (modification of superclass prototypes)
			this._super = superPrototype[name];

			// Call the actual function
			var ret = func.apply(this, arguments);

			// Restore the previous value of super
			// This is required so that calls to methods that use _super within methods that use _super work
			this._super = previousSuper;

			return ret;
		};
	}